com.sleepycat.je.log.entry
Interface LogEntry

All Superinterfaces:
Cloneable
All Known Implementing Classes:
BaseEntry, BINDeltaLogEntry, DeletedDupLNLogEntry, FileHeaderEntry, INLogEntry, LNLogEntry, NameLNLogEntry, SingleItemEntry

public interface LogEntry
extends Cloneable

A Log entry allows you to read, write and dump a database log entry. Each entry may be made up of one or more loggable items. The log entry on disk consists of a log header defined by LogManager and the specific contents of the log entry.


Method Summary
 LogEntry clone()
           
 StringBuilder dumpEntry(StringBuilder sb, boolean verbose)
          Print out the contents of an entry.
 void dumpRep(StringBuilder sb)
          Dump the contents of the log entry that are interesting for replication.
 DatabaseId getDbId()
           
 int getLastLoggedSize()
           
 LogEntryType getLogType()
           
 Object getMainItem()
           
 Object getResolvedItem(DatabaseImpl dbImpl)
          Construct a complete item from a item entry, fetching additional log entries as needed.
 int getSize()
           
 long getTransactionId()
           
 boolean isDeleted()
          Returns true if this item should be counted as obsolete when logged.
 boolean logicalEquals(LogEntry other)
           
 void postLogWork(LogEntryHeader header, long justLoggedLsn)
          Do any processing we need to do after logging, while under the logging latch.
 void readEntry(EnvironmentImpl envImpl, LogEntryHeader header, ByteBuffer entryBuffer)
          Read in a log entry.
 void setLogType(LogEntryType entryType)
          Inform a LogEntry instance of its corresponding LogEntryType.
 void writeEntry(LogEntryHeader header, ByteBuffer logBuffer)
          Serialize this object into the buffer.
 

Method Detail

setLogType

void setLogType(LogEntryType entryType)
Inform a LogEntry instance of its corresponding LogEntryType.


getLogType

LogEntryType getLogType()
Returns:
the type of log entry

readEntry

void readEntry(EnvironmentImpl envImpl,
               LogEntryHeader header,
               ByteBuffer entryBuffer)
Read in a log entry.


dumpEntry

StringBuilder dumpEntry(StringBuilder sb,
                        boolean verbose)
Print out the contents of an entry.


getMainItem

Object getMainItem()
Returns:
the first item of the log entry

getResolvedItem

Object getResolvedItem(DatabaseImpl dbImpl)
Construct a complete item from a item entry, fetching additional log entries as needed. For a BINDeltaLogEntry, fetches the full BIN and merges the delta information.


getDbId

DatabaseId getDbId()
Returns:
the ID of the database containing this entry, or null if this entry type is not part of a database.

getTransactionId

long getTransactionId()
Returns:
return the transaction id if this log entry is transactional, 0 otherwise.

getSize

int getSize()
Returns:
size of byte buffer needed to store this entry.

getLastLoggedSize

int getLastLoggedSize()
Returns:
total size of last logged entry, or zero if unknown. The last logged size is known for LNs, and is used for obsolete size counting.

writeEntry

void writeEntry(LogEntryHeader header,
                ByteBuffer logBuffer)
Serialize this object into the buffer.

Parameters:
logBuffer - is the destination buffer

isDeleted

boolean isDeleted()
Returns true if this item should be counted as obsolete when logged. This currently applies to deleted LNs only.


postLogWork

void postLogWork(LogEntryHeader header,
                 long justLoggedLsn)
Do any processing we need to do after logging, while under the logging latch.


clone

LogEntry clone()
Returns:
a shallow clone.

logicalEquals

boolean logicalEquals(LogEntry other)
Returns:
true if these two log entries are logically the same. Used for replication.

dumpRep

void dumpRep(StringBuilder sb)
Dump the contents of the log entry that are interesting for replication.



Copyright (c) 2004-2012 Oracle. All rights reserved.