|
|||||||||
| 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.BIN
public class BIN
A BIN represents a Bottom 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 | |
|---|---|
BIN()
|
|
BIN(DatabaseImpl db,
byte[] identifierKey,
int maxEntriesPerNode,
int level)
|
|
| Method Summary | |
|---|---|
(package private) void |
accumulateStats(TreeWalkerStatsAccumulator acc)
|
void |
addCursor(CursorImpl cursor)
Register a cursor with this BIN. |
(package private) void |
adjustCursors(IN newSibling,
int newSiblingLow,
int newSiblingHigh)
Adjust any cursors that are referring to this BIN. |
(package private) void |
adjustCursorsForInsert(int insertIndex)
Adjust cursors referring to this BIN following an insert. |
(package private) void |
adjustCursorsForMutation(int binIndex,
DBIN dupBin,
int dupBinIndex,
CursorImpl excludeCursor)
Adjust cursors referring to the given binIndex in this BIN following a mutation of the entry from an LN to a DIN. |
void |
afterLog(LogManager logManager,
INLogItem item,
INLogContext context)
Post-log processing. |
void |
beforeLog(LogManager logManager,
INLogItem item,
INLogContext context)
Pre-log processing. |
String |
beginTag()
|
protected boolean |
canBeAncestor(boolean targetContainsDuplicates)
|
void |
clearKnownDeleted(int index)
Clear the known deleted flag. |
boolean |
compress(BINReference binRef,
boolean canFetch,
LocalUtilizationTracker localTracker)
Compress this BIN by removing any entries that are deleted. |
static long |
computeOverhead(DbConfigManager configManager)
|
boolean |
containsCursor(CursorImpl cursor)
For assertions in CursorImpl. |
protected IN |
createNewInstance(byte[] identifierKey,
int maxEntries,
int level)
Create a new BIN. |
BINReference |
createReference()
Create a holder object that encapsulates information about this BIN for the INCompressor. |
protected void |
descendOnParentSearch(SearchResult result,
boolean targetContainsDuplicates,
boolean targetIsRoot,
long targetNodeId,
Node child,
boolean requireExactMatch)
|
String |
endTag()
|
(package private) boolean |
entryZeroKeyComparesLow()
Indicates whether entry 0's key is "special" in that it always compares less than any other key. |
void |
evictLN(int index)
Evict a single LN if allowed and adjust the memory budget. |
long |
evictLNs()
Reduce memory consumption by evicting all LN targets. |
Node |
fetchTarget(int idx)
We require exclusive latches on a BIN, so this method does not need to declare that it throws RelatchRequiredException. |
(package private) LogEntryType |
getBINDeltaType()
|
(package private) int |
getChildEvictionType()
Note that the IN may or may not be latched when this method is called. |
byte[] |
getChildKey(IN child)
Get the key (dupe or identifier) in child that is used to locate it in 'this' node. |
(package private) BIN |
getCursorBIN(CursorImpl cursor)
The following four methods access the correct fields in a cursor depending on whether "this" is a BIN or DBIN. |
(package private) BIN |
getCursorBINToBeRemoved(CursorImpl cursor)
|
(package private) int |
getCursorIndex(CursorImpl cursor)
|
Set<CursorImpl> |
getCursorSet()
|
Comparator<byte[]> |
getKeyComparator()
Return the relevant user defined comparison function for this type of node. |
long |
getLastDeltaVersion()
|
LogEntryType |
getLogType()
|
protected long |
getMemoryOverhead(MemoryBudget mb)
|
long |
getTreeAdminMemorySize()
Returns the treeAdmin memory in objects referenced by this BIN. |
(package private) boolean |
hasPinnedChildren()
Note that the IN may or may not be latched when this method is called. |
void |
incEvictStats(Evictor.EvictionSource source)
We categorize eviction stats by the type of IN, so IN subclasses update different stats. |
void |
incFetchStats(EnvironmentImpl envImpl,
boolean isMiss)
We categorize fetch stats by the type of node, so node subclasses update different stats. |
(package private) boolean |
isAlwaysLatchedExclusively()
|
(package private) boolean |
isBottomMostNode()
|
boolean |
isCompressible()
|
(package private) boolean |
isEvictionProhibited()
Note that the IN may or may not be latched when this method is called. |
(package private) boolean |
isValidForDelete()
Check if this node fits the qualifications for being part of a deletable subtree. |
void |
logDirtyChildren()
When splits and checkpoints intermingle in a deferred write databases, a checkpoint target may appear which has a valid target but a null LSN. |
int |
nCursors()
|
void |
removeCursor(CursorImpl cursor)
Unregister a cursor with this bin. |
(package private) void |
setCursorBIN(CursorImpl cursor,
BIN bin)
|
(package private) void |
setCursorIndex(CursorImpl cursor,
int index)
|
void |
setKnownDeleted(int index)
Mark this entry as deleted, using the delete flag. |
void |
setKnownDeletedClearAll(int index)
|
void |
setKnownDeletedLeaveTarget(int index)
Mark this entry as deleted, using the delete flag. |
void |
setProhibitNextDelta()
If cleaned or compressed, must log full version. |
String |
shortClassName()
|
(package private) void |
splitSpecial(IN parent,
int parentIndex,
int maxEntriesPerNode,
byte[] key,
boolean leftSide,
CacheMode cacheMode)
Called when we know we are about to split on behalf of a key that is the minimum (leftSide) or maximum (!leftSide) of this node. |
(package private) boolean |
validateSubtreeBeforeDelete(int index)
|
void |
verifyCursors()
For each cursor in this BIN's cursor set, ensure that the cursor is actually referring to this BIN. |
| Methods inherited from class com.sleepycat.je.tree.Node |
|---|
containsDuplicates, dump, getMemorySizeIncludedByParent, getNodeId, getTransactionId, getType, matchLNByNodeId, 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 |
|---|
dumpLog, getLogSize, getTransactionId, logicalEquals, readFromLog, writeToLog |
| Constructor Detail |
|---|
public BIN()
public BIN(DatabaseImpl db,
byte[] identifierKey,
int maxEntriesPerNode,
int level)
| Method Detail |
|---|
public BINReference createReference()
protected IN createNewInstance(byte[] identifierKey,
int maxEntries,
int level)
createNewInstance in class INboolean isAlwaysLatchedExclusively()
isAlwaysLatchedExclusively in class INboolean isBottomMostNode()
isBottomMostNode in class INpublic byte[] getChildKey(IN child)
getChildKey in class INLogEntryType getBINDeltaType()
public long getLastDeltaVersion()
public void setProhibitNextDelta()
setProhibitNextDelta in class IN
protected void descendOnParentSearch(SearchResult result,
boolean targetContainsDuplicates,
boolean targetIsRoot,
long targetNodeId,
Node child,
boolean requireExactMatch)
throws DatabaseException
descendOnParentSearch in class INDatabaseExceptionprotected boolean canBeAncestor(boolean targetContainsDuplicates)
canBeAncestor in class INboolean isEvictionProhibited()
isEvictionProhibited in class INboolean hasPinnedChildren()
hasPinnedChildren in class INint getChildEvictionType()
getChildEvictionType in class INboolean entryZeroKeyComparesLow()
entryZeroKeyComparesLow in class INpublic void setKnownDeleted(int index)
setKnownDeleted in class INindex - indicates target entrypublic void setKnownDeletedLeaveTarget(int index)
index - indicates target entrypublic void setKnownDeletedClearAll(int index)
public void clearKnownDeleted(int index)
clearKnownDeleted in class INindex - indicates target entrypublic static long computeOverhead(DbConfigManager configManager)
protected long getMemoryOverhead(MemoryBudget mb)
getMemoryOverhead in class INpublic long getTreeAdminMemorySize()
getTreeAdminMemorySize in class INpublic Set<CursorImpl> getCursorSet()
public void addCursor(CursorImpl cursor)
cursor - Cursor to register.public void removeCursor(CursorImpl cursor)
cursor - Cursor to unregister.public boolean containsCursor(CursorImpl cursor)
public int nCursors()
BIN getCursorBIN(CursorImpl cursor)
BIN getCursorBINToBeRemoved(CursorImpl cursor)
int getCursorIndex(CursorImpl cursor)
void setCursorBIN(CursorImpl cursor,
BIN bin)
void setCursorIndex(CursorImpl cursor,
int index)
void splitSpecial(IN parent,
int parentIndex,
int maxEntriesPerNode,
byte[] key,
boolean leftSide,
CacheMode cacheMode)
throws DatabaseException
splitSpecial in class INDatabaseException
void adjustCursors(IN newSibling,
int newSiblingLow,
int newSiblingHigh)
adjustCursors in class INnewSibling - - the newSibling into which "this" has been split.newSiblingLow, - newSiblingHigh - the low and high entry of
"this" that were moved into newSibling.public void verifyCursors()
void adjustCursorsForInsert(int insertIndex)
adjustCursorsForInsert in class INinsertIndex - - The index of the new entry.
void adjustCursorsForMutation(int binIndex,
DBIN dupBin,
int dupBinIndex,
CursorImpl excludeCursor)
binIndex - - The index of the DIN (previously LN) entry in the BIN.dupBin - - The DBIN into which the LN entry was moved.dupBinIndex - - The index of the moved LN entry in the DBIN.excludeCursor - - The cursor being used for insertion and that
should not be updated.
public boolean compress(BINReference binRef,
boolean canFetch,
LocalUtilizationTracker localTracker)
throws DatabaseException
compress in class INbinRef - is used to determine the set of keys to be checked for
deletedness, or is null to check all keys.canFetch - if false, don't fetch any non-resident children. We
don't want some callers of compress, such as the evictor, to fault in
other nodes.
DatabaseException - from subclasses.public boolean isCompressible()
isCompressible in class IN
public long evictLNs()
throws DatabaseException
DatabaseException
public void evictLN(int index)
throws DatabaseException
DatabaseExceptionboolean validateSubtreeBeforeDelete(int index)
validateSubtreeBeforeDelete in class IN
boolean isValidForDelete()
throws DatabaseException
isValidForDelete in class INDatabaseExceptionvoid accumulateStats(TreeWalkerStatsAccumulator acc)
accumulateStats in class INpublic Comparator<byte[]> getKeyComparator()
getKeyComparator in class INpublic String beginTag()
beginTag in class INpublic String endTag()
endTag in class IN
public void logDirtyChildren()
throws DatabaseException
IN
logDirtyChildren in class INDatabaseExceptionIN.logDirtyChildren();public void incEvictStats(Evictor.EvictionSource source)
IN
incEvictStats in class ININ.incEvictStats(com.sleepycat.je.evictor.Evictor.EvictionSource)
public void incFetchStats(EnvironmentImpl envImpl,
boolean isMiss)
Node
incFetchStats in class INNode.incFetchStats(com.sleepycat.je.dbi.EnvironmentImpl, boolean)public LogEntryType getLogType()
getLogType in class INNode.getLogType()public String shortClassName()
shortClassName in class IN
public void beforeLog(LogManager logManager,
INLogItem item,
INLogContext context)
throws DatabaseException
IN
beforeLog in class INDatabaseException - from subclasses.
public void afterLog(LogManager logManager,
INLogItem item,
INLogContext context)
throws DatabaseException
IN
afterLog in class INDatabaseException
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 | ||||||||