com.sleepycat.je.log
Interface Loggable

All Known Implementing Classes:
AutoTxn, BIN, BINDelta, CheckpointEnd, CheckpointStart, ChildReference, DatabaseId, DatabaseImpl, DBIN, DbTree, DeltaInfo, DIN, DupCountLN, FileHeader, FileSummary, FileSummaryLN, IN, INDeleteInfo, INDupDeleteInfo, LN, MapLN, NameLN, Node, PackedOffsets, Tracer, TrackedFileSummary, Tree, Txn, TxnAbort, TxnCommit, TxnEnd, TxnPrepare, VLSN

public interface Loggable

A class that implements Loggable knows how to read and write itself into a ByteBuffer in a format suitable for the JE log or JE replication messages.


Method Summary
 void dumpLog(java.lang.StringBuffer sb, boolean verbose)
          Write the object into the string buffer for log dumping.
 int getLogSize()
           
 long getTransactionId()
           
 void readFromLog(java.nio.ByteBuffer itemBuffer, byte entryTypeVersion)
          Initialize this object from the data in itemBuf.
 void writeToLog(java.nio.ByteBuffer logBuffer)
          Serialize this object into the buffer.
 

Method Detail

getLogSize

int getLogSize()
Returns:
number of bytes used to store this object.

writeToLog

void writeToLog(java.nio.ByteBuffer logBuffer)
Serialize this object into the buffer.

Parameters:
logBuffer - is the destination buffer

readFromLog

void readFromLog(java.nio.ByteBuffer itemBuffer,
                 byte entryTypeVersion)
                 throws LogException
Initialize this object from the data in itemBuf.

Parameters:
itemBuf - the source buffer
Throws:
LogException

dumpLog

void dumpLog(java.lang.StringBuffer sb,
             boolean verbose)
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.

Parameters:
sb - destination string buffer
verbose - if true, dump the full, verbose version

getTransactionId

long getTransactionId()
Returns:
the transaction id embedded within this loggable object. Objects that have no transaction id should return 0.


Copyright 2004,2008 Oracle. All rights reserved.