public class BIN extends IN
| Modifier and Type | Field and Description |
|---|---|
static boolean |
TEST_NO_LAST_LOGGED_SIZES
Can be set to true by tests to prevent last logged sizes from being
stored.
|
ACCUMULATED_LIMIT, ACCUMULATED_LIMIT_DEFAULT, BIN_LEVEL, DBMAP_LEVEL, disableCompactLsns, EXACT_MATCH, INSERT_SUCCESS, LEVEL_MASK, MAIN_LEVEL, MAX_FILE_OFFSET, MIN_LEVEL, NON_EVICTABLE_INNULL_NODE_ID| Constructor and Description |
|---|
BIN() |
BIN(DatabaseImpl db,
byte[] identifierKey,
int capacity,
int level) |
BIN(SizeofMarker marker)
For Sizeof.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addCursor(CursorImpl cursor)
Register a cursor with this BIN.
|
String |
beginTag() |
boolean |
canMutateToBINDelta()
Returns whether mutateToBINDelta can be called.
|
void |
clearLastLoggedSize(int idx)
The last logged size is not stored for UINs.
|
void |
clearOffHeapLNIds() |
BIN |
cloneBINDelta()
This method assumes that "this" BIN is a delta and creates a clone of
it.
|
long |
compactMemory()
Compacts the representation of the IN, if possible.
|
boolean |
compress(boolean compressDirtySlots,
LocalUtilizationTracker localTracker)
Compress a full BIN by removing any slots that are deleted or expired.
|
long |
computeMemorySize()
Adds vlsnCache size to computed memory size.
|
protected IN |
createNewInstance(byte[] identifierKey,
int maxEntries,
int level)
Create a new BIN.
|
BINReference |
createReference() |
long |
discardVLSNCache() |
String |
endTag() |
void |
evictLN(int index) |
void |
evictLN(int index,
boolean ifFetchedCold) |
long |
evictLNs()
Reduce memory consumption by evicting all LN targets.
|
Set<CursorImpl> |
getCursorSet() |
int |
getExpiration(int idx)
Returns the expiration time for a slot.
|
protected long |
getFixedMemoryOverhead() |
int |
getFullBinMaxEntries() |
int |
getFullBinNEntries() |
long |
getLastDeltaLsn()
Overrides the IN method to account for deltas.
|
int |
getLastLoggedSize(int idx)
The last logged size is not stored for UINs.
|
int |
getLastLoggedSizeUnconditional(int idx) |
LogEntryType |
getLogType()
Get the log type of this node.
|
long |
getOffHeapLNId(int idx) |
long |
getOffHeapLNIdsMemorySize() |
int |
getOffHeapLruId() |
long |
getVLSN(int idx,
boolean allowFetch,
CacheMode cacheMode)
Returns the VLSN.
|
INLongRep |
getVLSNCache()
For unit testing.
|
boolean |
hasExpirationValues() |
boolean |
hasOffHeapLNs() |
boolean |
isBIN() |
boolean |
isDefunct(int idx)
Returns whether the slot is known-deleted, pending-deleted, or expired.
|
boolean |
isDeleted(int idx)
Returns whether the slot is known-deleted or pending-deleted.
|
boolean |
isExpired(int idx)
Returns whether the slot is expired.
|
boolean |
isProbablyExpired(int idx) |
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.
|
boolean |
mayHaveKeyInFullBin(byte[] key) |
long |
mutateToBINDelta()
Mutate to a delta (discard non-dirty entries and resize arrays).
|
void |
mutateToFullBIN(BIN fullBIN,
boolean leaveFreeSlot)
Mutates this delta to a full BIN by applying this delta to the fullBIN
param and then replacing this BIN's contents with it.
|
void |
mutateToFullBIN(boolean leaveFreeSlot)
Fetch the full BIN and apply the deltas in this BIN to it, then use the
merged result to replace the contents of this BIN.
|
int |
nCursors() |
long |
partialEviction()
Reduce memory consumption.
|
protected long |
printMemorySize() |
void |
queueSlotDeletion(int idx)
This method is called opportunistically at certain places where a
deleted slot is observed (when the slot's PendingDeleted or KnownDeleted
flag is set), to ensure that the slot is compressed away.
|
BIN |
reconstituteBIN(DatabaseImpl dbImpl)
Create a BIN by fetching its most recent full version from the log and
applying to it the deltas in this BIN delta.
|
void |
reconstituteBIN(DatabaseImpl dbImpl,
BIN fullBIN,
boolean leaveFreeSlot)
Given a full version BIN, apply to it the deltas in this BIN delta.
|
void |
removeCursor(CursorImpl cursor)
Unregister a cursor with this bin.
|
void |
setCachedVLSN(int idx,
long vlsn) |
void |
setExpiration(int idx,
int value,
boolean hours)
Sets the expiration time for a slot in days or hours.
|
void |
setFullBinMaxEntries(int n) |
void |
setFullBinNEntries(int n) |
void |
setLastDeltaLsn(long lsn) |
void |
setLastLoggedSize(int idx,
int lastLoggedSize)
Sets last logged size if necessary.
|
void |
setOffHeapLNId(int idx,
long memId) |
void |
setOffHeapLruId(int id) |
String |
shortClassName() |
boolean |
shouldLogDelta()
Decide whether to log a full or partial BIN, depending on the ratio of
the delta size to full BIN size.
|
void |
verifyCursors()
For each cursor in this BIN's cursor set, ensure that the cursor is
actually referring to this BIN.
|
attachNode, clearOffHeapBINId, compareTo, convertKey, deleteEntry, deleteRecord, detachNode, dumpLog, dumpLogAdditional, dumpString, equals, fetchIN, fetchLN, fetchLNOrDIN, findEntry, findEntry, getBudgetedMemorySize, getCompactMaxKeyLength, getData, getDatabase, getDatabaseId, getDirty, getEnv, getEnvImplForFatalException, getFetchedCold, getFetchedColdOffHeap, getGenericLogType, getIdentifierKey, getInListResident, getInMemorySize, getKey, getKeyComparator, getKeyPrefix, getKeyVals, getKnownChildIndex, getLastFullLsn, getLastLoggedLsn, getLatchName, getLatchNWaiters, getLatchTable, getLatchTimeoutMs, getLevel, getLN, getLogSize, getLogSize, getLsn, getMaxEntries, getNDeltas, getNEntries, getNextLRUNode, getNodeId, getNormalizedLevel, getNumEmbeddedLNs, getOffHeapBINId, getOffHeapBINIdsMemorySize, getParent, getPrevLRUNode, getProhibitNextDelta, getRecalcToggle, getState, getTarget, getTargets, hasCachedChildren, hasCachedChildrenFlag, hashCode, hasKeyPrefix, hasOffHeapBINIds, haveEmbeddedData, init, insertEntry, insertEntry1, insertEntry1, insertRecord, isBINDelta, isBINDelta, isDirty, isEmbeddedLN, isEmbeddedLN, isEntryKnownDeleted, isEntryPendingDeleted, isExpirationInHours, isIN, isInPri2LRU, isKeyInBounds, isLatchExclusiveOwner, isLatchOwner, isNoDataLN, isNoDataLN, isOffHeapBINDirty, isOffHeapBINPri2, isPinned, isRoot, isUpperIN, latch, latch, latchNoUpdateLRU, latchNoUpdateLRU, latchNoWait, latchParent, latchShared, latchShared, loadIN, log, log, log, logEntry, logicalEquals, makeFetchErrorMsg, materialize, mayHaveExpirationValues, needsSplitting, pin, postFetchInit, postRecoveryInit, prepareForSlotReuse, readFromLog, readFromLog, recalcKeyPrefix, recoverIN, recoverRecord, releaseLatch, releaseLatchIfOwner, resetAndGetMemorySize, serialize, setDatabase, setDirty, setFetchedCold, setFetchedColdOffHeap, setFetchINHook, setIdentifierKey, setInListResident, setInPri2LRU, setKey, setKnownDeleted, setKnownDeletedAndEvictLN, setLastFullLsn, setLastLoggedLsn, setLsn, setNextLRUNode, setOffHeapBINId, setParent, setPendingDeleted, setPrevLRUNode, setProhibitNextDelta, setRecalcToggle, split, toSafeString, toString, unpin, updateEntry, updateLRU, updateMemoryBudget, updateMemorySize, updateRecord, updateRepCacheStats, verifyMemorySize, writeToLog, writeToLogcontainsDuplicates, dump, getMemorySizeIncludedByParent, getTransactionId, getType, isDBIN, isDIN, isLNpublic static boolean TEST_NO_LAST_LOGGED_SIZES
public BIN()
public BIN(DatabaseImpl db, byte[] identifierKey, int capacity, int level)
public BIN(SizeofMarker marker)
protected IN createNewInstance(byte[] identifierKey, int maxEntries, int level)
public BINReference createReference()
public String shortClassName()
shortClassName in class INpublic void setCachedVLSN(int idx,
long vlsn)
public long getVLSN(int idx,
boolean allowFetch,
CacheMode cacheMode)
public INLongRep getVLSNCache()
public void setLastLoggedSize(int idx,
int lastLoggedSize)
setLastLoggedSize in class INlastLoggedSize - is positive if the size is known, zero if the size
is unknown, or -1 if the size should not be changed because logging of
the LN was deferred.public void clearLastLoggedSize(int idx)
INclearLastLoggedSize in class INpublic int getLastLoggedSize(int idx)
INgetLastLoggedSize in class INpublic void setExpiration(int idx,
int value,
boolean hours)
public boolean hasExpirationValues()
public int getExpiration(int idx)
public boolean isDefunct(int idx)
public boolean isDeleted(int idx)
public boolean isExpired(int idx)
public boolean isProbablyExpired(int idx)
public int getLastLoggedSizeUnconditional(int idx)
public void setOffHeapLNId(int idx,
long memId)
public void clearOffHeapLNIds()
public long getOffHeapLNIdsMemorySize()
public long getOffHeapLNId(int idx)
public boolean hasOffHeapLNs()
public void setOffHeapLruId(int id)
public int getOffHeapLruId()
public Set<CursorImpl> getCursorSet()
public void addCursor(CursorImpl cursor)
cursor - Cursor to register.public void removeCursor(CursorImpl cursor)
cursor - Cursor to unregister.public int nCursors()
public void verifyCursors()
public boolean compress(boolean compressDirtySlots,
LocalUtilizationTracker localTracker)
localTracker - is used only for temporary DBs, and may be specified
to consolidate multiple tracking operations. If null, the tracking is
performed immediately in this method.public void queueSlotDeletion(int idx)
public long compactMemory()
INcompactMemory in class INpublic long computeMemorySize()
computeMemorySize in class INprotected long printMemorySize()
printMemorySize in class INprotected long getFixedMemoryOverhead()
getFixedMemoryOverhead in class INpublic long partialEviction()
partialEviction in class INpublic long discardVLSNCache()
public long evictLNs()
throws DatabaseException
DatabaseExceptionpublic void evictLN(int index)
public void evictLN(int index,
boolean ifFetchedCold)
throws DatabaseException
DatabaseExceptionpublic void logDirtyChildren()
throws DatabaseException
INlogDirtyChildren in class INDatabaseExceptionIN.logDirtyChildren()public LogEntryType getLogType()
INgetLogType in class ININ.getLogType()public long getLastDeltaLsn()
getLastDeltaLsn in class INpublic void setLastDeltaLsn(long lsn)
public int getFullBinNEntries()
public void setFullBinNEntries(int n)
public int getFullBinMaxEntries()
public void setFullBinMaxEntries(int n)
public boolean mayHaveKeyInFullBin(byte[] key)
public boolean shouldLogDelta()
public boolean canMutateToBINDelta()
public long mutateToBINDelta()
public BIN cloneBINDelta()
public void mutateToFullBIN(boolean leaveFreeSlot)
mutateToFullBIN in class INpublic void mutateToFullBIN(BIN fullBIN, boolean leaveFreeSlot)
public BIN reconstituteBIN(DatabaseImpl dbImpl)
public void reconstituteBIN(DatabaseImpl dbImpl, BIN fullBIN, boolean leaveFreeSlot)
leaveFreeSlot - should be true if a slot will be inserted into the
resulting full BIN, without first checking whether the full BIN must be
split, and performing the split if necessary. If this param is true, the
returned BIN will contain at least one free slot. If this param is
false, a BIN with no free slots may be returned. For example, it is
important that false is passed when a split will be performed, since if
true were passed, the BIN would grow beyond its bounds unnecessarily.Copyright © 2024. All rights reserved.