R - type of the HiDensityRecord to be storedpublic class EvictableHiDensityRecordMap<R extends HiDensityRecord & com.hazelcast.internal.eviction.Evictable & com.hazelcast.internal.eviction.Expirable> extends DefaultHiDensityRecordMap<R> implements com.hazelcast.internal.eviction.EvictableStore<com.hazelcast.nio.serialization.Data,R>, com.hazelcast.internal.eviction.EvictionListener<com.hazelcast.nio.serialization.Data,R>
SampleableElasticHashMap.IterableSamplingEntry, SampleableElasticHashMap.SamplingEntryBinaryElasticHashMap.KeyIter, BinaryElasticHashMap.MapEntry, BinaryElasticHashMap.RandomKeyIter, BinaryElasticHashMap.RandomValueIter, BinaryElasticHashMap.ValueIter| Modifier and Type | Field and Description |
|---|---|
protected Iterator<Map.Entry<com.hazelcast.nio.serialization.Data,R>> |
expirationIterator |
protected NativeMemoryData |
keyHolder |
protected static int |
MIN_EVICTION_ELEMENT_COUNT |
protected static int |
ONE_HUNDRED_PERCENT |
recordProcessor, storageInfoaccessor, HEADER_LENGTH_IN_BYTES, memoryBlockProcessor| Constructor and Description |
|---|
EvictableHiDensityRecordMap(int initialCapacity,
HiDensityRecordProcessor<R> recordProcessor,
HiDensityStorageInfo storageInfo) |
| Modifier and Type | Method and Description |
|---|---|
<C extends com.hazelcast.internal.eviction.EvictionCandidate<com.hazelcast.nio.serialization.Data,R>> |
forceEvict(int evictionPercentage,
com.hazelcast.internal.eviction.EvictionListener<com.hazelcast.nio.serialization.Data,R> evictionListener)
Forcefully evict records with the given
evictionPercentage. |
void |
onEvict(com.hazelcast.nio.serialization.Data evictedEntryAccessor,
R evictedEntry,
boolean wasExpired) |
void |
scanByNumberToDeleteExpired(com.hazelcast.internal.eviction.EvictionListener<com.hazelcast.nio.serialization.Data,R> evictionListener,
com.hazelcast.internal.eviction.ExpirationChecker<R> expirationChecker,
int maxScannableNum)
Scans entries to delete expired ones.
|
<C extends com.hazelcast.internal.eviction.EvictionCandidate<com.hazelcast.nio.serialization.Data,R>> |
tryEvict(C evictionCandidate,
com.hazelcast.internal.eviction.EvictionListener<com.hazelcast.nio.serialization.Data,R> evictionListener) |
clear, decreaseEntryCount, decreaseEntryCount, delete, increaseEntryCount, iterator, onOome, put, putIfAbsent, remove, remove, setcreateSamplingEntry, getRandomSamplescapacity, containsKey, containsValue, dispose, entryIter, entryIter, entrySet, get, getIfSameKey, getNativeKeyAddress, isEmpty, keyIter, keySet, loadFromOffHeapHeader, newRandomEvictionKeyIterator, newRandomEvictionValueIterator, putAll, readV, replace, replace, size, storeHeaderOffHeap, toString, valueIter, valueIter, valuesclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcompute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, putAll, replace, replace, replaceAll, size, valuesprotected static final int ONE_HUNDRED_PERCENT
protected static final int MIN_EVICTION_ELEMENT_COUNT
protected Iterator<Map.Entry<com.hazelcast.nio.serialization.Data,R extends HiDensityRecord & com.hazelcast.internal.eviction.Evictable & com.hazelcast.internal.eviction.Expirable>> expirationIterator
protected final NativeMemoryData keyHolder
public EvictableHiDensityRecordMap(int initialCapacity,
HiDensityRecordProcessor<R> recordProcessor,
HiDensityStorageInfo storageInfo)
public <C extends com.hazelcast.internal.eviction.EvictionCandidate<com.hazelcast.nio.serialization.Data,R>> int forceEvict(int evictionPercentage, com.hazelcast.internal.eviction.EvictionListener<com.hazelcast.nio.serialization.Data,R> evictionListener)
evictionPercentage.evictionPercentage - percentage to determine how many records will be evictedevictionListener - EvictionListener to be notified about evicted key and valuepublic void scanByNumberToDeleteExpired(com.hazelcast.internal.eviction.EvictionListener<com.hazelcast.nio.serialization.Data,R> evictionListener, com.hazelcast.internal.eviction.ExpirationChecker<R> expirationChecker, int maxScannableNum)
expirationIterator is used for this scanning.evictionListener - used to listen evicted entriesexpirationChecker - used to check entries for expirymaxScannableNum - scan at most this number of entriesinitExpirationIterator()public <C extends com.hazelcast.internal.eviction.EvictionCandidate<com.hazelcast.nio.serialization.Data,R>> boolean tryEvict(C evictionCandidate, com.hazelcast.internal.eviction.EvictionListener<com.hazelcast.nio.serialization.Data,R> evictionListener)
tryEvict in interface com.hazelcast.internal.eviction.EvictableStore<com.hazelcast.nio.serialization.Data,R extends HiDensityRecord & com.hazelcast.internal.eviction.Evictable & com.hazelcast.internal.eviction.Expirable>public void onEvict(com.hazelcast.nio.serialization.Data evictedEntryAccessor,
R evictedEntry,
boolean wasExpired)
onEvict in interface com.hazelcast.internal.eviction.EvictionListener<com.hazelcast.nio.serialization.Data,R extends HiDensityRecord & com.hazelcast.internal.eviction.Evictable & com.hazelcast.internal.eviction.Expirable>Copyright © 2020 Hazelcast, Inc.. All Rights Reserved.