public class CacheRecordHashMap extends SampleableConcurrentHashMap<Data,CacheRecord> implements SampleableCacheRecordMap<Data,CacheRecord>
SampleableConcurrentHashMap.SamplingEntry<K,V>
ConcurrentReferenceHashMap.Option, ConcurrentReferenceHashMap.ReferenceType, ConcurrentReferenceHashMap.SimpleEntry<K,V>, ConcurrentReferenceHashMap.WriteThroughEntry
AbstractMap.SimpleImmutableEntry<K,V>
Constructor and Description |
---|
CacheRecordHashMap(SerializationService serializationService,
int initialCapacity,
CacheContext cacheContext) |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Removes all of the mappings from this map.
|
protected com.hazelcast.cache.impl.record.CacheRecordHashMap.CacheEvictableSamplingEntry |
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. |
CacheEntryIterationResult |
fetchEntries(int nextTableIndex,
int size)
Fetches entries in bulk as specified size at most.
|
CacheKeyIterationResult |
fetchKeys(int nextTableIndex,
int size)
Fetches keys in bulk as specified size at most.
|
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<com.hazelcast.cache.impl.record.CacheRecordHashMap.CacheEvictableSamplingEntry> |
sample(int sampleCount)
The sample method is used to sample a number of entries (defined by the samples parameter) from
the internal data structure.
|
void |
setEntryCounting(boolean enable)
Sets the entry counting behaviour.
|
fetchEntries, fetchKeys, 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(SerializationService serializationService, int initialCapacity, CacheContext cacheContext)
public void setEntryCounting(boolean enable)
CacheRecordMap
setEntryCounting
in interface CacheRecordMap<Data,CacheRecord>
enable
- enables the entry counting behaviour if it is true, otherwise disables.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 com.hazelcast.cache.impl.record.CacheRecordHashMap.CacheEvictableSamplingEntry createSamplingEntry(Data key, CacheRecord value)
createSamplingEntry
in class SampleableConcurrentHashMap<Data,CacheRecord>
public CacheKeyIterationResult fetchKeys(int nextTableIndex, int size)
CacheRecordMap
fetchKeys
in interface CacheRecordMap<Data,CacheRecord>
nextTableIndex
- starting point for fetchingsize
- maximum bulk size to fetch the keysCacheKeyIterationResult
instance contains fetched keyspublic CacheEntryIterationResult fetchEntries(int nextTableIndex, int size)
CacheRecordMap
fetchEntries
in interface CacheRecordMap<Data,CacheRecord>
nextTableIndex
- starting point for fetchingsize
- maximum bulk size to fetch the entriesCacheEntryIterationResult
instance contains fetched keyspublic <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<com.hazelcast.cache.impl.record.CacheRecordHashMap.CacheEvictableSamplingEntry> 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.