ACCUMULATED_LIMIT, BIN_LEVEL, DBMAP_LEVEL, EXACT_MATCH, INSERT_SUCCESS, latch, LEVEL_MASK, MAIN_LEVEL, MAX_LEVEL, MAY_EVICT_LNS, MAY_EVICT_NODE, MAY_NOT_EVICT, MIN_LEVEL
Constructor and Description |
---|
DIN()
Create an empty DIN, with no node id, to be filled in from the log.
|
DIN(DatabaseImpl db,
byte[] identifierKey,
int capacity,
byte[] dupKey,
ChildReference dupCountLNRef,
int level)
Create a new DIN.
|
Modifier and Type | Method and Description |
---|---|
void |
beforeLog(LogManager logManager,
INLogItem item,
INLogContext context)
Handles lazy migration of DupCountLNs prior to logging a DIN.
|
java.lang.String |
beginTag() |
protected long |
computeMemorySize()
Count up the memory usage attributable to this node alone.
|
static long |
computeOverhead(DbConfigManager configManager) |
boolean |
containsDuplicates() |
protected IN |
createNewInstance(byte[] identifierKey,
int maxEntries,
int level)
Create a new DIN.
|
protected void |
dumpLogAdditional(java.lang.StringBuffer sb)
DINS need to dump their dup key
|
java.lang.String |
dumpString(int nSpaces,
boolean dumpTags)
For unit test support:
|
java.lang.String |
endTag() |
protected int |
generateLevel(DatabaseId dbId,
int newLevel) |
byte[] |
getChildKey(IN child)
Get the key (dupe or identifier) in child that is used to locate
it in 'this' node.
|
DupCountLN |
getDupCountLN() |
ChildReference |
getDupCountLNRef() |
byte[] |
getDupKey()
Return the key for this duplicate set.
|
byte[] |
getDupTreeKey()
Return the key for navigating through the duplicate tree.
|
java.util.Comparator<byte[]> |
getKeyComparator()
Return the comparator function to be used for DINs.
|
int |
getLogSize() |
LogEntryType |
getLogType() |
byte[] |
getMainTreeKey()
Return the key for navigating through the main tree.
|
protected long |
getMemoryOverhead(MemoryBudget mb) |
void |
incrementDuplicateCount(LockResult lockResult,
byte[] key,
Locker locker,
boolean increment)
Increment or decrement the DupCountLN, log the updated LN, and update
the lock result.
|
boolean |
isDbRoot() |
void |
readFromLog(java.nio.ByteBuffer itemBuffer,
byte entryVersion)
Initialize this object from the data in itemBuf.
|
byte[] |
selectKey(byte[] mainTreeKey,
byte[] dupTreeKey) |
java.lang.String |
shortClassName() |
java.lang.String |
toString()
Default toString method at the root of the tree.
|
void |
updateDupCountLN(Node target)
Assign the Dup Count LN node.
|
void |
updateDupCountLNRef(long newLsn)
Update dup count LSN.
|
void |
updateDupCountLNRefAndNullTarget(long newLsn)
Update Dup Count LN.
|
void |
writeToLog(java.nio.ByteBuffer logBuffer)
Serialize this object into the buffer.
|
afterLog, canBeAncestor, clearLsn, clearPendingDeleted, compareTo, compress, computeArraysOverhead, deleteEntry, descendOnParentSearch, dumpLog, equals, fetchTarget, findEntry, getBudgetedMemorySize, getDatabase, getDatabaseId, getDirty, getEntryInMemorySize, getEvictionType, getGeneration, getIdentifierKey, getInListResident, getInMemorySize, getKey, getLastFullVersion, getLevel, getLsn, getMigrate, getNEntries, getRecalcToggle, getState, getTarget, getTreeAdminMemorySize, hashCode, init, initMemorySize, insertEntry, insertEntry1, isCompressible, isEntryKnownDeleted, isEntryPendingDeleted, isEvictable, isKeyInBounds, isLatchOwnerForRead, isLatchOwnerForWrite, isRoot, isSoughtNode, latch, latch, latchNoWait, latchNoWait, latchShared, latchShared, log, log, log, logDirtyChildren, logicalEquals, needsSplitting, optionalLog, optionalLogProvisional, postFetchInit, postRecoveryInit, releaseLatch, releaseLatchIfOwner, setDatabase, setDirty, setEntry, setGeneration, setGeneration, setInListResident, setMigrate, setPendingDeleted, setProhibitNextDelta, setRecalcToggle, splitInternal, updateEntry, updateEntry, updateEntry, updateMemorySize, updateMemorySize, updateNode, updateNode, updateNode, verify, verifyMemorySize
dump, getMemorySizeIncludedByParent, getNodeId, getTransactionId, getType, shortDescription
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getTransactionId
public DIN()
public DIN(DatabaseImpl db, byte[] identifierKey, int capacity, byte[] dupKey, ChildReference dupCountLNRef, int level)
protected int generateLevel(DatabaseId dbId, int newLevel)
generateLevel
in class IN
protected IN createNewInstance(byte[] identifierKey, int maxEntries, int level)
createNewInstance
in class IN
public byte[] getDupKey()
public byte[] getChildKey(IN child) throws DatabaseException
getChildKey
in class IN
DatabaseException
public byte[] selectKey(byte[] mainTreeKey, byte[] dupTreeKey)
public byte[] getDupTreeKey()
getDupTreeKey
in class IN
public byte[] getMainTreeKey()
getMainTreeKey
in class IN
public ChildReference getDupCountLNRef()
public DupCountLN getDupCountLN() throws DatabaseException
DatabaseException
public void updateDupCountLN(Node target)
public void updateDupCountLNRefAndNullTarget(long newLsn)
public void updateDupCountLNRef(long newLsn)
public boolean containsDuplicates()
containsDuplicates
in class Node
public final java.util.Comparator<byte[]> getKeyComparator()
getKeyComparator
in class IN
public void incrementDuplicateCount(LockResult lockResult, byte[] key, Locker locker, boolean increment) throws DatabaseException
DatabaseException
protected long computeMemorySize()
computeMemorySize
in class IN
public static long computeOverhead(DbConfigManager configManager) throws DatabaseException
DatabaseException
protected long getMemoryOverhead(MemoryBudget mb)
getMemoryOverhead
in class IN
public LogEntryType getLogType()
getLogType
in class IN
Node.getLogType()
public void beforeLog(LogManager logManager, INLogItem item, INLogContext context) throws DatabaseException
beforeLog
in class IN
DatabaseException
public int getLogSize()
getLogSize
in interface Loggable
getLogSize
in class IN
IN.getLogSize()
public void writeToLog(java.nio.ByteBuffer logBuffer)
Loggable
writeToLog
in interface Loggable
writeToLog
in class IN
logBuffer
- is the destination bufferIN.writeToLog(java.nio.ByteBuffer)
public void readFromLog(java.nio.ByteBuffer itemBuffer, byte entryVersion) throws LogException
Loggable
readFromLog
in interface Loggable
readFromLog
in class IN
LogException
IN.readFromLog(java.nio.ByteBuffer, byte)
protected void dumpLogAdditional(java.lang.StringBuffer sb)
dumpLogAdditional
in class IN
public java.lang.String dumpString(int nSpaces, boolean dumpTags)
dumpString
in class IN
public java.lang.String toString()
Node
public java.lang.String shortClassName()
shortClassName
in class IN