|
|||||||||
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)
|
|
LN(DatabaseEntry dbt)
|
|
LN(SizeofMarker marker,
DatabaseEntry dbt)
For Sizeof. |
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. |
void |
addExtraMarshaledMemorySize(BIN parentBIN)
Account for FileSummaryLN's extra marshaled memory. |
String |
beginTag()
|
static byte[] |
copyEntryData(DatabaseEntry entry)
Returns a byte array that is a complete copy of the data in a non-partial entry. |
(package private) LNLogEntry |
createLogEntry(LogEntryType entryType,
DatabaseImpl dbImpl,
byte[] key,
long logAbortLsn,
boolean logAbortKnownDeleted,
Txn logTxn,
ReplicationContext repContext)
|
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()
|
LogEntryType |
getGenericLogType()
Returns the generic LogEntryType for this node. |
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()
|
protected LogEntryType |
getLogType(boolean isInsert,
boolean isTransactional)
|
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. |
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(long lsn)
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. |
boolean |
isLN()
|
(package private) boolean |
isValidForDelete()
|
long |
log(EnvironmentImpl envImpl,
DatabaseImpl dbImpl,
byte[] key,
long oldLsn,
boolean backgroundIO,
ReplicationContext repContext)
Convenience logging method. |
long |
log(EnvironmentImpl envImpl,
DatabaseImpl dbImpl,
byte[] key,
long oldLsn,
Locker locker,
WriteLockInfo writeLockInfo,
ReplicationContext repContext)
Convenience logging method. |
boolean |
logicalEquals(Loggable other)
|
(package private) void |
makeDeleted()
|
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)
|
long |
optionalLog(EnvironmentImpl envImpl,
DatabaseImpl dbImpl,
byte[] key,
byte[] oldKey,
long oldLsn,
Locker locker,
WriteLockInfo writeLockInfo,
ReplicationContext repContext)
Convenience logging method. |
long |
optionalLogProvisional(EnvironmentImpl envImpl,
DatabaseImpl dbImpl,
byte[] key,
long oldLsn,
ReplicationContext repContext)
Convenience logging method. |
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. |
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 entry,
byte[] bytes)
Copies the given byte array to the entry, copying only partial data if the entry is specified to be partial. |
void |
setLastLoggedSize(int size)
Saves the last logged size. |
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. |
Methods inherited from class com.sleepycat.je.tree.Node |
---|
containsDuplicates, dump, getLevel, getTransactionId, getType, isBIN, isCompressible, isIN, latchShared, latchShared, postFetchInit, releaseLatch, 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()
LN(byte[] data)
LN(DatabaseEntry dbt)
public LN(SizeofMarker marker, DatabaseEntry dbt)
Method Detail |
---|
public static LN makeLN(EnvironmentImpl envImpl, byte[] dataParam)
public static LN makeLN(EnvironmentImpl envImpl, DatabaseEntry dbt)
public byte[] getData()
public boolean isDeleted()
public boolean isLN()
isLN
in class Node
void makeDeleted()
public boolean isDirty()
public void setDirty()
public long getVLSNSequence()
public void setVLSNSequence(long seq)
boolean isValidForDelete()
isValidForDelete
in class Node
boolean isEvictableInexact()
boolean isEvictable(long lsn) throws DatabaseException
DatabaseException
- from subclasses.public void delete()
public void modify(byte[] newData)
public byte[] setEmpty()
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 optionalLog(EnvironmentImpl envImpl, DatabaseImpl dbImpl, byte[] key, byte[] oldKey, long oldLsn, Locker locker, WriteLockInfo writeLockInfo, ReplicationContext repContext) throws DatabaseException
DatabaseException
public long optionalLogProvisional(EnvironmentImpl envImpl, DatabaseImpl dbImpl, byte[] key, long oldLsn, ReplicationContext repContext) throws DatabaseException
DatabaseException
public long log(EnvironmentImpl envImpl, DatabaseImpl dbImpl, byte[] key, long oldLsn, boolean backgroundIO, ReplicationContext repContext) throws DatabaseException
DatabaseException
public long log(EnvironmentImpl envImpl, DatabaseImpl dbImpl, byte[] key, long oldLsn, Locker locker, WriteLockInfo writeLockInfo, ReplicationContext repContext) throws DatabaseException
DatabaseException
LNLogEntry createLogEntry(LogEntryType entryType, DatabaseImpl dbImpl, byte[] key, 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)
public LogEntryType getGenericLogType()
Node
getGenericLogType
in class Node
Node.getGenericLogType()
protected LogEntryType getLogType(boolean isInsert, boolean isTransactional)
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)
public void addExtraMarshaledMemorySize(BIN parentBIN)
public void setEntry(DatabaseEntry entry)
public static void setEntry(DatabaseEntry entry, byte[] bytes)
public static byte[] copyEntryData(DatabaseEntry entry)
public static byte[] resolvePartialEntry(DatabaseEntry entry, byte[] foundDataBytes)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |