com.sleepycat.je.log.entry
Class SingleItemEntry

java.lang.Object
  extended by com.sleepycat.je.log.entry.BaseEntry
      extended by com.sleepycat.je.log.entry.SingleItemEntry
All Implemented Interfaces:
LogEntry, Cloneable
Direct Known Subclasses:
BINDeltaLogEntry, FileHeaderEntry

public class SingleItemEntry
extends BaseEntry
implements LogEntry

This class embodies log entries that have a single loggable item. On disk, an entry contains:

     the Loggable item
 


Field Summary
 
Fields inherited from class com.sleepycat.je.log.entry.BaseEntry
entryType
 
Constructor Summary
SingleItemEntry(Class<?> logClass)
          Construct a log entry for reading.
SingleItemEntry(LogEntryType entryType, Loggable item)
          Construct a log entry for writing.
 
Method Summary
 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()
           
 Object getMainItem()
           
 int getSize()
           
 long getTransactionId()
           
 boolean logicalEquals(LogEntry other)
           
 void readEntry(EnvironmentImpl envImpl, LogEntryHeader header, ByteBuffer entryBuffer)
          Read in a log entry.
 void writeEntry(LogEntryHeader header, ByteBuffer destBuffer)
          Serialize this object into the buffer.
 
Methods inherited from class com.sleepycat.je.log.entry.BaseEntry
clone, getLastLoggedSize, getLogType, getNoArgsConstructor, getResolvedItem, isDeleted, newInstanceOfType, newInstanceOfType, postFetchInit, postLogWork, setLogType, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.sleepycat.je.log.entry.LogEntry
clone, getLastLoggedSize, getLogType, getResolvedItem, isDeleted, postLogWork, setLogType
 

Constructor Detail

SingleItemEntry

public SingleItemEntry(Class<?> logClass)
Construct a log entry for reading.


SingleItemEntry

public SingleItemEntry(LogEntryType entryType,
                       Loggable item)
Construct a log entry for writing.

Method Detail

readEntry

public void readEntry(EnvironmentImpl envImpl,
                      LogEntryHeader header,
                      ByteBuffer entryBuffer)
Description copied from interface: LogEntry
Read in a log entry.

Specified by:
readEntry in interface LogEntry
See Also:
LogEntry.readEntry(com.sleepycat.je.dbi.EnvironmentImpl, com.sleepycat.je.log.LogEntryHeader, java.nio.ByteBuffer)

dumpEntry

public StringBuilder dumpEntry(StringBuilder sb,
                               boolean verbose)
Description copied from interface: LogEntry
Print out the contents of an entry.

Specified by:
dumpEntry in interface LogEntry
Specified by:
dumpEntry in class BaseEntry
See Also:
LogEntry.dumpEntry(java.lang.StringBuilder, boolean)

dumpRep

public void dumpRep(StringBuilder sb)
Description copied from interface: LogEntry
Dump the contents of the log entry that are interesting for replication.

Specified by:
dumpRep in interface LogEntry
See Also:
LogEntry.dumpRep(java.lang.StringBuilder)

getMainItem

public Object getMainItem()
Specified by:
getMainItem in interface LogEntry
Returns:
the first item of the log entry
See Also:
LogEntry.getMainItem()

getTransactionId

public long getTransactionId()
Specified by:
getTransactionId in interface LogEntry
Returns:
return the transaction id if this log entry is transactional, 0 otherwise.
See Also:
LogEntry.getTransactionId()

getDbId

public DatabaseId getDbId()
Specified by:
getDbId in interface LogEntry
Returns:
the ID of the database containing this entry, or null if this entry type is not part of a database.

getSize

public int getSize()
Specified by:
getSize in interface LogEntry
Returns:
size of byte buffer needed to store this entry.

writeEntry

public void writeEntry(LogEntryHeader header,
                       ByteBuffer destBuffer)
Description copied from interface: LogEntry
Serialize this object into the buffer.

Specified by:
writeEntry in interface LogEntry
destBuffer - is the destination buffer
See Also:
LogEntry.writeEntry(com.sleepycat.je.log.LogEntryHeader, java.nio.ByteBuffer)

logicalEquals

public boolean logicalEquals(LogEntry other)
Specified by:
logicalEquals in interface LogEntry
Returns:
true if these two log entries are logically the same. Used for replication.
See Also:
LogEntry.logicalEquals(com.sleepycat.je.log.entry.LogEntry)


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