|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sleepycat.je.log.LogEntryHeader
public class LogEntryHeader
A LogEntryHeader embodies the header information at the beginning of each log entry file.
Field Summary | |
---|---|
static int |
CHECKSUM_BYTES
|
(package private) static int |
ENTRYTYPE_OFFSET
|
(package private) static int |
FLAGS_OFFSET
|
static int |
MAX_HEADER_SIZE
|
static int |
MIN_HEADER_SIZE
Persistent fields. |
static int |
VLSN_OFFSET
|
Constructor Summary | |
---|---|
LogEntryHeader(ByteBuffer entryBuffer,
int logVersion)
For reading a log entry. |
|
LogEntryHeader(byte entryType,
int entryVersion,
int itemSize,
VLSN vlsn)
For reading a replication message. |
|
LogEntryHeader(LogEntry entry,
Provisional provisional,
ReplicationContext repContext)
For writing a log header. |
Method Summary | |
---|---|
ByteBuffer |
addPostMarshallingInfo(EnvironmentImpl envImpl,
ByteBuffer entryBuffer,
long lastOffset,
ReplicationContext repContext)
Add those parts of the header that must be calculated later to the entryBuffer, and also assign the fields in this class. |
(package private) void |
convertCommitToAbort(ByteBuffer entryBuffer)
For use in special case where commits are transformed to aborts because of i/o errors during a logBuffer flush. |
void |
dumpLog(StringBuilder sb,
boolean verbose)
|
(package private) void |
dumpLogNoTag(StringBuilder sb,
boolean verbose)
Dump the header without enclosing |
void |
dumpRep(StringBuilder sb)
|
long |
getChecksum()
|
(package private) int |
getInvariantSizeMinusChecksum()
|
int |
getItemSize()
|
long |
getPrevOffset()
|
Provisional |
getProvisional()
|
boolean |
getReplicated()
|
int |
getSize()
|
(package private) int |
getSizeMinusChecksum()
|
byte |
getType()
|
int |
getVariablePortionSize()
|
int |
getVersion()
|
VLSN |
getVLSN()
|
boolean |
isInvisible()
|
boolean |
isVariableLength()
May be called after reading MIN_HEADER_SIZE bytes to determine whether more bytes (getVariablePortionSize) should be read. |
boolean |
logicalEquals(LogEntryHeader other)
|
(package private) static byte |
makeInvisible(byte flags)
Set the invisible bit in the given log entry flags. |
void |
readVariablePortion(ByteBuffer entryBuffer)
Assumes this is called directly after the constructor, and that the entryBuffer is positioned right before the VLSN. |
void |
setFileHeaderVersion(int logVersion)
Called to set the version for a file header entry after reading the version from the item data. |
String |
toString()
|
static void |
turnOffInvisible(ByteBuffer buffer,
int logHeaderStartPosition)
Turn off the invisible bit in the byte buffer which backs this log entry header. |
void |
writeToLog(ByteBuffer entryBuffer)
Serialize this object into the buffer and leave the buffer positioned in the right place to write the following item. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int MIN_HEADER_SIZE
public static final int MAX_HEADER_SIZE
public static final int CHECKSUM_BYTES
static final int ENTRYTYPE_OFFSET
static final int FLAGS_OFFSET
public static final int VLSN_OFFSET
Constructor Detail |
---|
public LogEntryHeader(ByteBuffer entryBuffer, int logVersion) throws ChecksumException
entryBuffer
- the buffer containing at least the first
MIN_HEADER_SIZE bytes of the entry header.logVersion
- is the log version of the file that contains the given
buffer, and is obtained from the file header. Note that for the file
header entry itself, UNKNOWN_FILE_HEADER_VERSION may be passed.
ChecksumException
public LogEntryHeader(LogEntry entry, Provisional provisional, ReplicationContext repContext)
public LogEntryHeader(byte entryType, int entryVersion, int itemSize, VLSN vlsn)
Method Detail |
---|
public void setFileHeaderVersion(int logVersion)
public long getChecksum()
public byte getType()
public int getVersion()
public long getPrevOffset()
public int getItemSize()
public VLSN getVLSN()
public boolean getReplicated()
public Provisional getProvisional()
public boolean isInvisible()
public int getVariablePortionSize()
public int getSize()
int getSizeMinusChecksum()
int getInvariantSizeMinusChecksum()
public void readVariablePortion(ByteBuffer entryBuffer)
public void writeToLog(ByteBuffer entryBuffer)
public ByteBuffer addPostMarshallingInfo(EnvironmentImpl envImpl, ByteBuffer entryBuffer, long lastOffset, ReplicationContext repContext)
public void dumpLog(StringBuilder sb, boolean verbose)
sb
- destination string bufferverbose
- if true, dump the full, verbose versionvoid dumpLogNoTag(StringBuilder sb, boolean verbose)
sb
- destination string bufferverbose
- if true, dump the full, verbose versionvoid convertCommitToAbort(ByteBuffer entryBuffer)
public String toString()
toString
in class Object
public void dumpRep(StringBuilder sb)
public boolean logicalEquals(LogEntryHeader other)
public boolean isVariableLength()
static byte makeInvisible(byte flags)
public static void turnOffInvisible(ByteBuffer buffer, int logHeaderStartPosition)
logHeaderStartPosition
- the byte position of the start of the log
entry header.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |