|
|||||||||
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.
Constructor Summary | |
---|---|
LN()
Create an empty LN, to be filled in from the log. |
|
LN(byte[] data)
Create a new LN from a byte array. |
|
LN(DatabaseEntry dbt)
Create a new LN from a DatabaseEntry. |
Method Summary | |
---|---|
(package private) void |
accountForSubtreeRemoval(INList inList,
UtilizationTracker tracker)
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. |
(package private) boolean |
canMemorySizeChangeDuringLogging()
Returns whether this LN's memory size can change during logging, such as when a FileSummaryLN's size changes in the getLogSize or writeToLog method. |
byte[] |
copyData()
|
long |
delete(DatabaseImpl database,
byte[] lnKey,
byte[] dupKey,
long oldLsn,
Locker locker)
Delete this LN's data and log the new version. |
void |
dumpLog(StringBuffer sb,
boolean verbose)
Write the object into the string buffer for log dumping. |
protected void |
dumpLogAdditional(StringBuffer 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 |
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,
boolean updateGeneration)
A LN can never be a child in the search chain. |
(package private) boolean |
isValidForDelete()
|
long |
log(EnvironmentImpl env,
DatabaseId dbId,
byte[] key,
byte[] delDupKey,
long oldLsn,
int oldSize,
Locker locker,
boolean backgroundIO,
boolean isProvisional)
Log this LN. |
long |
logUpdateMemUsage(DatabaseImpl database,
byte[] lnKey,
long oldLsn,
Locker locker,
IN parent)
Veriation of logUpdateMemUsage that specifies false for the backgroundIO parameter. |
long |
logUpdateMemUsage(DatabaseImpl database,
byte[] lnKey,
long oldLsn,
Locker locker,
IN parent,
boolean backgroundIO)
Logs an LN that is already present in the parent IN, adjusting the memory budget if the size of the LN changes during logging, such as for FileSummaryLNs. |
(package private) void |
makeDeleted()
|
long |
modify(byte[] newData,
DatabaseImpl database,
byte[] lnKey,
long oldLsn,
Locker locker)
Modify the LN's data and log the new version. |
long |
optionalLog(EnvironmentImpl env,
DatabaseImpl databaseImpl,
byte[] key,
long oldLsn,
int oldSize,
Locker locker)
Log this LN if it's not part of a deferred-write db. |
long |
optionalLogProvisional(EnvironmentImpl env,
DatabaseImpl databaseImpl,
byte[] key,
long oldLsn,
int oldSize)
Log a provisional, non-txnal version of an LN. |
long |
optionalLogUpdateMemUsage(DatabaseImpl database,
byte[] lnKey,
long oldLsn,
Locker locker,
IN parent)
Veriation of logUpdateMemUsage that does not log for a DeferredWrite DB. |
void |
readFromLog(ByteBuffer itemBuffer,
byte entryTypeVersion)
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. |
(package private) 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, getLastId, getLevel, getNextNodeId, getNodeId, getTransactionId, getType, latchShared, matchLNByNodeId, postFetchInit, releaseLatch, setLastNodeId, 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)
public LN(DatabaseEntry dbt)
Method Detail |
---|
public byte[] getData()
public byte[] copyData()
public boolean isDeleted()
void makeDeleted()
public boolean isDirty()
void setDirty()
boolean isValidForDelete()
isValidForDelete
in class Node
boolean isEvictableInexact()
boolean isEvictable() throws DatabaseException
DatabaseException
protected boolean isSoughtNode(long nid, boolean updateGeneration)
isSoughtNode
in class Node
protected boolean canBeAncestor(boolean targetContainsDuplicates)
canBeAncestor
in class Node
boolean canMemorySizeChangeDuringLogging()
public long delete(DatabaseImpl database, byte[] lnKey, byte[] dupKey, long oldLsn, Locker locker) throws DatabaseException
DatabaseException
public long modify(byte[] newData, DatabaseImpl database, byte[] lnKey, long oldLsn, Locker locker) throws DatabaseException
DatabaseException
public long logUpdateMemUsage(DatabaseImpl database, byte[] lnKey, long oldLsn, Locker locker, IN parent, boolean backgroundIO) throws DatabaseException
DatabaseException
public long logUpdateMemUsage(DatabaseImpl database, byte[] lnKey, long oldLsn, Locker locker, IN parent) throws DatabaseException
DatabaseException
public long optionalLogUpdateMemUsage(DatabaseImpl database, byte[] lnKey, long oldLsn, Locker locker, IN parent) throws DatabaseException
DatabaseException
void rebuildINList(INList inList)
rebuildINList
in class Node
void accountForSubtreeRemoval(INList inList, UtilizationTracker tracker)
accountForSubtreeRemoval
in class Node
public long getMemorySizeIncludedByParent()
getMemorySizeIncludedByParent
in class Node
public String beginTag()
public String endTag()
public String dumpString(int nSpaces, boolean dumpTags)
dumpString
in class Node
public long optionalLog(EnvironmentImpl env, DatabaseImpl databaseImpl, byte[] key, long oldLsn, int oldSize, Locker locker) 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.oldSize
- is the size of the previous version or zero.locker
- owning locker.
DatabaseException
public long optionalLogProvisional(EnvironmentImpl env, DatabaseImpl databaseImpl, byte[] key, long oldLsn, int oldSize) 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.oldSize
- is the size of the previous version or zero.
DatabaseException
public long log(EnvironmentImpl env, DatabaseId dbId, byte[] key, byte[] delDupKey, long oldLsn, int oldSize, Locker locker, boolean backgroundIO, boolean isProvisional) 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.oldSize
- is the size of the previous version or zero.locker
- owning locker.
DatabaseException
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, byte entryTypeVersion) throws LogException
Loggable
readFromLog
in interface Loggable
readFromLog
in class Node
LogException
Loggable.readFromLog(java.nio.ByteBuffer, byte)
public void dumpLog(StringBuffer 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.StringBuffer, boolean)
protected void dumpLogAdditional(StringBuffer sb, boolean verbose)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |