K
- Type of the keyV
- Type of the valuepublic class SampleableConcurrentHashMap<K,V> extends ConcurrentReferenceHashMap<K,V>
Modifier and Type | Class and Description |
---|---|
static class |
SampleableConcurrentHashMap.SamplingEntry<K,V>
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,
ConcurrentReferenceHashMap.ReferenceType keyType,
ConcurrentReferenceHashMap.ReferenceType valueType) |
Modifier and Type | Method and Description |
---|---|
protected <E extends SampleableConcurrentHashMap.SamplingEntry> |
createSamplingEntry(K key,
V value) |
int |
fetchEntries(int tableIndex,
int size,
List<Map.Entry<K,V>> entries)
Fetches entries from given
tableIndex as size
and puts them into entries list. |
int |
fetchKeys(int tableIndex,
int size,
List<K> 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(K key,
V value) |
applyIfAbsent, applyIfPresent, clear, contains, containsKey, containsValue, elements, entrySet, get, isEmpty, keys, keySet, purgeStaleEntries, put, putAll, putIfAbsent, remove, remove, replace, replace, size, values
clone, equals, hashCode, toString
finalize, getClass, notify, notifyAll, wait, wait, wait
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, replaceAll
public SampleableConcurrentHashMap(int initialCapacity)
public SampleableConcurrentHashMap(int initialCapacity, ConcurrentReferenceHashMap.ReferenceType keyType, ConcurrentReferenceHashMap.ReferenceType valueType)
public int fetchKeys(int tableIndex, int size, List<K> 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 intopublic int fetchEntries(int tableIndex, int size, List<Map.Entry<K,V>> entries)
tableIndex
as size
and puts them into entries
list.tableIndex
- Index (checkpoint) for starting point of fetch operationsize
- Count of how many entries will be fetchedentries
- List that fetched entries 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
listCopyright © 2021 Hazelcast, Inc.. All Rights Reserved.