|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sleepycat.je.log.entry.BaseEntry
com.sleepycat.je.log.entry.LNLogEntry
public class LNLogEntry
LNLogEntry embodies all LN log entries. On disk, an LN log entry contains (pre version 6)
LN databaseid key abortLsn -- if transactional abortKnownDeleted -- if transactional txn -- if transactional (version 6) databaseid abortLsn -- if transactional abortKnownDeleted -- if transactional txn -- if transactional LN keyBefore version 6, a non-full-item read of a log entry only retrieved the node ID. After version 6, the database id, transaction id and node ID are all available.
Nested Class Summary | |
---|---|
(package private) static class |
LNLogEntry.DupStatus
|
Field Summary | |
---|---|
static int |
MIN_LOG_SIZE
Used for computing the minimum log space used by an LNLogEntry. |
Fields inherited from class com.sleepycat.je.log.entry.BaseEntry |
---|
entryType |
Constructor Summary | |
---|---|
LNLogEntry(Class<? extends LN> cls)
|
|
LNLogEntry(LogEntryType entryType,
LN ln,
DatabaseId dbId,
byte[] key,
long abortLsn,
boolean abortKnownDeleted,
Txn txn)
|
Method Summary | |
---|---|
(package private) byte[] |
combineDupKeyData()
Combine old key and old LN's data into a new key, and set the LN's data to empty. |
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. |
boolean |
getAbortKnownDeleted()
|
long |
getAbortLsn()
|
(package private) int |
getBaseLNEntrySize(boolean keyIsLastSerializedField)
Method shared by LNLogEntry subclasses. |
DatabaseId |
getDbId()
|
byte[] |
getKey()
|
int |
getLastLoggedSize()
Returns the last logged size, saved by readEntry and writeEntry. |
LN |
getLN()
|
LN |
getMainItem()
|
int |
getSize()
#see LogEntry#getSize |
long |
getTransactionId()
|
Long |
getTxnId()
|
int |
getUnconvertedDataLength()
This method is only used when the converted length is not needed, for example by StatsFileReader. |
int |
getUnconvertedKeyLength()
This method is only used when the converted length is not needed, for example by StatsFileReader. |
void |
getUserKeyData(DatabaseEntry keyParam,
DatabaseEntry dataParam)
Translates two-part keys in duplicate DBs back to the original user operation params. |
Txn |
getUserTxn()
|
boolean |
isDeleted()
Returns true for a deleted LN to count it immediately as obsolete. |
boolean |
logicalEquals(LogEntry other)
|
(package private) LN |
newLNInstance(EnvironmentImpl envImpl)
newLNInstance usually returns exactly the type of LN of the type that was contained in in the log. |
void |
postFetchInit(boolean isDupDb)
Converts the key/data for old format LNs in a duplicates DB. |
void |
postFetchInit(DatabaseImpl dbImpl)
See postFetchInit(boolean). |
void |
postLogWork(LogEntryHeader header,
long justLoggedLsn)
For LN entries, we need to record the latest LSN for that node with the owning transaction, within the protection of the log latch. |
(package private) void |
readBaseLNEntry(EnvironmentImpl envImpl,
LogEntryHeader header,
ByteBuffer entryBuffer,
boolean keyIsLastSerializedField)
Method shared by LNLogEntry subclasses. |
void |
readEntry(EnvironmentImpl envImpl,
LogEntryHeader header,
ByteBuffer entryBuffer)
Read in a log entry. |
(package private) void |
writeBaseLNEntry(LogEntryHeader header,
ByteBuffer destBuffer,
boolean keyIsLastSerializedField)
Method shared by LNLogEntry subclasses. |
void |
writeEntry(LogEntryHeader header,
ByteBuffer destBuffer)
Serialize this object into the buffer. |
Methods inherited from class com.sleepycat.je.log.entry.BaseEntry |
---|
clone, getLogType, getNoArgsConstructor, getResolvedItem, newInstanceOfType, newInstanceOfType, 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, getLogType, getResolvedItem, setLogType |
Field Detail |
---|
public static final int MIN_LOG_SIZE
Constructor Detail |
---|
public LNLogEntry(Class<? extends LN> cls)
public LNLogEntry(LogEntryType entryType, LN ln, DatabaseId dbId, byte[] key, long abortLsn, boolean abortKnownDeleted, Txn txn)
Method Detail |
---|
public void readEntry(EnvironmentImpl envImpl, LogEntryHeader header, ByteBuffer entryBuffer)
LogEntry
readEntry
in interface LogEntry
LogEntry.readEntry(com.sleepycat.je.dbi.EnvironmentImpl, com.sleepycat.je.log.LogEntryHeader, java.nio.ByteBuffer)
final void readBaseLNEntry(EnvironmentImpl envImpl, LogEntryHeader header, ByteBuffer entryBuffer, boolean keyIsLastSerializedField)
keyIsLastSerializedField
- specifies whether the key length can be
omitted because the key is the last field. This should be false when
an LNLogEntry subclass adds fields to the serialized format.LN newLNInstance(EnvironmentImpl envImpl)
public StringBuilder dumpEntry(StringBuilder sb, boolean verbose)
LogEntry
dumpEntry
in interface LogEntry
dumpEntry
in class BaseEntry
LogEntry.dumpEntry(java.lang.StringBuilder, boolean)
public void dumpRep(StringBuilder sb)
LogEntry
dumpRep
in interface LogEntry
LogEntry.dumpRep(java.lang.StringBuilder)
public LN getMainItem()
getMainItem
in interface LogEntry
LogEntry.getMainItem()
public long getTransactionId()
getTransactionId
in interface LogEntry
LogEntry.getTransactionId()
public int getSize()
getSize
in interface LogEntry
final int getBaseLNEntrySize(boolean keyIsLastSerializedField)
keyIsLastSerializedField
- specifies whether the key length can be
omitted because the key is the last field. This should be false when
an LNLogEntry subclass adds fields to the serialized format.public int getLastLoggedSize()
getLastLoggedSize
in interface LogEntry
getLastLoggedSize
in class BaseEntry
public void writeEntry(LogEntryHeader header, ByteBuffer destBuffer)
LogEntry
writeEntry
in interface LogEntry
destBuffer
- is the destination bufferLogEntry.writeEntry(com.sleepycat.je.log.LogEntryHeader, java.nio.ByteBuffer)
final void writeBaseLNEntry(LogEntryHeader header, ByteBuffer destBuffer, boolean keyIsLastSerializedField)
keyIsLastSerializedField
- specifies whether the key length can be
omitted because the key is the last field. This should be false when
an LNLogEntry subclass adds fields to the serialized format.public boolean isDeleted()
isDeleted
in interface LogEntry
isDeleted
in class BaseEntry
LogEntry.isDeleted()
public void postLogWork(LogEntryHeader header, long justLoggedLsn)
postLogWork
in interface LogEntry
postLogWork
in class BaseEntry
LogEntry.postLogWork(com.sleepycat.je.log.LogEntryHeader, long)
public void postFetchInit(DatabaseImpl dbImpl)
postFetchInit
in class BaseEntry
public void postFetchInit(boolean isDupDb)
byte[] combineDupKeyData()
public void getUserKeyData(DatabaseEntry keyParam, DatabaseEntry dataParam)
public LN getLN()
public byte[] getKey()
public int getUnconvertedDataLength()
public int getUnconvertedKeyLength()
public DatabaseId getDbId()
getDbId
in interface LogEntry
public long getAbortLsn()
public boolean getAbortKnownDeleted()
public Long getTxnId()
public Txn getUserTxn()
public boolean logicalEquals(LogEntry other)
logicalEquals
in interface LogEntry
LogEntry.logicalEquals(com.sleepycat.je.log.entry.LogEntry)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |