com.sleepycat.je.tree
Class DeltaInfo

java.lang.Object
  extended by com.sleepycat.je.tree.DeltaInfo
All Implemented Interfaces:
Loggable

public class DeltaInfo
extends Object
implements Loggable

DeltaInfo holds the delta for one BIN entry in a partial BIN log entry. The data here is all that we need to update a BIN to its proper state.


Constructor Summary
DeltaInfo()
          For reading from the log only.
DeltaInfo(byte[] key, long lsn, byte state)
           
 
Method Summary
 void dumpLog(StringBuilder sb, boolean verbose)
          Write the object into the string buffer for log dumping.
(package private)  byte[] getKey()
           
 int getLogSize()
           
(package private)  long getLsn()
           
(package private)  long getMemorySize()
          Returns the number of bytes occupied by this object.
(package private)  byte getState()
           
 long getTransactionId()
           
(package private)  boolean isKnownDeleted()
           
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DeltaInfo

DeltaInfo(byte[] key,
          long lsn,
          byte state)

DeltaInfo

public DeltaInfo()
For reading from the log only. Is public for Sizeof.

Method Detail

getLogSize

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

writeToLog

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

Specified by:
writeToLog in interface Loggable
Parameters:
logBuffer - is the destination buffer

readFromLog

public void readFromLog(ByteBuffer itemBuffer,
                        int entryVersion)
Description copied from interface: Loggable
Initialize this object from the data in itemBuf.

Specified by:
readFromLog in interface Loggable

dumpLog

public void dumpLog(StringBuilder sb,
                    boolean verbose)
Description copied from interface: Loggable
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 Loggable
Parameters:
sb - destination string buffer
verbose - if true, dump the full, verbose version

getTransactionId

public long getTransactionId()
Specified by:
getTransactionId in interface Loggable
Returns:
the transaction id embedded within this loggable object. Objects that have no transaction id should return 0.
See Also:
Loggable.getTransactionId()

logicalEquals

public boolean logicalEquals(Loggable other)
Specified by:
logicalEquals in interface Loggable
Returns:
true if these two loggable items are logically the same. Used for replication testing.
See Also:
Always return false, this item should never be compared.

getKey

byte[] getKey()
Returns:
the Key.

getState

byte getState()
Returns:
the state flags.

isKnownDeleted

boolean isKnownDeleted()
Returns:
true if this is known to be deleted.

getLsn

long getLsn()
Returns:
the LSN.

getMemorySize

long getMemorySize()
Returns the number of bytes occupied by this object. Deltas are not stored in the Btree, but they are budgeted during a SortedLSNTreeWalker run.



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