public class FullPageIdTable extends Object implements LoadedPagesMap
LoadedPagesMap.KeyPredicate| Modifier and Type | Field and Description |
|---|---|
protected int |
capacity
Max size, in elements.
|
protected int |
maxSteps
Maximum number of steps to try before failing.
|
protected long |
valPtr
Pointer to the values array.
|
| Constructor and Description |
|---|
FullPageIdTable(long addr,
long len,
boolean clear) |
| Modifier and Type | Method and Description |
|---|---|
int |
capacity() |
void |
clear() |
int |
distanceFromIdeal(int cacheId,
long pageId,
int tag)
Gets distance from the ideal key location to the actual location if this entry is present in the table,
or returns negative distance that needed to be scanned to determine the absence of the mapping.
|
void |
forEach(BiConsumer<FullPageId,Long> act)
Scans all the elements in this table.
|
long |
get(int grpId,
long pageId,
int reqVer,
long absent,
long outdated)
Gets value associated with the given key.
|
ReplaceCandidate |
getNearestAt(int idxStart)
Find nearest presented value from specified position to the right.
|
void |
put(int grpId,
long pageId,
long val,
int ver)
Associates the given key with the given value.
|
long |
refresh(int grpId,
long pageId,
int ver)
Refresh outdated value.
|
boolean |
remove(int grpId,
long pageId)
Removes key-value association for the given key.
|
GridLongList |
removeIf(int startIdxToClear,
int endIdxToClear,
LoadedPagesMap.KeyPredicate keyPred)
Removes entities matching provided predicate at specified mapping range.
|
static long |
requiredMemory(long elementCnt) |
int |
size() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitremoveIfprotected int capacity
protected int maxSteps
protected long valPtr
public FullPageIdTable(long addr,
long len,
boolean clear)
addr - Base address.len - Allocated memory length.clear - If true, then memory is considered dirty and will be cleared. Otherwise,
map will assume that the given memory region is in valid state.public static long requiredMemory(long elementCnt)
public final int size()
size in interface LoadedPagesMappublic final int capacity()
capacity in interface LoadedPagesMappublic long get(int grpId,
long pageId,
int reqVer,
long absent,
long outdated)
get in interface LoadedPagesMapgrpId - Cache Group ID. First part of the key.pageId - Page ID. Second part of the key.reqVer - Requested entry version, counter associated with value.absent - return if provided page is not presented in map.outdated - return if provided reqVer version is greater than value in map (was used for put).public long refresh(int grpId,
long pageId,
int ver)
LoadedPagesMap.get(int, long, int, long, long) returned outdated return value.refresh in interface LoadedPagesMapgrpId - First part of the key. Cache Group ID.pageId - Second part of the key. Page ID.ver - Partition tag.public void put(int grpId,
long pageId,
long val,
int ver)
put in interface LoadedPagesMapgrpId - Cache Group ID. First part of the key.pageId - Page ID. Second part of the key.val - Value to set.ver - Version/counter associated with value, can be used to check if value is outdated.public boolean remove(int grpId,
long pageId)
remove in interface LoadedPagesMapgrpId - First part of the key. Cache Group ID.pageId - Second part of the key. Page ID.True if value was actually found and removed.public ReplaceCandidate getNearestAt(int idxStart)
getNearestAt in interface LoadedPagesMapidxStart - Index to start searching from. Bounded with LoadedPagesMap.capacity().null value that will
be returned if no values present.public GridLongList removeIf(int startIdxToClear, int endIdxToClear, LoadedPagesMap.KeyPredicate keyPred)
removeIf in interface LoadedPagesMapstartIdxToClear - Index to clear value at, inclusive. Bounded with LoadedPagesMap.capacity().endIdxToClear - Index to clear value at, inclusive. Bounded with LoadedPagesMap.capacity().keyPred - Test predicate for (cache group ID, page ID).public int distanceFromIdeal(int cacheId,
long pageId,
int tag)
cacheId - Cache ID.pageId - Page ID.tag - Tag.public void forEach(BiConsumer<FullPageId,Long> act)
forEach in interface LoadedPagesMapact - Visitor/action to be applied to each not empty cell.public void clear()
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.7.5 Release Date : June 4 2019