public class CacheRecordHashMap extends SampleableConcurrentHashMap<Data,CacheRecord> implements SampleableCacheRecordMap<Data,CacheRecord>
Modifier and Type | Class and Description |
---|---|
class |
CacheRecordHashMap.EvictableSamplingEntry |
SampleableConcurrentHashMap.SamplingEntry
ConcurrentReferenceHashMap.Option, ConcurrentReferenceHashMap.ReferenceType, ConcurrentReferenceHashMap.SimpleEntry<K,V>, ConcurrentReferenceHashMap.WriteThroughEntry
AbstractMap.SimpleImmutableEntry<K,V>
Constructor and Description |
---|
CacheRecordHashMap(int initialCapacity,
CacheContext cacheContext) |
CacheRecordHashMap(int initialCapacity,
float loadFactor,
int concurrencyLevel,
ConcurrentReferenceHashMap.ReferenceType keyType,
ConcurrentReferenceHashMap.ReferenceType valueType,
EnumSet<ConcurrentReferenceHashMap.Option> options,
CacheContext cacheContext) |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Removes all of the mappings from this map.
|
protected CacheRecordHashMap.EvictableSamplingEntry |
createSamplingEntry(Data key,
CacheRecord value) |
<C extends EvictionCandidate<Data,CacheRecord>> |
evict(Iterable<C> evictionCandidates,
EvictionListener<Data,CacheRecord> evictionListener)
The evict method is called by the
EvictionStrategy to eventually evict, by the policy, selected
candidates from the internal data structures. |
CacheKeyIteratorResult |
fetchNext(int nextTableIndex,
int size) |
CacheRecord |
put(Data key,
CacheRecord value)
Maps the specified key to the specified value in this table.
|
CacheRecord |
putIfAbsent(Data key,
CacheRecord value) |
CacheRecord |
remove(Object key)
Removes the key (and its corresponding value) from this map.
|
boolean |
remove(Object key,
Object value) |
Iterable<CacheRecordHashMap.EvictableSamplingEntry> |
sample(int sampleCount)
The sample method is used to sample a number of entries (defined by the samples parameter) from
the internal data structure.
|
fetch, getRandomSamples, isValidForFetching, isValidForSampling
applyIfAbsent, contains, containsKey, containsValue, elements, entrySet, get, isEmpty, keys, keySet, purgeStaleEntries, putAll, replace, replace, size, values
clone, equals, hashCode, toString
public CacheRecordHashMap(int initialCapacity, CacheContext cacheContext)
public CacheRecordHashMap(int initialCapacity, float loadFactor, int concurrencyLevel, ConcurrentReferenceHashMap.ReferenceType keyType, ConcurrentReferenceHashMap.ReferenceType valueType, EnumSet<ConcurrentReferenceHashMap.Option> options, CacheContext cacheContext)
public CacheRecord put(Data key, CacheRecord value)
ConcurrentReferenceHashMap
The value can be retrieved by calling the get method with a key that is equal to the original key.
put
in interface Map<Data,CacheRecord>
put
in class ConcurrentReferenceHashMap<Data,CacheRecord>
key
- key with which the specified value is to be associatedvalue
- value to be associated with the specified keypublic CacheRecord putIfAbsent(Data key, CacheRecord value)
ConcurrentReferenceHashMap
putIfAbsent
in interface ConcurrentMap<Data,CacheRecord>
putIfAbsent
in class ConcurrentReferenceHashMap<Data,CacheRecord>
public CacheRecord remove(Object key)
ConcurrentReferenceHashMap
remove
in interface Map<Data,CacheRecord>
remove
in class ConcurrentReferenceHashMap<Data,CacheRecord>
key
- the key that needs to be removedpublic boolean remove(Object key, Object value)
ConcurrentReferenceHashMap
remove
in interface ConcurrentMap<Data,CacheRecord>
remove
in class ConcurrentReferenceHashMap<Data,CacheRecord>
public void clear()
ConcurrentReferenceHashMap
clear
in interface Map<Data,CacheRecord>
clear
in class ConcurrentReferenceHashMap<Data,CacheRecord>
protected CacheRecordHashMap.EvictableSamplingEntry createSamplingEntry(Data key, CacheRecord value)
createSamplingEntry
in class SampleableConcurrentHashMap<Data,CacheRecord>
public CacheKeyIteratorResult fetchNext(int nextTableIndex, int size)
fetchNext
in interface CacheRecordMap<Data,CacheRecord>
public <C extends EvictionCandidate<Data,CacheRecord>> int evict(Iterable<C> evictionCandidates, EvictionListener<Data,CacheRecord> evictionListener)
EvictableStore
EvictionStrategy
to eventually evict, by the policy, selected
candidates from the internal data structures.evict
in interface EvictableStore<Data,CacheRecord>
evictionCandidates
- Multiple EvictionCandidate
to be evictedevictionListener
- EvictionListener
to listen evicted entriespublic Iterable<CacheRecordHashMap.EvictableSamplingEntry> sample(int sampleCount)
SampleableEvictableStore
sample
in interface SampleableEvictableStore<Data,CacheRecord>
sampleCount
- Entry count to be sampledEvictionCandidate
to be evictedCopyright © 2016 Hazelcast, Inc.. All Rights Reserved.