K - the type of the key stored in Near CacheV - the type of the value stored in Near Cachepublic class HeapNearCacheRecordMap<K,V extends NearCacheRecord> extends SampleableConcurrentHashMap<K,V> implements SampleableNearCacheRecordMap<K,V>
SampleableNearCacheRecordMap implementation for on-heap Near Caches.| Modifier and Type | Class and Description |
|---|---|
class |
HeapNearCacheRecordMap.NearCacheEvictableSamplingEntry |
SampleableConcurrentHashMap.SamplingEntry<K,V>ConcurrentReferenceHashMap.Option, ConcurrentReferenceHashMap.ReferenceType, ConcurrentReferenceHashMap.SimpleEntry<K,V>, ConcurrentReferenceHashMap.WriteThroughEntryAbstractMap.SimpleImmutableEntry<K,V>| Modifier and Type | Method and Description |
|---|---|
protected <E extends SampleableConcurrentHashMap.SamplingEntry> |
createSamplingEntry(K key,
V value) |
Iterable<HeapNearCacheRecordMap.NearCacheEvictableSamplingEntry> |
sample(int sampleCount)
The sample method is used to sample a number of entries (defined by the samples parameter) from
the internal data structure.
|
<C extends EvictionCandidate<K,V>> |
tryEvict(C evictionCandidate,
EvictionListener<K,V> evictionListener)
The evict method is called by the
EvictionStrategy to eventually evict, by the policy, selected
candidate from the internal data structures. |
fetchEntries, fetchKeys, getRandomSamples, isValidForFetching, isValidForSamplingapplyIfAbsent, applyIfPresent, clear, contains, containsKey, containsValue, elements, entrySet, get, isEmpty, keys, keySet, purgeStaleEntries, put, putAll, putIfAbsent, remove, remove, replace, replace, size, valuesclone, equals, hashCode, toStringfinalize, getClass, notify, notifyAll, wait, wait, waitcompute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAllprotected <E extends SampleableConcurrentHashMap.SamplingEntry> E createSamplingEntry(K key, V value)
createSamplingEntry in class SampleableConcurrentHashMap<K,V extends NearCacheRecord>public <C extends EvictionCandidate<K,V>> boolean tryEvict(C evictionCandidate, EvictionListener<K,V> evictionListener)
EvictableStoreEvictionStrategy to eventually evict, by the policy, selected
candidate from the internal data structures.
It could be the selected evicted candidate cannot be evicted. For example it might be gone at the time when
the method is executed. In this case it will indicate this condition by returning false.tryEvict in interface EvictableStore<K,V extends NearCacheRecord>evictionCandidate - EvictionCandidate to be evictedevictionListener - EvictionListener to listen evicted entriestrue if the candidate was evicted, otherwise returns falsepublic Iterable<HeapNearCacheRecordMap.NearCacheEvictableSamplingEntry> sample(int sampleCount)
SampleableEvictableStoresample in interface SampleableEvictableStore<K,V extends NearCacheRecord>sampleCount - Entry count to be sampledEvictionCandidate to be evictedCopyright © 2019 Hazelcast, Inc.. All Rights Reserved.