K
- the type of keys maintained by this mapV
- the type of mapped values@NotThreadSafe public class AtomicHashMap<K,V> extends Object implements AtomicMap<K,V>, DeltaAware, 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");
Cache.startBatch()
).
AtomicMap
,
AtomicMapLookup
Modifier and Type | Class and Description |
---|---|
static class |
AtomicHashMap.Externalizer |
Constructor and Description |
---|
AtomicHashMap() |
AtomicHashMap(boolean isCopy) |
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) |
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)
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() |
public AtomicHashMap()
public AtomicHashMap(boolean isCopy)
public static <K,V> AtomicHashMap<K,V> newInstance(Cache<Object,Object> cache, Object cacheKey)
AtomicMapLookup.getAtomicMap(Cache, Object)
.public void commit()
DeltaAware
DeltaAware.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 DeltaAware
public boolean containsKey(Object key)
containsKey
in interface Map<K,V>
public boolean containsValue(Object value)
containsValue
in interface Map<K,V>
public void markRemoved(boolean b)
public Delta delta()
DeltaAware
delta
in interface DeltaAware
public AtomicHashMap<K,V> copy()
public void initForWriting()
Copyright © 2012 JBoss by Red Hat. All Rights Reserved.