com.sleepycat.je.log
Interface Loggable

All Known Implementing Classes:
BIN, BINDelta, CheckpointEnd, CheckpointStart, ChildReference, CleanerLogSummary, DatabaseId, DatabaseImpl, DbFileSummary, DBIN, DbOperationType, DbTree, DeltaInfo, DIN, DupCountLN, FileHeader, FileSummary, FileSummaryLN, IN, INDeleteInfo, INDupDeleteInfo, LN, MapLN, MasterTxn, Matchpoint, NameLN, Node, PackedOffsets, PreparedTxn, ReadonlyTxn, ReplayTxn, ReplicatedDatabaseConfig, RollbackEnd, RollbackStart, Trace, TrackedFileSummary, Tree, Txn, TxnAbort, TxnCommit, TxnEnd, TxnPrepare, VersionedLN, 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(StringBuilder sb, boolean verbose)
          Write the object into the string buffer for log dumping.
 int getLogSize()
           
 long getTransactionId()
           
 boolean logicalEquals(Loggable other)
           
 void readFromLog(ByteBuffer itemBuffer, int entryVersion)
          Initialize this object from the data in itemBuf.
 void writeToLog(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(ByteBuffer logBuffer)
Serialize this object into the buffer.

Parameters:
logBuffer - is the destination buffer

readFromLog

void readFromLog(ByteBuffer itemBuffer,
                 int entryVersion)
Initialize this object from the data in itemBuf.

Parameters:
itemBuf - the source buffer

dumpLog

void dumpLog(StringBuilder 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.

logicalEquals

boolean logicalEquals(Loggable other)
Returns:
true if these two loggable items are logically the same. Used for replication testing.


Copyright (c) 2004-2012 Oracle. All rights reserved.