public class LN extends Node implements Loggable
| Constructor and Description |
|---|
LN()
Create an empty LN, to be filled in from the log.
|
LN(byte[] data,
EnvironmentImpl envImpl,
boolean replicated)
Create a new LN from a byte array.
|
LN(DatabaseEntry dbt,
EnvironmentImpl envImpl,
boolean replicated)
Create a new LN from a DatabaseEntry.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
beginTag() |
protected boolean |
canBeAncestor(boolean targetContainsDuplicates)
A LN can never be the ancestor of another node.
|
byte[] |
copyData() |
long |
delete(DatabaseImpl database,
byte[] lnKey,
byte[] dupKey,
long oldLsn,
Locker locker,
ReplicationContext repContext)
Delete this LN's data and log the new version.
|
void |
dumpLog(java.lang.StringBuffer sb,
boolean verbose)
Write the object into the string buffer for log dumping.
|
protected void |
dumpLogAdditional(java.lang.StringBuffer sb,
boolean verbose) |
java.lang.String |
dumpString(int nSpaces,
boolean dumpTags) |
java.lang.String |
endTag() |
byte[] |
getData() |
int |
getLastLoggedSize()
Returns the total last logged log size, including the LNLogEntry
overhead of this LN when it was last logged and the log entry
header.
|
int |
getLogSize() |
LogEntryType |
getLogType() |
long |
getMemorySizeIncludedByParent()
Compute the approximate size of this node in memory for evictor
invocation purposes.
|
protected LogEntryType |
getTransactionalLogType()
Log type for transactional entries
|
boolean |
isDeleted() |
boolean |
isDirty() |
protected boolean |
isSoughtNode(long nid,
CacheMode cacheMode)
A LN can never be a child in the search chain.
|
long |
log(EnvironmentImpl env,
DatabaseImpl databaseImpl,
byte[] key,
long oldLsn,
Locker locker,
boolean backgroundIO,
ReplicationContext repContext)
Log this LN and clear the dirty flag.
|
boolean |
logicalEquals(Loggable other) |
long |
modify(byte[] newData,
DatabaseImpl database,
byte[] lnKey,
long oldLsn,
Locker locker,
ReplicationContext repContext)
Modify the LN's data and log the new version.
|
long |
optionalLog(EnvironmentImpl env,
DatabaseImpl databaseImpl,
byte[] key,
long oldLsn,
Locker locker,
ReplicationContext repContext)
Log this LN if it's not part of a deferred-write db.
|
long |
optionalLogProvisional(EnvironmentImpl env,
DatabaseImpl databaseImpl,
byte[] key,
long oldLsn,
ReplicationContext repContext)
Log a provisional, non-txnal version of an LN.
|
void |
readFromLog(java.nio.ByteBuffer itemBuffer,
byte entryVersion)
Initialize this object from the data in itemBuf.
|
void |
releaseMemoryBudget()
Release the memory budget for any objects referenced by this
LN.
|
void |
setDirty() |
void |
setLastLoggedSize(int size)
Saves the last logged size.
|
void |
writeToLog(java.nio.ByteBuffer logBuffer)
Serialize this object into the buffer.
|
containsDuplicates, dump, getLevel, getNodeId, getTransactionId, getType, latchShared, latchShared, postFetchInit, releaseLatch, shortDescription, toString, verifyclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetTransactionIdpublic LN()
public LN(byte[] data, EnvironmentImpl envImpl, boolean replicated)
public LN(DatabaseEntry dbt, EnvironmentImpl envImpl, boolean replicated)
public byte[] getData()
public byte[] copyData()
public boolean isDeleted()
public boolean isDirty()
public void setDirty()
protected boolean isSoughtNode(long nid,
CacheMode cacheMode)
isSoughtNode in class Nodeprotected boolean canBeAncestor(boolean targetContainsDuplicates)
canBeAncestor in class Nodepublic long delete(DatabaseImpl database, byte[] lnKey, byte[] dupKey, long oldLsn, Locker locker, ReplicationContext repContext) throws DatabaseException
DatabaseExceptionpublic long modify(byte[] newData,
DatabaseImpl database,
byte[] lnKey,
long oldLsn,
Locker locker,
ReplicationContext repContext)
throws DatabaseException
repContext - indicates whether this LN is part of the replication
stream. If this environment is a client node, repContext has the VLSN to
be used when logging the LN. If this environment is a master, it
indicates that the LN should be broadcast.DatabaseExceptionpublic long getMemorySizeIncludedByParent()
getMemorySizeIncludedByParent in class Nodepublic void releaseMemoryBudget()
public java.lang.String beginTag()
public java.lang.String endTag()
public java.lang.String dumpString(int nSpaces,
boolean dumpTags)
public long log(EnvironmentImpl env, DatabaseImpl databaseImpl, byte[] key, long oldLsn, Locker locker, boolean backgroundIO, ReplicationContext repContext) throws DatabaseException
env - the environment.dbId - database id of this node. (Not stored in LN)key - key of this node. (Not stored in LN)oldLsn - is the LSN of the previous version or null.locker - owning locker.repContext - indicates whether this LN is part of the replication
stream. If this environment is a client node, repContext has the VLSN to
be used when logging the LN. If this environment is a master, it
indicates that the LN should be broadcast.DatabaseExceptionpublic long optionalLog(EnvironmentImpl env, DatabaseImpl databaseImpl, byte[] key, long oldLsn, Locker locker, ReplicationContext repContext) throws DatabaseException
env - the environment.dbId - database id of this node. (Not stored in LN)key - key of this node. (Not stored in LN)oldLsn - is the LSN of the previous version or NULL_LSN.locker - owning locker.repContext - indicates whether this LN is part of the replication
stream. If this environment is a client node, repContext has the VLSN to
be used when logging the LN. If this environment is a master, it
indicates that the LN should be broadcast.DatabaseExceptionpublic long optionalLogProvisional(EnvironmentImpl env, DatabaseImpl databaseImpl, byte[] key, long oldLsn, ReplicationContext repContext) throws DatabaseException
env - the environment.dbId - database id of this node. (Not stored in LN)key - key of this node. (Not stored in LN)oldLsn - is the LSN of the previous version or NULL_LSN.DatabaseExceptionprotected LogEntryType getTransactionalLogType()
public LogEntryType getLogType()
getLogType in class NodeNode.getLogType()public int getLastLoggedSize()
public void setLastLoggedSize(int size)
public int getLogSize()
getLogSize in interface LoggablegetLogSize in class NodeLoggable.getLogSize()public void writeToLog(java.nio.ByteBuffer logBuffer)
LoggablewriteToLog in interface LoggablewriteToLog in class NodelogBuffer - is the destination bufferLoggable.writeToLog(java.nio.ByteBuffer)public void readFromLog(java.nio.ByteBuffer itemBuffer,
byte entryVersion)
throws LogException
LoggablereadFromLog in interface LoggablereadFromLog in class NodeLogExceptionLoggable.readFromLog(java.nio.ByteBuffer, byte)public boolean logicalEquals(Loggable other)
logicalEquals in interface LoggableLoggable.logicalEquals(com.sleepycat.je.log.Loggable)public void dumpLog(java.lang.StringBuffer sb,
boolean verbose)
LoggabledumpLog in interface LoggabledumpLog in class Nodesb - destination string bufferverbose - if true, dump the full, verbose versionLoggable.dumpLog(java.lang.StringBuffer, boolean)protected void dumpLogAdditional(java.lang.StringBuffer sb,
boolean verbose)