com.hazelcast.util
Class SampleableConcurrentHashMap<K,V>
java.lang.Object
java.util.AbstractMap<K,V>
com.hazelcast.util.ConcurrentReferenceHashMap<K,V>
com.hazelcast.util.SampleableConcurrentHashMap<K,V>
- Type Parameters:
K
- Type of the keyV
- Type of the value
- All Implemented Interfaces:
- Serializable, ConcurrentMap<K,V>, Map<K,V>
- Direct Known Subclasses:
- CacheRecordHashMap
public class SampleableConcurrentHashMap<K,V>
- extends ConcurrentReferenceHashMap<K,V>
ConcurrentHashMap to extend iterator capability.
- See Also:
- Serialized Form
Nested classes/interfaces inherited from interface java.util.Map |
Map.Entry<K,V> |
Method Summary |
protected
|
createSamplingEntry(K key,
V value)
|
int |
fetch(int tableIndex,
int size,
List<Data> keys)
Fetches keys from given tableIndex as size
and puts them into keys list. |
|
getRandomSamples(int sampleCount)
Gets and returns samples as sampleCount . |
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 |
SampleableConcurrentHashMap
public SampleableConcurrentHashMap(int initialCapacity)
SampleableConcurrentHashMap
public SampleableConcurrentHashMap(int initialCapacity,
float loadFactor,
int concurrencyLevel,
ConcurrentReferenceHashMap.ReferenceType keyType,
ConcurrentReferenceHashMap.ReferenceType valueType,
EnumSet<ConcurrentReferenceHashMap.Option> options)
fetch
public int fetch(int tableIndex,
int size,
List<Data> keys)
- Fetches keys from given
tableIndex
as size
and puts them into keys
list.
- Parameters:
tableIndex
- Index (checkpoint) for starting point of fetch operationsize
- Count of how many keys will be fetchedkeys
- List that fetched keys will be put into
- Returns:
- the next index (checkpoint) for later fetches
createSamplingEntry
protected <E extends SampleableConcurrentHashMap.SamplingEntry> E createSamplingEntry(K key,
V value)
getRandomSamples
public <E extends SampleableConcurrentHashMap.SamplingEntry> Iterable<E> getRandomSamples(int sampleCount)
- Gets and returns samples as
sampleCount
.
- Parameters:
sampleCount
- Count of samples
- Returns:
- the sampled
SampleableConcurrentHashMap.SamplingEntry
list
Copyright © 2015 Hazelcast, Inc.. All Rights Reserved.