com.sleepycat.je.cleaner
Class FileSummary

java.lang.Object
  extended by com.sleepycat.je.cleaner.FileSummary
All Implemented Interfaces:
LogReadable, LogWritable
Direct Known Subclasses:
TrackedFileSummary

public class FileSummary
extends Object
implements LogWritable, LogReadable


Field Summary
 int obsoleteINCount
           
 int obsoleteLNCount
           
 int totalCount
           
 int totalINCount
           
 int totalINSize
           
 int totalLNCount
           
 int totalLNSize
           
 int totalSize
           
 
Constructor Summary
FileSummary()
          Creates an empty summary.
 
Method Summary
 void add(FileSummary o)
          Add the totals of the given summary object to the totals of this object.
 void dumpLog(StringBuffer buf, boolean verbose)
          Write the object into the string buffer for log dumping.
 int getEntriesCounted()
          Returns the total number of entries counted.
 int getLogSize()
           
 int getNonObsoleteCount()
          Returns the number of non-obsolete LN and IN entries.
 int getObsoleteINSize()
          Returns the approximate byte size of all obsolete IN entries.
 int getObsoleteLNSize()
          Returns the approximate byte size of all obsolete LN entries.
 int getObsoleteSize()
          Returns an estimate of the total bytes that are obsolete.
 long getTransactionId()
          Never called.
 boolean isEmpty()
          Returns whether this summary contains any non-zero totals.
 boolean logEntryIsTransactional()
          Never called.
 void readFromLog(ByteBuffer buf, byte entryTypeVersion)
          Initialize this object from the data in itemBuf.
 void reset()
          Reset all totals to zero.
 String toString()
           
 void writeToLog(ByteBuffer buf)
          Serialize this object into the buffer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

totalCount

public int totalCount

totalSize

public int totalSize

totalINCount

public int totalINCount

totalINSize

public int totalINSize

totalLNCount

public int totalLNCount

totalLNSize

public int totalLNSize

obsoleteINCount

public int obsoleteINCount

obsoleteLNCount

public int obsoleteLNCount
Constructor Detail

FileSummary

public FileSummary()
Creates an empty summary.

Method Detail

isEmpty

public boolean isEmpty()
Returns whether this summary contains any non-zero totals.


getObsoleteLNSize

public int getObsoleteLNSize()
Returns the approximate byte size of all obsolete LN entries.


getObsoleteINSize

public int getObsoleteINSize()
Returns the approximate byte size of all obsolete IN entries.


getObsoleteSize

public int getObsoleteSize()
                    throws DatabaseException
Returns an estimate of the total bytes that are obsolete.

Throws:
DatabaseException

getEntriesCounted

public int getEntriesCounted()
Returns the total number of entries counted. This value is guaranted to increase whenever the tracking information about a file changes. It is used a key discriminator for FileSummaryLN records.


getNonObsoleteCount

public int getNonObsoleteCount()
Returns the number of non-obsolete LN and IN entries.


reset

public void reset()
Reset all totals to zero.


add

public void add(FileSummary o)
Add the totals of the given summary object to the totals of this object.


getLogSize

public int getLogSize()
Specified by:
getLogSize in interface LogWritable
Returns:
number of bytes used to store this object.
See Also:
LogWritable.getLogSize()

writeToLog

public void writeToLog(ByteBuffer buf)
Description copied from interface: LogWritable
Serialize this object into the buffer.

Specified by:
writeToLog in interface LogWritable
Parameters:
buf - is the destination buffer
See Also:
LogWritable.writeToLog(java.nio.ByteBuffer)

readFromLog

public void readFromLog(ByteBuffer buf,
                        byte entryTypeVersion)
Description copied from interface: LogReadable
Initialize this object from the data in itemBuf.

Specified by:
readFromLog in interface LogReadable
See Also:
LogReadable.readFromLog(java.nio.ByteBuffer, byte)

dumpLog

public void dumpLog(StringBuffer buf,
                    boolean verbose)
Description copied from interface: LogReadable
Write the object into the string buffer for log dumping. Each object should be dumped without indentation or new lines and should be valid XML.

Specified by:
dumpLog in interface LogReadable
Parameters:
buf - destination string buffer
verbose - if true, dump the full, verbose version
See Also:
LogReadable.dumpLog(java.lang.StringBuffer, boolean)

getTransactionId

public long getTransactionId()
Never called.

Specified by:
getTransactionId in interface LogReadable
Returns:
return the transaction id if this log entry is transactional, 0 otherwise.
See Also:
LogReadable.getTransactionId()

logEntryIsTransactional

public boolean logEntryIsTransactional()
Never called.

Specified by:
logEntryIsTransactional in interface LogReadable
Returns:
true if the LogEntry is a transactional log entry type.
See Also:
LogReadable.logEntryIsTransactional()

toString

public String toString()
Overrides:
toString in class Object


Copyright 2004-2005 Sleepycat, Inc. All Rights Reserved.