com.sleepycat.je.log.entry
Class BaseEntry

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

public abstract class BaseEntry
extends Object
implements LogEntry

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 and c).


Field Summary
(package private)  LogEntryType entryType
           
 
Constructor Summary
BaseEntry()
          Constructor to write an entry.
BaseEntry(Class<?> logClass)
          Constructor to read an entry.
 
Method Summary
 LogEntry clone()
           
abstract  StringBuilder dumpEntry(StringBuilder sb, boolean verbose)
          Print out the contents of an entry.
 int getLastLoggedSize()
          By default, return zero because the last logged size is unknown.
 LogEntryType getLogType()
           
(package private) static Constructor<?> getNoArgsConstructor(Class<?> logClass)
           
 Object getResolvedItem(DatabaseImpl dbImpl)
          By default, this log entry is complete and does not require fetching additional entries.
 boolean isDeleted()
          Returns true if this item should be counted as obsoleted when logged.
(package private)  Object newInstanceOfType()
           
(package private) static Object newInstanceOfType(Constructor<?> noArgsConstructor)
           
 void postFetchInit(DatabaseImpl dbImpl)
           
 void postLogWork(LogEntryHeader header, long justLoggedLsn)
          Do any processing we need to do after logging, while under the logging latch.
 void setLogType(LogEntryType entryType)
          Inform a BaseEntry instance of its corresponding LogEntryType.
 String 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
dumpRep, getDbId, getMainItem, getSize, getTransactionId, logicalEquals, readEntry, writeEntry
 

Field Detail

entryType

LogEntryType entryType
Constructor Detail

BaseEntry

BaseEntry(Class<?> logClass)
Constructor to read an entry. The logEntryType must be set later, through setLogType().


BaseEntry

BaseEntry()
Constructor to write an entry.

Method Detail

getNoArgsConstructor

static Constructor<?> getNoArgsConstructor(Class<?> logClass)

newInstanceOfType

Object newInstanceOfType()
Returns:
a new instance of the class used to create the log entry.

newInstanceOfType

static Object newInstanceOfType(Constructor<?> noArgsConstructor)

setLogType

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

Specified by:
setLogType in interface LogEntry

getLogType

public LogEntryType getLogType()
Specified by:
getLogType in interface LogEntry
Returns:
the type of log entry

getResolvedItem

public Object getResolvedItem(DatabaseImpl dbImpl)
By default, this log entry is complete and does not require fetching additional entries. This method is overridden by BINDeltaLogEntry.

Specified by:
getResolvedItem in interface LogEntry

getLastLoggedSize

public int getLastLoggedSize()
By default, return zero because the last logged size is unknown. This method is overridden by LNLogEntry.

Specified by:
getLastLoggedSize in interface LogEntry
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.

isDeleted

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

Specified by:
isDeleted in interface LogEntry

postLogWork

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

Specified by:
postLogWork in interface LogEntry
Throws:
DatabaseException - from subclasses.

postFetchInit

public void postFetchInit(DatabaseImpl dbImpl)

dumpEntry

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

Specified by:
dumpEntry in interface LogEntry

clone

public LogEntry clone()
Specified by:
clone in interface LogEntry
Overrides:
clone in class Object
Returns:
a shallow clone.

toString

public String toString()
Overrides:
toString in class Object


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