db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Matrigali <mikem_...@sbcglobal.net>
Subject Re: Is there any means to get the size of a log record?
Date Wed, 01 Mar 2006 01:12:08 GMT
I have not had time to look at the specific code.  My guess is that
you will have to add code to the redo and undo recovery loops to
track how much they have read.  This may involve changing the internal
interfaces to get at lengths of each log record - not sure.

you might look at the code that tracks how much log space has been
using in normal logging currently used for scheduling a checkpoint
as a pointer to how to track log size.

Raymond Raymond wrote:
> I am trying to do some statistics to estimate recovery speed.
> I can get how many log records the recovery process scaned
> during the recovery and how long the recovery takes.The recovery
> speed I got so far is something like
> X log records/second
> But, to use the recovery speed to schedule the checkpoint,
> I need it likes
> X KB/second
> I looked into the org.apache.derby.impl.store.raw.log.LogToFile.java .
> The checkpoint is trigger in the flush(long fileNumber, long wherePosition)
> function. The condition to trigger a checkpoint is :
> if ((logWrittenFromLastCheckPoint + potentialLastFlush) > 
> checkpointInterval &&
> ?checkpointDaemon != null && !checkpointDaemonCalled && !inLogSwitch)
> logWrittenFromLastCheckPoint, potentialLastFlush and?checkpointInterval
> are in size (X bytes), so, I need the revovery speed in size (e.g. X 
> KB/second).
> In another word, I want to know how much (KB) log the recovery process
> scaned during recovery. I refered to
> http://db.apache.org/derby/papers/logformats.html,
> it says the log record wrapper keeps the length of the log record.
> I checked the source code and found the length of the log record
> is only used in the getNextRecordBackward() and getNextRecordForward()
> functions in org.apache.derby.impl.store.raw.log.Scan.java. I can't
> get it outside those functions. Anyone can give me some suggestions to
> solve the problem?
> Thanks.
> Raymond
> _________________________________________________________________
> Powerful Parental Controls Let your child discover the best the Internet 
> has to offer.  
> http://join.msn.com/?pgmarket=en-ca&page=byoa/prem&xAPID=1994&DI=1034&SU=http://hotmail.com/enca&HL=Market_MSNIS_Taglines

>  Start enjoying all the benefits of MSNĀ® Premium right now and get the 
> first two months FREE*.

View raw message