|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sleepycat.je.tree.Node
com.sleepycat.je.tree.LN
public class LN
An LN represents a Leaf Node in the JE tree.
Nested Class Summary | |
---|---|
(package private) static class |
LN.LNWriteFailureException
|
Field Summary |
---|
Fields inherited from class com.sleepycat.je.tree.Node |
---|
NULL_NODE_ID |
Constructor Summary | |
---|---|
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. |
Method Summary | |
---|---|
(package private) void |
accountForDeferredWriteSubtreeRemoval(INList inList,
IN subtreeParent)
No need to do anything, stop the search. |
(package private) void |
accountForSubtreeRemoval(INList inList,
LocalUtilizationTracker localTracker)
No need to do anything, stop the search. |
String |
beginTag()
|
protected boolean |
canBeAncestor(boolean targetContainsDuplicates)
A LN can never be the ancestor of another node. |
byte[] |
copyData()
|
(package private) LNLogEntry |
createLogEntry(LogEntryType entryType,
DatabaseImpl dbImpl,
byte[] key,
byte[] delDupKey,
long logAbortLsn,
boolean logAbortKnownDeleted,
Txn logTxn,
ReplicationContext repContext)
|
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 |
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()
|
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 |
void |
incFetchStats(EnvironmentImpl envImpl,
boolean isMiss)
We categorize fetch stats by the type of node, so node subclasses update different stats. |
boolean |
isDeleted()
|
boolean |
isDirty()
|
(package private) boolean |
isEvictable()
Returns true by default, but is overridden by MapLN to prevent eviction of open databases. |
(package private) boolean |
isEvictableInexact()
Returns true by default, but is overridden by MapLN to prevent eviction of open databases. |
protected boolean |
isSoughtNode(long nid,
CacheMode cacheMode,
boolean ignore)
A LN can never be a child in the search chain. |
(package private) boolean |
isValidForDelete()
|
(package private) long |
log(EnvironmentImpl env,
DatabaseImpl dbImpl,
byte[] key,
byte[] delDupKey,
long oldLsn,
Locker locker,
boolean backgroundIO,
boolean isProvisional,
ReplicationContext repContext)
Log this LN. |
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)
|
(package private) void |
makeDeleted()
|
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(ByteBuffer itemBuffer,
int entryVersion)
Initialize this object from the data in itemBuf. |
(package private) void |
rebuildINList(INList inList)
Add yourself to the in memory list if you're a type of node that should belong. |
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(ByteBuffer logBuffer)
Serialize this object into the buffer. |
Methods inherited from class com.sleepycat.je.tree.Node |
---|
containsDuplicates, dump, getLevel, getNodeId, getTransactionId, getType, latchShared, latchShared, matchLNByNodeId, postFetchInit, releaseLatch, setNodeId, shortDescription, toString, verify |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.sleepycat.je.log.Loggable |
---|
getTransactionId |
Constructor Detail |
---|
public LN()
public LN(byte[] data, EnvironmentImpl envImpl, boolean replicated)
public LN(DatabaseEntry dbt, EnvironmentImpl envImpl, boolean replicated)
Method Detail |
---|
public byte[] getData()
public byte[] copyData()
public boolean isDeleted()
void makeDeleted()
public boolean isDirty()
public void setDirty()
boolean isValidForDelete()
isValidForDelete
in class Node
boolean isEvictableInexact()
boolean isEvictable() throws DatabaseException
DatabaseException
- from subclasses.protected boolean isSoughtNode(long nid, CacheMode cacheMode, boolean ignore)
isSoughtNode
in class Node
protected boolean canBeAncestor(boolean targetContainsDuplicates)
canBeAncestor
in class Node
public long delete(DatabaseImpl database, byte[] lnKey, byte[] dupKey, long oldLsn, Locker locker, ReplicationContext repContext) throws DatabaseException
lnKey
- is the key of the BIN/DBIN parent of the LN.dupKey
- is null if the LN parent is a BIN, or is the main tree key
if the LN parent is a DBIN.
DatabaseException
public 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.
DatabaseException
void rebuildINList(INList inList)
rebuildINList
in class Node
void accountForSubtreeRemoval(INList inList, LocalUtilizationTracker localTracker)
accountForSubtreeRemoval
in class Node
void accountForDeferredWriteSubtreeRemoval(INList inList, IN subtreeParent)
accountForDeferredWriteSubtreeRemoval
in class Node
public long getMemorySizeIncludedByParent()
getMemorySizeIncludedByParent
in class Node
public void releaseMemoryBudget()
public String beginTag()
public String endTag()
public String dumpString(int nSpaces, boolean dumpTags)
dumpString
in class Node
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.
DatabaseException
public 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.
DatabaseException
public 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.
DatabaseException
long log(EnvironmentImpl env, DatabaseImpl dbImpl, byte[] key, byte[] delDupKey, long oldLsn, Locker locker, boolean backgroundIO, boolean isProvisional, 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)delDupKey
- if non-null, the dupKey for deleting the LN.oldLsn
- is the LSN of the previous version or NULL_LSN.locker
- owning locker.
DatabaseException
LNLogEntry createLogEntry(LogEntryType entryType, DatabaseImpl dbImpl, byte[] key, byte[] delDupKey, long logAbortLsn, boolean logAbortKnownDeleted, Txn logTxn, ReplicationContext repContext)
public void incFetchStats(EnvironmentImpl envImpl, boolean isMiss)
Node
incFetchStats
in class Node
Node.incFetchStats(com.sleepycat.je.dbi.EnvironmentImpl, boolean)
protected LogEntryType getTransactionalLogType()
public LogEntryType getLogType()
getLogType
in class Node
Node.getLogType()
public int getLastLoggedSize()
public void setLastLoggedSize(int size)
public int getLogSize()
getLogSize
in interface Loggable
getLogSize
in class Node
Loggable.getLogSize()
public void writeToLog(ByteBuffer logBuffer)
Loggable
writeToLog
in interface Loggable
writeToLog
in class Node
logBuffer
- is the destination bufferLoggable.writeToLog(java.nio.ByteBuffer)
public void readFromLog(ByteBuffer itemBuffer, int entryVersion)
Loggable
readFromLog
in interface Loggable
readFromLog
in class Node
Loggable.readFromLog(java.nio.ByteBuffer, int)
public boolean logicalEquals(Loggable other)
logicalEquals
in interface Loggable
Loggable.logicalEquals(com.sleepycat.je.log.Loggable)
public void dumpLog(StringBuilder sb, boolean verbose)
Loggable
dumpLog
in interface Loggable
dumpLog
in class Node
sb
- destination string bufferverbose
- if true, dump the full, verbose versionLoggable.dumpLog(java.lang.StringBuilder, boolean)
public void dumpKey(StringBuilder sb, byte[] key)
protected void dumpLogAdditional(StringBuilder sb, boolean verbose)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |