com.sleepycat.je.log
Class LogEntryType

java.lang.Object
  extended by com.sleepycat.je.log.LogEntryType

public class LogEntryType
extends java.lang.Object

LogEntryType is an enumeration of all log entry types.

When adding a new version of a log entry type, make sure the corresponding LogEntry instance is capable of reading in older versions from the log. The LogEntry instance must be sure that older versions are converted in memory into a correct instance of the newest version, so when that LogEntry object is written again as the result of migration, eviction, the resulting new log entry conforms to the requirements of the new version. If context objects are required for data conversion, the conversion can be done in the Node.postFetchInit method.


Field Summary
static LogEntryType[] IN_TYPES
           
static LogEntryType LOG_BIN
           
static LogEntryType LOG_BIN_DELTA
           
static LogEntryType LOG_CKPT_END
           
static LogEntryType LOG_CKPT_START
           
static LogEntryType LOG_DBIN
           
static LogEntryType LOG_DEL_DUPLN
           
static LogEntryType LOG_DEL_DUPLN_TRANSACTIONAL
           
static LogEntryType LOG_DIN
           
static LogEntryType LOG_DUP_BIN_DELTA
           
static LogEntryType LOG_DUPCOUNTLN
           
static LogEntryType LOG_DUPCOUNTLN_TRANSACTIONAL
           
static LogEntryType LOG_FILE_HEADER
           
static LogEntryType LOG_FILESUMMARYLN
           
static LogEntryType LOG_IN
           
static LogEntryType LOG_IN_DELETE_INFO
           
static LogEntryType LOG_IN_DUPDELETE_INFO
           
static LogEntryType LOG_LN
           
static LogEntryType LOG_LN_TRANSACTIONAL
           
static LogEntryType LOG_MAPLN
           
static LogEntryType LOG_MAPLN_TRANSACTIONAL
           
static LogEntryType LOG_NAMELN
           
static LogEntryType LOG_NAMELN_TRANSACTIONAL
           
static LogEntryType LOG_ROOT
           
static LogEntryType LOG_TRACE
           
static LogEntryType LOG_TXN_ABORT
           
static LogEntryType LOG_TXN_COMMIT
           
static LogEntryType LOG_TXN_PREPARE
           
 
Constructor Summary
LogEntryType(byte typeNum, byte version)
          For base class support.
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 boolean equalsType(byte typeNum)
           
(package private)  boolean equalsType(byte typeNum, byte version)
          Check for equality without making a new object.
static LogEntryType findType(byte typeNum, byte version)
           
static java.util.Set getAllTypes()
          Get a copy of all types for unit testing.
(package private)  LogEntry getNewLogEntry()
           
 LogEntry getSharedLogEntry()
           
(package private)  byte getTypeNum()
           
(package private)  byte getVersion()
           
static byte getVersionValue(byte version)
          Return the version value, clearing away provisional and replicated bits.
 int hashCode()
          This is used as a hash key.
(package private) static boolean isEntryProvisional(byte version)
           
static boolean isEntryReplicated(byte version)
           
 boolean isNodeType()
           
static boolean isNodeType(byte typeNum, byte version)
           
 boolean isTransactional()
          Return true if this log entry has transactional information in it, like a commit or abort record, or a transactional LN.
 boolean isTypeReplicated()
          Return true if this log entry should be transmitted to other sites if the environment is part of a replication group.
(package private) static boolean isValidType(byte typeNum)
           
 boolean marshallOutsideLatch()
          Return true if this log entry should be marshalled into a buffer outside the log write latch.
(package private) static byte setEntryProvisional(byte version)
          Set the provisional bit.
(package private) static byte setEntryReplicated(byte version)
          Set the replicated bit
 java.lang.String toString()
           
 java.lang.String toStringNoVersion()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

LOG_LN_TRANSACTIONAL

public static final LogEntryType LOG_LN_TRANSACTIONAL

LOG_LN

public static final LogEntryType LOG_LN

LOG_MAPLN_TRANSACTIONAL

public static final LogEntryType LOG_MAPLN_TRANSACTIONAL

LOG_MAPLN

public static final LogEntryType LOG_MAPLN

LOG_NAMELN_TRANSACTIONAL

public static final LogEntryType LOG_NAMELN_TRANSACTIONAL

LOG_NAMELN

public static final LogEntryType LOG_NAMELN

LOG_DEL_DUPLN_TRANSACTIONAL

public static final LogEntryType LOG_DEL_DUPLN_TRANSACTIONAL

LOG_DEL_DUPLN

public static final LogEntryType LOG_DEL_DUPLN

LOG_DUPCOUNTLN_TRANSACTIONAL

public static final LogEntryType LOG_DUPCOUNTLN_TRANSACTIONAL

LOG_DUPCOUNTLN

public static final LogEntryType LOG_DUPCOUNTLN

LOG_FILESUMMARYLN

public static final LogEntryType LOG_FILESUMMARYLN

LOG_IN

public static final LogEntryType LOG_IN

LOG_BIN

public static final LogEntryType LOG_BIN

LOG_DIN

public static final LogEntryType LOG_DIN

LOG_DBIN

public static final LogEntryType LOG_DBIN

IN_TYPES

public static final LogEntryType[] IN_TYPES

LOG_ROOT

public static final LogEntryType LOG_ROOT

LOG_TXN_COMMIT

public static final LogEntryType LOG_TXN_COMMIT

LOG_TXN_ABORT

public static final LogEntryType LOG_TXN_ABORT

LOG_CKPT_START

public static final LogEntryType LOG_CKPT_START

LOG_CKPT_END

public static final LogEntryType LOG_CKPT_END

LOG_IN_DELETE_INFO

public static final LogEntryType LOG_IN_DELETE_INFO

LOG_BIN_DELTA

public static final LogEntryType LOG_BIN_DELTA

LOG_DUP_BIN_DELTA

public static final LogEntryType LOG_DUP_BIN_DELTA

LOG_TRACE

public static final LogEntryType LOG_TRACE

LOG_FILE_HEADER

public static final LogEntryType LOG_FILE_HEADER

LOG_IN_DUPDELETE_INFO

public static final LogEntryType LOG_IN_DUPDELETE_INFO

LOG_TXN_PREPARE

public static final LogEntryType LOG_TXN_PREPARE
Constructor Detail

LogEntryType

LogEntryType(byte typeNum,
             byte version)
For base class support.

Method Detail

isNodeType

public static boolean isNodeType(byte typeNum,
                                 byte version)

isNodeType

public boolean isNodeType()

findType

public static LogEntryType findType(byte typeNum,
                                    byte version)
Returns:
the static version of this type

getAllTypes

public static java.util.Set getAllTypes()
Get a copy of all types for unit testing.


getSharedLogEntry

public LogEntry getSharedLogEntry()
Returns:
the log entry type owned by the shared, static version

getNewLogEntry

LogEntry getNewLogEntry()
                  throws DatabaseException
Returns:
a clone of the log entry type for a given log type.
Throws:
DatabaseException

getVersionValue

public static byte getVersionValue(byte version)
Return the version value, clearing away provisional and replicated bits.


setEntryProvisional

static byte setEntryProvisional(byte version)
Set the provisional bit.


isEntryProvisional

static boolean isEntryProvisional(byte version)
Returns:
true if the provisional bit is set.

setEntryReplicated

static byte setEntryReplicated(byte version)
Set the replicated bit


isEntryReplicated

public static boolean isEntryReplicated(byte version)
Returns:
true if the replicated bit is set.

getTypeNum

byte getTypeNum()

getVersion

byte getVersion()

isValidType

static boolean isValidType(byte typeNum)
Returns:
true if type number is valid.

toString

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

toStringNoVersion

public java.lang.String toStringNoVersion()

equalsType

boolean equalsType(byte typeNum,
                   byte version)
Check for equality without making a new object.


equalsType

public boolean equalsType(byte typeNum)

equals

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

hashCode

public int hashCode()
This is used as a hash key.

Overrides:
hashCode in class java.lang.Object

isTransactional

public boolean isTransactional()
Return true if this log entry has transactional information in it, like a commit or abort record, or a transactional LN.


marshallOutsideLatch

public boolean marshallOutsideLatch()
Return true if this log entry should be marshalled into a buffer outside the log write latch. Currently, only the FileSummaryLN needs to be logged inside the log write latch.


isTypeReplicated

public boolean isTypeReplicated()
Return true if this log entry should be transmitted to other sites if the environment is part of a replication group.



Copyright 2004,2008 Oracle. All rights reserved.