K
- Type of the keyV
- Type of the valuepublic class SampleableConcurrentHashMap<K,V> extends ConcurrentReferenceHashMap<K,V>
Modifier and Type | Class and Description |
---|---|
class |
SampleableConcurrentHashMap.SamplingEntry
Entry to define keys and values for sampling.
|
ConcurrentReferenceHashMap.Option, ConcurrentReferenceHashMap.ReferenceType, ConcurrentReferenceHashMap.SimpleEntry<K,V>, ConcurrentReferenceHashMap.WriteThroughEntry
AbstractMap.SimpleImmutableEntry<K,V>
Constructor and Description |
---|
SampleableConcurrentHashMap(int initialCapacity) |
SampleableConcurrentHashMap(int initialCapacity,
float loadFactor,
int concurrencyLevel,
ConcurrentReferenceHashMap.ReferenceType keyType,
ConcurrentReferenceHashMap.ReferenceType valueType,
EnumSet<ConcurrentReferenceHashMap.Option> options) |
Modifier and Type | Method and Description |
---|---|
protected <E extends SampleableConcurrentHashMap.SamplingEntry> |
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. |
<E extends SampleableConcurrentHashMap.SamplingEntry> |
getRandomSamples(int sampleCount)
Gets and returns samples as
sampleCount . |
protected boolean |
isValidForFetching(V value,
long now) |
protected boolean |
isValidForSampling(V value) |
applyIfAbsent, clear, contains, containsKey, containsValue, elements, entrySet, get, isEmpty, keys, keySet, purgeStaleEntries, put, putAll, putIfAbsent, remove, remove, replace, replace, size, values
clone, equals, hashCode, toString
public SampleableConcurrentHashMap(int initialCapacity)
public SampleableConcurrentHashMap(int initialCapacity, float loadFactor, int concurrencyLevel, ConcurrentReferenceHashMap.ReferenceType keyType, ConcurrentReferenceHashMap.ReferenceType valueType, EnumSet<ConcurrentReferenceHashMap.Option> options)
public int fetch(int tableIndex, int size, List<Data> keys)
tableIndex
as size
and puts them into keys
list.tableIndex
- Index (checkpoint) for starting point of fetch operationsize
- Count of how many keys will be fetchedkeys
- List that fetched keys will be put intoprotected boolean isValidForFetching(V value, long now)
protected <E extends SampleableConcurrentHashMap.SamplingEntry> E createSamplingEntry(K key, V value)
public <E extends SampleableConcurrentHashMap.SamplingEntry> Iterable<E> getRandomSamples(int sampleCount)
sampleCount
.sampleCount
- Count of samplesSampleableConcurrentHashMap.SamplingEntry
listprotected boolean isValidForSampling(V value)
Copyright © 2016 Hazelcast, Inc.. All Rights Reserved.