K
- request (key) typeV
- response (value) typepublic class BlockingHashMap<K,V> extends Object
SegmentCacheManager
and MonitorImpl
.
Thread safety. BlockingHashMap is thread safe. The class delegates all get and put operations to a ConcurrentHashMap.
Constructor and Description |
---|
BlockingHashMap(int capacity)
Creates a BlockingHashMap with given capacity.
|
Modifier and Type | Method and Description |
---|---|
V |
get(K k)
Retrieves the response from the map matching the given key,
blocking until it is received.
|
void |
put(K k,
V v)
Places a (request, response) pair onto the map.
|
public BlockingHashMap(int capacity)
capacity
- Capacitypublic void put(K k, V v)
k
- keyv
- valuepublic V get(K k) throws InterruptedException
k
- keyInterruptedException
- if interrupted while waitingCopyright © 2019 Hitachi Vantara. All rights reserved.