public class LN extends Node implements VersionedWriteLoggable
NULL_NODE_ID| Constructor and Description |
|---|
LN()
Create an empty LN, to be filled in from the log.
|
LN(SizeofMarker marker,
DatabaseEntry dbt)
For Sizeof.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addExtraMarshaledMemorySize(BIN parentBIN)
Account for FileSummaryLN's extra marshaled memory.
|
String |
beginTag() |
void |
clearDirty() |
static byte[] |
copyEntryData(DatabaseEntry entry)
Returns a byte array that is a complete copy of the data in a
non-partial entry.
|
void |
delete() |
void |
dumpKey(StringBuilder sb,
byte[] key) |
void |
dumpLog(StringBuilder sb,
boolean verbose)
Write the object into the string buffer for log dumping.
|
protected void |
dumpLogAdditional(StringBuilder sb,
boolean verbose) |
String |
dumpString(int nSpaces,
boolean dumpTags) |
String |
endTag() |
byte[] |
getData() |
Collection<VersionedWriteLoggable> |
getEmbeddedLoggables() |
boolean |
getFetchedCold() |
LogEntryType |
getGenericLogType()
Returns the generic LogEntryType for this node.
|
int |
getLastFormatChange()
Returns the log version of the most recent format change for this
loggable item.
|
int |
getLogSize() |
int |
getLogSize(int logVersion,
boolean forReplication)
Returns the number of bytes needed to store this object in the format
for the specified log version.
|
protected LogEntryType |
getLogType(boolean isInsert,
boolean isTransactional,
DatabaseImpl db) |
long |
getMemorySizeIncludedByParent()
Compute the approximate size of this node in memory for evictor
invocation purposes.
|
long |
getVLSNSequence()
Called by CursorImpl to get the record version.
|
boolean |
hasReplicationFormat()
Returns whether this format has a variant that is optimized for
replication.
|
boolean |
isDeleted() |
boolean |
isDirty() |
boolean |
isLN() |
boolean |
isReplicationFormatWorthwhile(ByteBuffer logBuffer,
int srcVersion,
int destVersion)
Returns whether it is worthwhile to materialize and then re-serialize a
log entry in a format optimized for replication.
|
LogItem |
log(EnvironmentImpl envImpl,
DatabaseImpl dbImpl,
Locker locker,
WriteLockInfo writeLockInfo,
boolean newEmbeddedLN,
byte[] newKey,
int newExpiration,
boolean newExpirationInHours,
boolean currEmbeddedLN,
long currLsn,
int currSize,
boolean isInsertion,
boolean backgroundIO,
ReplicationContext repContext)
Convenience logging method, used to migrate an LN during cleaning.
|
boolean |
logicalEquals(Loggable other) |
static LN |
makeLN(EnvironmentImpl envImpl,
byte[] dataParam)
Create a new LN from a byte array.
|
static LN |
makeLN(EnvironmentImpl envImpl,
DatabaseEntry dbt)
Create a new LN from a DatabaseEntry.
|
void |
modify(byte[] newData) |
LogItem |
optionalLog(EnvironmentImpl envImpl,
DatabaseImpl dbImpl,
Locker locker,
WriteLockInfo writeLockInfo,
boolean newEmbeddedLN,
byte[] newKey,
int newExpiration,
boolean newExpirationInHours,
boolean currEmbeddedLN,
long currLsn,
int currSize,
boolean isInsertion,
ReplicationContext repContext)
Convenience logging method.
|
void |
postFetchInit(DatabaseImpl db,
long sourceLsn)
Initialize a node that has been faulted in from the log.
|
void |
readFromLog(ByteBuffer itemBuffer,
int entryVersion)
Initialize this object from the data in itemBuf.
|
static byte[] |
resolvePartialEntry(DatabaseEntry entry,
byte[] foundDataBytes)
Merges the partial entry with the given byte array, effectively applying
a partial entry to an existing record, and returns a enw byte array.
|
void |
setDirty() |
byte[] |
setEmpty()
Sets data to empty and returns old data.
|
void |
setEntry(DatabaseEntry entry)
Copies the non-deleted LN's byte array to the entry.
|
static void |
setEntry(DatabaseEntry dest,
byte[] bytes)
Copies the given byte array to the given destination entry, copying only
partial data if the entry is specified to be partial.
|
static void |
setEntry(DatabaseEntry dest,
DatabaseEntry src)
Copies the given source entry to the given destination entry, copying
only partial data if the destination entry is specified to be partial.
|
void |
setFetchedCold(boolean val) |
void |
setVLSNSequence(long seq)
Called by LogManager after writing an LN with a newly assigned VLSN, and
called by LNLogEntry after reading the LN with the VLSN from the log
entry header.
|
void |
writeToLog(ByteBuffer logBuffer)
Serialize this object into the buffer.
|
void |
writeToLog(ByteBuffer logBuffer,
int logVersion,
boolean forReplication)
Serializes this object into the specified buffer in the format for the
specified log version.
|
containsDuplicates, dump, getLevel, getTransactionId, getType, isBIN, isBINDelta, isBINDelta, isDBIN, isDIN, isIN, isUpperIN, latch, latchShared, latchShared, releaseLatch, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetTransactionIdpublic LN()
public LN(SizeofMarker marker, DatabaseEntry dbt)
public static LN makeLN(EnvironmentImpl envImpl, byte[] dataParam)
public static LN makeLN(EnvironmentImpl envImpl, DatabaseEntry dbt)
public byte[] getData()
public boolean isDeleted()
public boolean isDirty()
public void setDirty()
public void clearDirty()
public boolean getFetchedCold()
public void setFetchedCold(boolean val)
public void postFetchInit(DatabaseImpl db, long sourceLsn)
NodepostFetchInit in class Nodepublic long getVLSNSequence()
public void setVLSNSequence(long seq)
public void delete()
public void modify(byte[] newData)
public byte[] setEmpty()
public long getMemorySizeIncludedByParent()
getMemorySizeIncludedByParent in class Nodepublic String beginTag()
public String endTag()
public String dumpString(int nSpaces, boolean dumpTags)
public LogItem optionalLog(EnvironmentImpl envImpl, DatabaseImpl dbImpl, Locker locker, WriteLockInfo writeLockInfo, boolean newEmbeddedLN, byte[] newKey, int newExpiration, boolean newExpirationInHours, boolean currEmbeddedLN, long currLsn, int currSize, boolean isInsertion, ReplicationContext repContext) throws DatabaseException
DatabaseExceptionpublic LogItem log(EnvironmentImpl envImpl, DatabaseImpl dbImpl, Locker locker, WriteLockInfo writeLockInfo, boolean newEmbeddedLN, byte[] newKey, int newExpiration, boolean newExpirationInHours, boolean currEmbeddedLN, long currLsn, int currSize, boolean isInsertion, boolean backgroundIO, ReplicationContext repContext) throws DatabaseException
DatabaseExceptionpublic LogEntryType getGenericLogType()
NodegetGenericLogType in class NodeNode.getGenericLogType()protected LogEntryType getLogType(boolean isInsert, boolean isTransactional, DatabaseImpl db)
public int getLastFormatChange()
VersionedWriteLoggablegetLastFormatChange in interface VersionedWriteLoggableVersionedWriteLoggable.getLastFormatChange()public Collection<VersionedWriteLoggable> getEmbeddedLoggables()
getEmbeddedLoggables in interface VersionedWriteLoggableReplicableLogEntry.getEmbeddedLoggables()public int getLogSize()
getLogSize in interface Loggablepublic void writeToLog(ByteBuffer logBuffer)
LoggablewriteToLog in interface LoggablelogBuffer - is the destination bufferpublic int getLogSize(int logVersion,
boolean forReplication)
VersionedWriteLoggableLogEntryType.LOG_VERSION_REPLICATE_OLDER or greater.getLogSize in interface VersionedWriteLoggablelogVersion - the log versionforReplication - whether the entry will be sent over the wire,
and not written to the log.public void writeToLog(ByteBuffer logBuffer, int logVersion, boolean forReplication)
VersionedWriteLoggableLogEntryType.LOG_VERSION_REPLICATE_OLDER or greater.writeToLog in interface VersionedWriteLoggablelogBuffer - the destination bufferlogVersion - the log versionforReplication - whether the entry will be sent over the wire,
and not written to the log.public void readFromLog(ByteBuffer itemBuffer, int entryVersion)
LoggablereadFromLog in interface LoggableitemBuffer - the source bufferentryVersion - the log version of the datapublic boolean hasReplicationFormat()
VersionedWriteLoggablehasReplicationFormat in interface VersionedWriteLoggablepublic boolean isReplicationFormatWorthwhile(ByteBuffer logBuffer, int srcVersion, int destVersion)
VersionedWriteLoggableWARNING: The logBuffer position must not be changed by this method.
WARNING: The shared LogEntry object is used for calling this method, and this method must not change any of the fields in the object.
isReplicationFormatWorthwhile in interface VersionedWriteLoggablelogBuffer - contains the entry that would be re-serialized.srcVersion - the log version of entry in logBuffer.destVersion - the version that would be used for re-serialization.public boolean logicalEquals(Loggable other)
logicalEquals in interface Loggablepublic void dumpLog(StringBuilder sb, boolean verbose)
Loggablepublic void dumpKey(StringBuilder sb, byte[] key)
protected void dumpLogAdditional(StringBuilder sb, boolean verbose)
public void addExtraMarshaledMemorySize(BIN parentBIN)
public void setEntry(DatabaseEntry entry)
public static void setEntry(DatabaseEntry dest, byte[] bytes)
public static void setEntry(DatabaseEntry dest, DatabaseEntry src)
public static byte[] copyEntryData(DatabaseEntry entry)
public static byte[] resolvePartialEntry(DatabaseEntry entry, byte[] foundDataBytes)
Copyright © 2024. All rights reserved.