|
|||||||||
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 | |
---|---|
protected Set |
cursorSet
|
Fields inherited from class com.sleepycat.je.tree.IN |
---|
ACCUMULATED_LIMIT, DBMAP_LEVEL, EXACT_MATCH, INSERT_SUCCESS, LEVEL_MASK, MAIN_LEVEL, MAX_LEVEL, MAY_EVICT_LNS, MAY_EVICT_NODE, MAY_NOT_EVICT, MIN_LEVEL |
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. |
String |
beginTag()
|
protected boolean |
canBeAncestor(boolean targetContainsDuplicates)
|
void |
clearKnownDeleted(int index)
Clear the known deleted flag. |
boolean |
compress(BINReference binRef,
boolean canFetch)
Compress this BIN by removing any entries that are deleted. |
static long |
computeOverhead(DbConfigManager configManager)
|
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. |
LogEntryType |
getBINDeltaType()
|
(package private) int |
getChildEvictionType()
Returns the eviction type based on the status of child nodes, irrespective of isEvictionProhibited. |
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 |
getCursorSet()
|
Comparator |
getKeyComparator()
Return the relevant user defined comparison function for this type of node. |
long |
getLastDeltaVersion()
|
LogEntryType |
getLogType()
All objects that are reponsible for a generating a type of log entry must implement this. |
protected long |
getMemoryOverhead(MemoryBudget mb)
|
(package private) boolean |
hasNonLNChildren()
Returns whether any resident children are not LNs (are INs). |
boolean |
isCompressible()
|
(package private) boolean |
isEvictionProhibited()
Returns whether the node is not evictable, irrespective of the status of the children nodes. |
(package private) boolean |
isValidForDelete()
Check if this node fits the qualifications for being part of a deletable subtree. |
protected long |
logInternal(LogManager logManager,
boolean allowDeltas,
boolean isProvisional,
boolean allowMigration,
IN parent)
Decide how to log this node. |
int |
nCursors()
|
void |
removeCursor(CursorImpl cursor)
Unregister a cursor with this bin. |
void |
setCleanedSinceLastLog()
If cleaned, must log full version. |
protected void |
setCompressedSinceLastLog()
If compressed, must log full version. |
(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 |
setKnownDeletedLeaveTarget(int index)
Mark this entry as deleted, using the delete flag. |
String |
shortClassName()
|
(package private) void |
splitSpecial(IN parent,
int parentIndex,
int maxEntriesPerNode,
byte[] key,
boolean leftSide)
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, countAsObsoleteWhenLogged, dump, getLastId, getMemorySizeIncludedByParent, getNextNodeId, getNodeId, getType, marshallOutsideWriteLatch, matchLNByNodeId, postLogWork, setLastNodeId, 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.LoggableObject |
---|
countAsObsoleteWhenLogged, marshallOutsideWriteLatch, postLogWork |
Methods inherited from interface com.sleepycat.je.log.LogWritable |
---|
getLogSize, writeToLog |
Field Detail |
---|
protected Set cursorSet
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 IN
public byte[] getChildKey(IN child) throws DatabaseException
getChildKey
in class IN
DatabaseException
public LogEntryType getBINDeltaType()
public long getLastDeltaVersion()
protected void setCompressedSinceLastLog()
setCompressedSinceLastLog
in class IN
public void setCleanedSinceLastLog()
setCleanedSinceLastLog
in class IN
protected void descendOnParentSearch(SearchResult result, boolean targetContainsDuplicates, boolean targetIsRoot, long targetNodeId, Node child, boolean requireExactMatch) throws DatabaseException
descendOnParentSearch
in class IN
DatabaseException
protected boolean canBeAncestor(boolean targetContainsDuplicates)
canBeAncestor
in class IN
boolean isEvictionProhibited()
IN
isEvictionProhibited
in class IN
boolean hasNonLNChildren()
IN
hasNonLNChildren
in class IN
int getChildEvictionType()
IN
getChildEvictionType
in class IN
boolean entryZeroKeyComparesLow()
entryZeroKeyComparesLow
in class IN
public void setKnownDeleted(int index)
setKnownDeleted
in class IN
index
- indicates target entrypublic void setKnownDeletedLeaveTarget(int index)
index
- indicates target entrypublic void clearKnownDeleted(int index)
clearKnownDeleted
in class IN
index
- indicates target entrypublic static long computeOverhead(DbConfigManager configManager) throws DatabaseException
DatabaseException
protected long getMemoryOverhead(MemoryBudget mb)
getMemoryOverhead
in class IN
public Set getCursorSet()
public void addCursor(CursorImpl cursor)
cursor
- Cursor to register.public void removeCursor(CursorImpl cursor)
cursor
- Cursor to unregister.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) throws DatabaseException
splitSpecial
in class IN
DatabaseException
void adjustCursors(IN newSibling, int newSiblingLow, int newSiblingHigh)
adjustCursors
in class IN
newSibling
- - 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 IN
insertIndex
- - 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) throws DatabaseException
compress
in class IN
binRef
- 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
public boolean isCompressible()
isCompressible
in class IN
public long evictLNs() throws DatabaseException
DatabaseException
public void evictLN(int index) throws DatabaseException
DatabaseException
boolean validateSubtreeBeforeDelete(int index) throws DatabaseException
validateSubtreeBeforeDelete
in class IN
DatabaseException
boolean isValidForDelete() throws DatabaseException
isValidForDelete
in class IN
DatabaseException
void accumulateStats(TreeWalkerStatsAccumulator acc)
accumulateStats
in class IN
public Comparator getKeyComparator()
getKeyComparator
in class IN
public String beginTag()
beginTag
in class IN
public String endTag()
endTag
in class IN
public LogEntryType getLogType()
LoggableObject
getLogType
in interface LoggableObject
getLogType
in class IN
LoggableObject.getLogType()
public String shortClassName()
shortClassName
in class IN
protected long logInternal(LogManager logManager, boolean allowDeltas, boolean isProvisional, boolean allowMigration, IN parent) throws DatabaseException
logInternal
in class IN
DatabaseException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |