com.sleepycat.je.log.entry
Interface LogEntry

All Superinterfaces:
java.lang.Cloneable
All Known Subinterfaces:
NodeLogEntry
All Known Implementing Classes:
BINDeltaLogEntry, DeletedDupLNLogEntry, INLogEntry, LNLogEntry, NameLNLogEntry, SingleItemEntry

public interface LogEntry
extends java.lang.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
 java.lang.Object clone()
           
 boolean countAsObsoleteWhenLogged()
          Returns true if this item should be counted as obsoleted when logged.
 java.lang.StringBuffer dumpEntry(java.lang.StringBuffer sb, boolean verbose)
          Print out the contents of an entry.
 int getLastLoggedSize()
           
 LogEntryType getLogType()
           
 java.lang.Object getMainItem()
           
 int getSize()
           
 long getTransactionId()
           
 boolean logicalEquals(LogEntry other)
           
 void postLogWork(long justLoggedLsn)
          Do any processing we need to do after logging, while under the logging latch.
 void readEntry(LogEntryHeader header, java.nio.ByteBuffer entryBuffer, boolean readFullItem)
          Read in a log entry.
 void setLogType(LogEntryType entryType)
          Inform a LogEntry instance of its corresponding LogEntryType.
 void writeEntry(LogEntryHeader header, java.nio.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(LogEntryHeader header,
               java.nio.ByteBuffer entryBuffer,
               boolean readFullItem)
               throws DatabaseException
Read in a log entry.

Throws:
DatabaseException

dumpEntry

java.lang.StringBuffer dumpEntry(java.lang.StringBuffer sb,
                                 boolean verbose)
Print out the contents of an entry.


getMainItem

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

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,
                java.nio.ByteBuffer logBuffer)
Serialize this object into the buffer.

Parameters:
logBuffer - is the destination buffer

countAsObsoleteWhenLogged

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


postLogWork

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

Throws:
DatabaseException

clone

java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Returns:
a shallow clone.
Throws:
java.lang.CloneNotSupportedException

logicalEquals

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