Package org.apache.bookkeeper.util
Class SnapshotMap<K,V>
java.lang.Object
org.apache.bookkeeper.util.SnapshotMap<K,V>
A snapshotable map.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) final ReentrantReadWriteLock(package private) NavigableMap<K,V> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancontainsKey(K key) Returns true if this map contains a mapping for the specified key.voidAssociates the specified value with the specified key in this map.voidRemoves the mapping for the key from this map if it is present.snapshot()Create a snapshot of current map.
-
Field Details
-
updates
-
updatesToMerge
-
snapshot
-
lock
-
-
Constructor Details
-
SnapshotMap
public SnapshotMap()
-
-
Method Details
-
snapshot
Create a snapshot of current map.- Returns:
- a snapshot of current map.
-
put
Associates the specified value with the specified key in this map.- Parameters:
key- Key with which the specified value is to be associated.value- Value to be associated with the specified key.
-
remove
Removes the mapping for the key from this map if it is present.- Parameters:
key- Key whose mapping is to be removed from this map.
-
containsKey
Returns true if this map contains a mapping for the specified key.- Parameters:
key- Key whose presence is in the map to be tested.- Returns:
- true if the map contains a mapping for the specified key.
-