com.sleepycat.je.log.entry
Interface LogEntry

All Superinterfaces:
java.lang.Cloneable
All Known Subinterfaces:
NodeLogEntry
All Known Implementing Classes:
BINDeltaLogEntry, DeletedDupLNLogEntry, INLogEntry, LNLogEntry, 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. a log header defined by LogManager b. a VLSN, if this entry type requires it, and replication is on. c. the specific contents of the log entry. This class encompasses (b & c).


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.
 LogEntryType getLogType()
           
 java.lang.Object getMainItem()
           
 int getSize()
           
 long getTransactionId()
           
 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 an log entry.
 void setLastLoggedSize(int size)
          Sets the total size of the last logged entry, including the header.
 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 an 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.

setLastLoggedSize

void setLastLoggedSize(int size)
Sets the total size of the last logged entry, including the header. Must be called after calling readEntry and writeEntry. Some entries (LNs) save the last logged size.


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


Copyright 2004,2008 Oracle. All rights reserved.