Package com.sleepycat.db
Class LogSequenceNumber
java.lang.Object
com.sleepycat.db.LogSequenceNumber
The LogSequenceNumber object is a log sequence number which
specifies a unique location in a log file. A LogSequenceNumber consists
of two unsigned 32-bit integers -- one specifies the log file number,
and the other specifies the offset in the log file.
-
Constructor Summary
ConstructorsConstructorDescriptionConstruct an uninitialized LogSequenceNumber.LogSequenceNumber(int file, int offset) Construct a LogSequenceNumber with the specified file and offset. -
Method Summary
Modifier and TypeMethodDescriptionstatic intcompare(LogSequenceNumber lsn1, LogSequenceNumber lsn2) Compare two LogSequenceNumber objects.intgetFile()Return the file number component of the LogSequenceNumber.intReturn the file offset component of the LogSequenceNumber.
-
Constructor Details
-
LogSequenceNumber
public LogSequenceNumber(int file, int offset) Construct a LogSequenceNumber with the specified file and offset.- Parameters:
file- The log file number.offset- The log file offset.
-
LogSequenceNumber
public LogSequenceNumber()Construct an uninitialized LogSequenceNumber.
-
-
Method Details
-
getFile
public int getFile()Return the file number component of the LogSequenceNumber.- Returns:
- The file number component of the LogSequenceNumber.
-
getOffset
public int getOffset()Return the file offset component of the LogSequenceNumber.- Returns:
- The file offset component of the LogSequenceNumber.
-
compare
Compare two LogSequenceNumber objects.This method returns 0 if the two LogSequenceNumber objects are equal, 1 if lsn0 is greater than lsn1, and -1 if lsn0 is less than lsn1.
- Parameters:
lsn1- The first LogSequenceNumber object to be compared.lsn2- The second LogSequenceNumber object to be compared.- Returns:
- 0 if the two LogSequenceNumber objects are equal, 1 if lsn1 is greater than lsn2, and -1 if lsn1 is less than lsn2.
-