K - the type of keys maintained by this mapV - the type of mapped values@NotThreadSafe public final class AtomicHashMap<K,V> extends Object implements AtomicMap<K,V>, CopyableDeltaAware, Cloneable
AtomicMap. Note that this map cannot be constructed directly, and callers
should obtain references to AtomicHashMaps via the AtomicMapLookup helper. This helper will ensure proper
concurrent construction and registration of AtomicMaps in Infinispan's data container. E.g.:
AtomicMap<String, Integer> map = AtomicMapLookup.getAtomicMap(cache, "my_atomic_map_key");
BatchingCache.startBatch()).
AtomicMap,
AtomicMapLookup| Modifier and Type | Class and Description |
|---|---|
static class |
AtomicHashMap.Externalizer |
static class |
AtomicHashMap.ProxyMode |
| Modifier and Type | Field and Description |
|---|---|
protected FastCopyHashMap<K,V> |
delegate |
| Constructor and Description |
|---|
AtomicHashMap() |
AtomicHashMap(AtomicHashMap.ProxyMode proxyMode) |
AtomicHashMap(boolean isCopy,
AtomicHashMap.ProxyMode proxyMode) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear() |
void |
commit()
Indicate that all deltas collected to date has been extracted (via a call to
DeltaAware.delta()) and can be
discarded. |
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value) |
AtomicHashMap<K,V> |
copy() |
Delta |
delta()
Extracts changes made to implementations, in an efficient format that can easily and cheaply be serialized and
deserialized.
|
Set<Map.Entry<K,V>> |
entrySet() |
V |
get(Object key) |
AtomicHashMapProxy<K,V> |
getProxy(AdvancedCache<Object,Object> cache,
Object mapKey)
Builds a thread-safe proxy for this instance so that concurrent reads are isolated from writes.
|
void |
initForWriting()
Initializes the delta instance to start recording changes.
|
boolean |
isEmpty() |
Set<K> |
keySet() |
void |
markRemoved(boolean b) |
static <K,V> AtomicHashMap<K,V> |
newInstance(Cache<Object,Object> cache,
Object cacheKey,
AtomicHashMap.ProxyMode proxyMode)
Construction only allowed through this factory method.
|
V |
put(K key,
V value) |
void |
putAll(Map<? extends K,? extends V> t) |
V |
remove(Object key) |
int |
size() |
String |
toString() |
Collection<V> |
values() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcompute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAllprotected final FastCopyHashMap<K,V> delegate
public AtomicHashMap()
public AtomicHashMap(AtomicHashMap.ProxyMode proxyMode)
public AtomicHashMap(boolean isCopy,
AtomicHashMap.ProxyMode proxyMode)
public static <K,V> AtomicHashMap<K,V> newInstance(Cache<Object,Object> cache, Object cacheKey, AtomicHashMap.ProxyMode proxyMode)
AtomicMapLookup.getAtomicMap(Cache, Object).public void commit()
DeltaAwareDeltaAware.delta()) and can be
discarded. Often used as an optimization if the delta isn't really needed, but the cleaning and resetting of
internal state is desirable.commit in interface DeltaAwarepublic boolean containsKey(Object key)
containsKey in interface Map<K,V>public boolean containsValue(Object value)
containsValue in interface Map<K,V>public AtomicHashMapProxy<K,V> getProxy(AdvancedCache<Object,Object> cache, Object mapKey)
public void markRemoved(boolean b)
public Delta delta()
DeltaAwaredelta in interface DeltaAwarepublic AtomicHashMap<K,V> copy()
copy in interface CopyableDeltaAwarepublic void initForWriting()
Copyright © 2024 JBoss, a division of Red Hat. All rights reserved.