com.sleepycat.je.utilint
Class VLSN

java.lang.Object
  extended by com.sleepycat.je.utilint.VLSN
All Implemented Interfaces:
Loggable, java.lang.Comparable<VLSN>

public class VLSN
extends java.lang.Object
implements Loggable, java.lang.Comparable<VLSN>


Field Summary
static VLSN FIRST_VLSN
           
static int LOG_SIZE
           
static VLSN NULL_VLSN
           
 
Constructor Summary
VLSN()
          Constructor for VLSNs that are read from disk.
VLSN(long sequence)
           
 
Method Summary
 int compareTo(VLSN other)
          Compares this VLSN's sequence with the specified VLSN's sequence for order.
 void dumpLog(java.lang.StringBuffer sb, boolean verbose)
          Write the object into the string buffer for log dumping.
 boolean equals(java.lang.Object obj)
           
 boolean follows(VLSN other)
          Return true if this VLSN's sequence directly follows the "other" VLSN.
 int getLogSize()
           
 VLSN getNext()
          Return a VLSN which would follow this one.
 VLSN getPrev()
          Return a VLSN which would precede this one.
 long getSequence()
           
 long getTransactionId()
           
 int hashCode()
           
 boolean logicalEquals(Loggable other)
           
 void readFromLog(java.nio.ByteBuffer buffer, byte entryVersion)
          Initialize this object from the data in itemBuf.
 java.lang.String toString()
           
 void writeToLog(java.nio.ByteBuffer buffer)
          Serialize this object into the buffer.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

LOG_SIZE

public static final int LOG_SIZE
See Also:
Constant Field Values

NULL_VLSN

public static final VLSN NULL_VLSN

FIRST_VLSN

public static final VLSN FIRST_VLSN
Constructor Detail

VLSN

public VLSN(long sequence)

VLSN

public VLSN()
Constructor for VLSNs that are read from disk.

Method Detail

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

getSequence

public long getSequence()

getNext

public VLSN getNext()
Return a VLSN which would follow this one.


getPrev

public VLSN getPrev()
Return a VLSN which would precede this one.


follows

public boolean follows(VLSN other)
Return true if this VLSN's sequence directly follows the "other" VLSN. This handles the case where "other" is a NULL_VLSN.


compareTo

public int compareTo(VLSN other)
Compares this VLSN's sequence with the specified VLSN's sequence for order. Returns a negative integer, zero, or a positive integer as this sequence is less than, equal to, or greater than the specified sequence.

Specified by:
compareTo in interface java.lang.Comparable<VLSN>

getLogSize

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

writeToLog

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

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

readFromLog

public void readFromLog(java.nio.ByteBuffer buffer,
                        byte entryVersion)
                 throws LogException
Description copied from interface: Loggable
Initialize this object from the data in itemBuf.

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

dumpLog

public void dumpLog(java.lang.StringBuffer 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
See Also:
Loggable.dumpLog(java.lang.StringBuffer, boolean)

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:
Loggable.logicalEquals(com.sleepycat.je.log.Loggable)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object