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.

Log entries are versioned. When changing the persistent form of a log entry in any way that is incompatible with prior releases, make sure the LogEntry instance is capable of reading in older versions from the log and be sure to increment LOG_VERSION. The LogEntry.readEntry and Loggable.readFromLog methods should check the actual version of the entry. If it is less than LOG_VERSION, the old version should be converted to the current version.

Prior to LOG_VERSION 6, each log entry type had a separate version number that was incremented only when that log version changed. From LOG_VERSION 6 onward, all types use the same version, the LOG_VERSION constant. For versions prior to 6, the readEntry and readFromLog methods will be checking the old per-type version. There is no overlap between the old per-type versions and the LOG_VERSION values, because the per-type values are all below 6. [#15365]

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
           
static byte LOG_VERSION
          Version of the file header, which identifies the version of all entries in that file.
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 boolean equalsType(byte typeNum)
          Check for equality without making a new object.
static LogEntryType findType(byte typeNum)
           
static java.util.Set<LogEntryType> getAllTypes()
          Get a copy of all types for unit testing.
 LogEntry getNewLogEntry()
           
 LogEntry getSharedLogEntry()
           
 byte getTypeNum()
           
 int hashCode()
          This is used as a hash key.
 boolean isNodeType()
           
static boolean isNodeType(byte typeNum)
           
 boolean isReplicationPossible()
          Return true if this type of log entry can be part of the replication stream.
 boolean isSyncPoint()
          Return true if this type of log entry can serve as the synchronization matchpoint for the replication stream.
static boolean isSyncPoint(byte entryType)
          Return true if this type of log entry can serve as the synchronization matchpoint for the replication stream.
 boolean isTransactional()
          Return true if this log entry has transactional information in it, like a commit or abort record, or a transactional LN.
 boolean marshallOutsideLatch()
          Return true if this log entry should be marshalled into a buffer outside the log write latch.
 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_VERSION

public static final byte LOG_VERSION
Version of the file header, which identifies the version of all entries in that file. Changes to log entries for each version are: Version 3 --------- [12328] Add main and dupe tree fanout values for DatabaseImpl. [12557] Add IN LSN array compression. [11597] Add a change to FileSummaryLNs: obsolete offset tracking was added and multiple records are stored for a single file rather than a single record. Each record contains the offsets that were tracked since the last record was written. [11597] Add the full obsolete LSN in LNLogEntry. Version 4 --------- [#14422] Bump MapLN version from 1 to 2. Instead of a String for the comparator class name, store either a serialized string or Comparator. Version 5 --------- [#15195] FileSummaryLN version 3. Add FileSummary.obsoleteLNSize and obsoleteLNSizeCounted fields. Version 6 (in JE 3.3.X) --------- [#15365] From this point onward, all log entries have the same version, LOG_VERSION, rather than using per-type versions. [#15365] DatabaseImpl stores a map of DbFileSummaries. [#13467] Convert duplicatesAllowed boolean to DUPS_ALLOWED_BIT flag in DatabaseImpl. Add REPLICATED_BIT flag to DatabaseImpl. [#13467] Add REPLICATED_BIT to DbTree. [#13467] Add ReplicatedDatabaseConfig to NameLN_TX to support replication of database operations. [#15581] Add lastAllocateReplicatedDbId to DbTree [#16083] Add replication master node id to txn commit/abort

See Also:
Constant Field Values

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
Method Detail

isNodeType

public static boolean isNodeType(byte typeNum)

isNodeType

public boolean isNodeType()

findType

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

getAllTypes

public static java.util.Set<LogEntryType> 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

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

getTypeNum

public byte getTypeNum()

toStringNoVersion

public java.lang.String toStringNoVersion()

toString

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

equalsType

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


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 and MapLN (which contains DbFileSummary objects) need to be logged inside the log write latch.


isReplicationPossible

public boolean isReplicationPossible()
Return true if this type of log entry can be part of the replication stream. For example, INs can never be replicated, while LNs are replicated only if their owning database is replicated.


isSyncPoint

public boolean isSyncPoint()
Return true if this type of log entry can serve as the synchronization matchpoint for the replication stream. That generally means that this log entry contains an replication node id.


isSyncPoint

public static boolean isSyncPoint(byte entryType)
Return true if this type of log entry can serve as the synchronization matchpoint for the replication stream.