com.hazelcast.cache.impl.record
Class CacheRecordHashMap

java.lang.Object
  extended by java.util.AbstractMap<K,V>
      extended by com.hazelcast.util.ConcurrentReferenceHashMap<K,V>
          extended by com.hazelcast.util.SampleableConcurrentHashMap<Data,CacheRecord>
              extended by com.hazelcast.cache.impl.record.CacheRecordHashMap
All Implemented Interfaces:
EvictableStore<Data,CacheRecord>, SampleableEvictableStore<Data,CacheRecord>, CacheRecordMap<Data,CacheRecord>, SampleableCacheRecordMap<Data,CacheRecord>, Serializable, ConcurrentMap<Data,CacheRecord>, Map<Data,CacheRecord>

public class CacheRecordHashMap
extends SampleableConcurrentHashMap<Data,CacheRecord>
implements SampleableCacheRecordMap<Data,CacheRecord>

See Also:
Serialized Form

Nested Class Summary
 class CacheRecordHashMap.EvictableSamplingEntry
           
 
Nested classes/interfaces inherited from class com.hazelcast.util.SampleableConcurrentHashMap
SampleableConcurrentHashMap.IterableSamplingEntry, SampleableConcurrentHashMap.SamplingEntry
 
Nested classes/interfaces inherited from class com.hazelcast.util.ConcurrentReferenceHashMap
ConcurrentReferenceHashMap.Option, ConcurrentReferenceHashMap.ReferenceType, ConcurrentReferenceHashMap.SimpleEntry<K,V>, ConcurrentReferenceHashMap.WriteThroughEntry
 
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleImmutableEntry<K,V>
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Constructor Summary
CacheRecordHashMap(int initialCapacity)
           
CacheRecordHashMap(int initialCapacity, float loadFactor, int concurrencyLevel, ConcurrentReferenceHashMap.ReferenceType keyType, ConcurrentReferenceHashMap.ReferenceType valueType, EnumSet<ConcurrentReferenceHashMap.Option> options)
           
 
Method Summary
protected  CacheRecordHashMap.EvictableSamplingEntry createSamplingEntry(Data key, CacheRecord value)
           
<C extends EvictionCandidate<Data,CacheRecord>>
int
evict(Iterable<C> evictionCandidates)
          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)
           
 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.
 
Methods inherited from class com.hazelcast.util.SampleableConcurrentHashMap
fetch, getRandomSamples
 
Methods inherited from class com.hazelcast.util.ConcurrentReferenceHashMap
clear, contains, containsKey, containsValue, elements, entrySet, get, isEmpty, keys, keySet, purgeStaleEntries, put, putAll, putIfAbsent, remove, remove, replace, replace, size, values
 
Methods inherited from class java.util.AbstractMap
clone, equals, hashCode, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values
 

Constructor Detail

CacheRecordHashMap

public CacheRecordHashMap(int initialCapacity)

CacheRecordHashMap

public CacheRecordHashMap(int initialCapacity,
                          float loadFactor,
                          int concurrencyLevel,
                          ConcurrentReferenceHashMap.ReferenceType keyType,
                          ConcurrentReferenceHashMap.ReferenceType valueType,
                          EnumSet<ConcurrentReferenceHashMap.Option> options)
Method Detail

createSamplingEntry

protected CacheRecordHashMap.EvictableSamplingEntry createSamplingEntry(Data key,
                                                                        CacheRecord value)
Overrides:
createSamplingEntry in class SampleableConcurrentHashMap<Data,CacheRecord>

fetchNext

public CacheKeyIteratorResult fetchNext(int nextTableIndex,
                                        int size)
Specified by:
fetchNext in interface CacheRecordMap<Data,CacheRecord>

evict

public <C extends EvictionCandidate<Data,CacheRecord>> int evict(Iterable<C> evictionCandidates)
Description copied from interface: EvictableStore
The evict method is called by the EvictionStrategy to eventually evict, by the policy, selected candidates from the internal data structures.

Specified by:
evict in interface EvictableStore<Data,CacheRecord>
Parameters:
evictionCandidates - Multiple EvictionCandidate to be evicted
Returns:
evicted entry count

sample

public Iterable<CacheRecordHashMap.EvictableSamplingEntry> sample(int sampleCount)
Description copied from interface: SampleableEvictableStore
The sample method is used to sample a number of entries (defined by the samples parameter) from the internal data structure. This method should be executed in a constant time to deliver predictable timing results of the eviction system.

Specified by:
sample in interface SampleableEvictableStore<Data,CacheRecord>
Parameters:
sampleCount - Entry count to be sampled
Returns:
Multiple EvictionCandidate to be evicted


Copyright © 2015 Hazelcast, Inc.. All Rights Reserved.