public class LN extends Node implements Loggable
| Modifier and Type | Class and Description |
|---|---|
(package private) static class |
LN.LNWriteFailureException |
NULL_NODE_ID| Constructor and Description |
|---|
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.
|
| Modifier and Type | Method and Description |
|---|---|
(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.
|
java.lang.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(java.lang.StringBuilder sb,
byte[] key) |
void |
dumpLog(java.lang.StringBuilder sb,
boolean verbose)
Write the object into the string buffer for log dumping.
|
protected void |
dumpLogAdditional(java.lang.StringBuilder sb,
boolean verbose) |
java.lang.String |
dumpString(int nSpaces,
boolean dumpTags) |
java.lang.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(java.nio.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(java.nio.ByteBuffer logBuffer)
Serialize this object into the buffer.
|
containsDuplicates, dump, getLevel, getTransactionId, getType, isBIN, isCompressible, isIN, latchShared, latchShared, postFetchInit, releaseLatch, toString, verifyclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetTransactionIdpublic LN()
LN(byte[] data)
LN(DatabaseEntry dbt)
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()
void makeDeleted()
public boolean isDirty()
public void setDirty()
public long getVLSNSequence()
public void setVLSNSequence(long seq)
boolean isValidForDelete()
isValidForDelete in class Nodeboolean 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 Nodevoid accountForSubtreeRemoval(INList inList, LocalUtilizationTracker localTracker)
accountForSubtreeRemoval in class Nodevoid accountForDeferredWriteSubtreeRemoval(INList inList, IN subtreeParent)
accountForDeferredWriteSubtreeRemoval in class Nodepublic 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)
dumpString in class Nodepublic long optionalLog(EnvironmentImpl envImpl, DatabaseImpl dbImpl, byte[] key, byte[] oldKey, long oldLsn, Locker locker, WriteLockInfo writeLockInfo, ReplicationContext repContext) throws DatabaseException
DatabaseExceptionpublic long optionalLogProvisional(EnvironmentImpl envImpl, DatabaseImpl dbImpl, byte[] key, long oldLsn, ReplicationContext repContext) throws DatabaseException
DatabaseExceptionpublic long log(EnvironmentImpl envImpl, DatabaseImpl dbImpl, byte[] key, long oldLsn, boolean backgroundIO, ReplicationContext repContext) throws DatabaseException
DatabaseExceptionpublic long log(EnvironmentImpl envImpl, DatabaseImpl dbImpl, byte[] key, long oldLsn, Locker locker, WriteLockInfo writeLockInfo, ReplicationContext repContext) throws DatabaseException
DatabaseExceptionLNLogEntry createLogEntry(LogEntryType entryType, DatabaseImpl dbImpl, byte[] key, long logAbortLsn, boolean logAbortKnownDeleted, Txn logTxn, ReplicationContext repContext)
public void incFetchStats(EnvironmentImpl envImpl, boolean isMiss)
NodeincFetchStats in class NodeNode.incFetchStats(com.sleepycat.je.dbi.EnvironmentImpl, boolean)public LogEntryType getGenericLogType()
NodegetGenericLogType in class NodeNode.getGenericLogType()protected LogEntryType getLogType(boolean isInsert, boolean isTransactional)
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,
int entryVersion)
LoggablereadFromLog in interface LoggablereadFromLog in class NodeLoggable.readFromLog(java.nio.ByteBuffer, int)public boolean logicalEquals(Loggable other)
logicalEquals in interface LoggableLoggable.logicalEquals(com.sleepycat.je.log.Loggable)public void dumpLog(java.lang.StringBuilder sb,
boolean verbose)
LoggabledumpLog in interface LoggabledumpLog in class Nodesb - destination string bufferverbose - if true, dump the full, verbose versionLoggable.dumpLog(java.lang.StringBuilder, boolean)public void dumpKey(java.lang.StringBuilder sb,
byte[] key)
protected void dumpLogAdditional(java.lang.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)
Copyright (c) 2004-2012 Oracle. All rights reserved.