|
|||||||||
| 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.IN
com.sleepycat.je.tree.DIN
public final class DIN
An DIN represents an Duplicate Internal Node in the JE tree.
| Field Summary |
|---|
| Fields inherited from class com.sleepycat.je.tree.IN |
|---|
ACCUMULATED_LIMIT, BIN_LEVEL, databaseImpl, DBMAP_LEVEL, EXACT_MATCH, INSERT_SUCCESS, latch, LEVEL_MASK, MAIN_LEVEL, MAX_LEVEL, MAY_EVICT_LNS, MAY_EVICT_NODE, MAY_NOT_EVICT, MIN_LEVEL |
| Fields inherited from class com.sleepycat.je.tree.Node |
|---|
NULL_NODE_ID |
| Constructor Summary | |
|---|---|
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. |
|
| Method Summary | |
|---|---|
(package private) void |
accumulateStats(TreeWalkerStatsAccumulator acc)
|
void |
beforeLog(LogManager logManager,
INLogItem item,
INLogContext context)
Handles lazy migration of DupCountLNs prior to logging a DIN. |
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(StringBuilder sb)
DINS need to dump their dup key |
String |
dumpString(int nSpaces,
boolean dumpTags)
For unit test support: |
String |
endTag()
|
Node |
fetchTarget(int idx)
We require exclusive latches on a DIN, so this method does not need to declare that it throws RelatchRequiredException. |
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. |
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. |
(package private) boolean |
isAlwaysLatchedExclusively()
|
boolean |
isDbRoot()
|
(package private) boolean |
matchLNByNodeId(TreeLocation location,
long nodeId,
CacheMode cacheMode)
|
void |
readFromLog(ByteBuffer itemBuffer,
int entryVersion)
Initialize this object from the data in itemBuf. |
byte[] |
selectKey(byte[] mainTreeKey,
byte[] dupTreeKey)
|
(package private) void |
setDupCountLN(ChildReference dupCountLNRef)
Assign the Dup Count LN. |
String |
shortClassName()
|
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(ByteBuffer logBuffer)
Serialize this object into the buffer. |
| Methods inherited from class com.sleepycat.je.tree.Node |
|---|
dump, getMemorySizeIncludedByParent, getNodeId, getTransactionId, getType, setNodeId, shortDescription |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.sleepycat.je.log.Loggable |
|---|
getTransactionId |
| Constructor Detail |
|---|
public DIN()
public DIN(DatabaseImpl db,
byte[] identifierKey,
int capacity,
byte[] dupKey,
ChildReference dupCountLNRef,
int level)
| Method Detail |
|---|
protected int generateLevel(DatabaseId dbId,
int newLevel)
generateLevel in class IN
protected IN createNewInstance(byte[] identifierKey,
int maxEntries,
int level)
createNewInstance in class INboolean isAlwaysLatchedExclusively()
isAlwaysLatchedExclusively in class INpublic byte[] getDupKey()
getDupKey in class INpublic byte[] getChildKey(IN child)
getChildKey in class IN
public byte[] selectKey(byte[] mainTreeKey,
byte[] dupTreeKey)
selectKey in class INpublic byte[] getDupTreeKey()
getDupTreeKey in class INpublic byte[] getMainTreeKey()
getMainTreeKey in class INpublic ChildReference getDupCountLNRef()
public DupCountLN getDupCountLN()
throws DatabaseException
DatabaseExceptionvoid setDupCountLN(ChildReference dupCountLNRef)
public void updateDupCountLN(Node target)
public void updateDupCountLNRefAndNullTarget(long newLsn)
public void updateDupCountLNRef(long newLsn)
public boolean containsDuplicates()
containsDuplicates in class Nodepublic boolean isDbRoot()
isDbRoot in class INpublic final Comparator<byte[]> getKeyComparator()
getKeyComparator in class IN
public void incrementDuplicateCount(LockResult lockResult,
byte[] key,
Locker locker,
boolean increment)
throws DatabaseException
DatabaseExceptionprotected long computeMemorySize()
computeMemorySize in class INpublic static long computeOverhead(DbConfigManager configManager)
protected long getMemoryOverhead(MemoryBudget mb)
getMemoryOverhead in class IN
boolean matchLNByNodeId(TreeLocation location,
long nodeId,
CacheMode cacheMode)
throws DatabaseException
matchLNByNodeId in class NodeDatabaseExceptionvoid accumulateStats(TreeWalkerStatsAccumulator acc)
accumulateStats in class INpublic LogEntryType getLogType()
getLogType in class INNode.getLogType()
public void beforeLog(LogManager logManager,
INLogItem item,
INLogContext context)
throws DatabaseException
beforeLog in class INDatabaseException - from subclasses.public int getLogSize()
getLogSize in interface LoggablegetLogSize in class ININ.getLogSize()public void writeToLog(ByteBuffer logBuffer)
Loggable
writeToLog in interface LoggablewriteToLog in class INlogBuffer - is the destination bufferIN.writeToLog(java.nio.ByteBuffer)
public void readFromLog(ByteBuffer itemBuffer,
int entryVersion)
Loggable
readFromLog in interface LoggablereadFromLog in class ININ.readFromLog(java.nio.ByteBuffer, int)protected void dumpLogAdditional(StringBuilder sb)
dumpLogAdditional in class INpublic String beginTag()
beginTag in class INpublic String endTag()
endTag in class IN
public String dumpString(int nSpaces,
boolean dumpTags)
dumpString in class INpublic String toString()
Node
toString in class INpublic String shortClassName()
shortClassName in class IN
public Node fetchTarget(int idx)
throws DatabaseException
fetchTarget in class INDatabaseException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||