com.sleepycat.je.utilint
Class DbLsn

java.lang.Object
  extended by com.sleepycat.je.utilint.DbLsn

public class DbLsn
extends Object

DbLsn is a class that operates on Log Sequence Numbers (LSNs). An LSN is a long comprised of a file number (32b) and offset within that file (32b) which references a unique record in the database environment log. While LSNs are represented as long's, we operate on them using an abstraction and return longs from these methods so that we don't have to worry about the lack of unsigned quantities.


Field Summary
(package private) static long INT_MASK
           
static long MAX_FILE_OFFSET
           
static long NULL_LSN
           
 
Method Summary
static int compareTo(long lsn1, long lsn2)
           
static String dumpString(long lsn, int nSpaces)
           
static long getFileNumber(long lsn)
          Return the file number for this DbLsn.
static long getFileOffset(long lsn)
          Return the file offset for this DbLsn.
static long getNoCleaningDistance(long thisLsn, long otherLsn, long logFileSize)
          Return the logsize in bytes between these two LSNs.
static String getNoFormatString(long lsn)
           
 long getTransactionIdX()
           
static long getWithCleaningDistance(long thisLsn, FileManager fileManager, long otherLsn, long logFileSize)
          Return the logsize in bytes between these two LSNs.
 boolean logEntryIsTransactionalX()
           
static long longToLsn(Long lsn)
           
static long makeLsn(long fileNumber, long fileOffset)
           
static String toString(long lsn)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INT_MASK

static final long INT_MASK
See Also:
Constant Field Values

MAX_FILE_OFFSET

public static final long MAX_FILE_OFFSET
See Also:
Constant Field Values

NULL_LSN

public static final long NULL_LSN
See Also:
Constant Field Values
Method Detail

makeLsn

public static long makeLsn(long fileNumber,
                           long fileOffset)

longToLsn

public static long longToLsn(Long lsn)

getFileNumber

public static long getFileNumber(long lsn)
Return the file number for this DbLsn.

Returns:
the number for this DbLsn.

getFileOffset

public static long getFileOffset(long lsn)
Return the file offset for this DbLsn.

Returns:
the offset for this DbLsn.

compareTo

public static int compareTo(long lsn1,
                            long lsn2)

toString

public static String toString(long lsn)

getNoFormatString

public static String getNoFormatString(long lsn)

dumpString

public static String dumpString(long lsn,
                                int nSpaces)

getNoCleaningDistance

public static long getNoCleaningDistance(long thisLsn,
                                         long otherLsn,
                                         long logFileSize)
Return the logsize in bytes between these two LSNs. This is an approximation; the logs might actually be a little more or less in size. This assumes that no log files have been cleaned.


getWithCleaningDistance

public static long getWithCleaningDistance(long thisLsn,
                                           FileManager fileManager,
                                           long otherLsn,
                                           long logFileSize)
Return the logsize in bytes between these two LSNs. This is an approximation; the logs might actually be a little more or less in size. This assumes that log files might have been cleaned.


logEntryIsTransactionalX

public boolean logEntryIsTransactionalX()
See Also:
LogReadable#logEntryIsTransactional.

getTransactionIdX

public long getTransactionIdX()
See Also:
LogReadable.getTransactionId()


Copyright 2004-2005 Sleepycat, Inc. All Rights Reserved.