public class SizeAwaitMap<K,V>
extends java.lang.Object
implements java.util.Map<K,V>
Constructor and Description |
---|
SizeAwaitMap(EnvironmentImpl envImpl,
java.util.Map<K,V> map)
Creates the wrapped Map class.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Deprecated.
Use
clear(Exception) instead. |
void |
clear(java.lang.Exception cause)
Clears the underlying map and the latch map, after first counting them
down, thus permitting them to make progress.
|
boolean |
containsKey(java.lang.Object key) |
boolean |
containsValue(java.lang.Object value) |
java.util.Set<java.util.Map.Entry<K,V>> |
entrySet() |
V |
get(java.lang.Object key) |
StatGroup |
getStatistics() |
boolean |
isEmpty() |
java.util.Set<K> |
keySet() |
(package private) int |
latchCount()
Used for unit tests only
|
V |
put(K key,
V value)
Notes the addition of a new value and counts down any latches that were
assigned to that threshold.
|
void |
putAll(java.util.Map<? extends K,? extends V> t) |
V |
remove(java.lang.Object key)
It's synchronized so that size() has a stable value in the above
methods.
|
int |
size() |
boolean |
sizeAwait(int thresholdSize,
long timeout,
java.util.concurrent.TimeUnit unit)
Causes the requesting thread to wait until the map reaches the specified
size or the thread is interrupted.
|
java.util.Collection<V> |
values() |
public SizeAwaitMap(EnvironmentImpl envImpl, java.util.Map<K,V> map)
map
- the actual map instance.public StatGroup getStatistics()
public boolean sizeAwait(int thresholdSize, long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException
thresholdSize
- the size to wait for.java.lang.InterruptedException
- for the usual reasons, or if the map
was cleared and the size threshold was not actually reached.int latchCount()
public V put(K key, V value)
public V remove(java.lang.Object key)
public void clear() throws java.lang.UnsupportedOperationException
clear(Exception)
instead.public void clear(java.lang.Exception cause)
public boolean containsKey(java.lang.Object key)
public boolean containsValue(java.lang.Object value)
Copyright (c) 2004-2012 Oracle. All rights reserved.