public class LNLogEntry extends BaseEntry implements LogEntry
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.
Modifier and Type | Class and Description |
---|---|
(package private) static class |
LNLogEntry.DupStatus |
Modifier and Type | Field and Description |
---|---|
static int |
MIN_LOG_SIZE
Used for computing the minimum log space used by an LNLogEntry.
|
Constructor and Description |
---|
LNLogEntry(java.lang.Class<? extends LN> cls) |
LNLogEntry(LogEntryType entryType,
LN ln,
DatabaseId dbId,
byte[] key,
long abortLsn,
boolean abortKnownDeleted,
Txn txn) |
Modifier and Type | Method and Description |
---|---|
(package private) byte[] |
combineDupKeyData()
Combine old key and old LN's data into a new key, and set the LN's data
to empty.
|
java.lang.StringBuilder |
dumpEntry(java.lang.StringBuilder sb,
boolean verbose)
Print out the contents of an entry.
|
void |
dumpRep(java.lang.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() |
java.lang.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,
java.nio.ByteBuffer entryBuffer,
boolean keyIsLastSerializedField)
Method shared by LNLogEntry subclasses.
|
void |
readEntry(EnvironmentImpl envImpl,
LogEntryHeader header,
java.nio.ByteBuffer entryBuffer)
Read in a log entry.
|
(package private) void |
writeBaseLNEntry(LogEntryHeader header,
java.nio.ByteBuffer destBuffer,
boolean keyIsLastSerializedField)
Method shared by LNLogEntry subclasses.
|
void |
writeEntry(LogEntryHeader header,
java.nio.ByteBuffer destBuffer)
Serialize this object into the buffer.
|
clone, getLogType, getNoArgsConstructor, getResolvedItem, newInstanceOfType, newInstanceOfType, setLogType, toString
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
clone, getLogType, getResolvedItem, setLogType
public static final int MIN_LOG_SIZE
public LNLogEntry(java.lang.Class<? extends LN> cls)
public LNLogEntry(LogEntryType entryType, LN ln, DatabaseId dbId, byte[] key, long abortLsn, boolean abortKnownDeleted, Txn txn)
public void readEntry(EnvironmentImpl envImpl, LogEntryHeader header, java.nio.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, java.nio.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 java.lang.StringBuilder dumpEntry(java.lang.StringBuilder sb, boolean verbose)
LogEntry
dumpEntry
in interface LogEntry
dumpEntry
in class BaseEntry
LogEntry.dumpEntry(java.lang.StringBuilder, boolean)
public void dumpRep(java.lang.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()
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, java.nio.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, java.nio.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()
public long getAbortLsn()
public boolean getAbortKnownDeleted()
public java.lang.Long getTxnId()
public Txn getUserTxn()
public boolean logicalEquals(LogEntry other)
logicalEquals
in interface LogEntry
LogEntry.logicalEquals(com.sleepycat.je.log.entry.LogEntry)
Copyright (c) 2004-2012 Oracle. All rights reserved.