|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface ClusteredMap<K,V>
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface java.util.Map |
|---|
Map.Entry<K,V> |
| Method Summary | |
|---|---|
ClusteredLock |
createFinegrainedLock(K key)
Create a lock for the given key. |
boolean |
flush(Object key,
Object value)
Attempt to recover any local memory resources used by this mapping. |
Collection<Map.Entry<K,V>> |
getAllEntriesSnapshot()
A collection of all entries within this map. |
Collection<Map.Entry<K,V>> |
getAllLocalEntriesSnapshot()
A collection of all in-heap entries within this map. |
List<Map<K,V>> |
getConstituentMaps()
Get a list of the constituent maps that comprise this map. |
Map.Entry<K,V> |
getRandomEntry()
Get a randomly selected entry from this map. |
Map.Entry<K,V> |
getRandomLocalEntry()
Get a randomly selected in-heap entry from this map. |
int |
localSize()
Return the count of local in-heap entries. |
void |
putNoReturn(K key,
V value)
Behaves the same as the standard Map.put(Object, Object)�method except that the previous value is not
returned. |
MapSizeListener |
registerMapSizeListener(MapSizeListener newListener)
Register a map-size listener on this map. |
void |
removeNoReturn(K key)
Behaves the same as the standard Map.remove(Object) method except that the previous value is not returned. |
boolean |
tryRemove(Object key,
long time,
TimeUnit unit)
Attempts to remove the mapping for the given key. |
V |
unlockedGet(Object key)
Perform an unlocked read for the given key. |
void |
unlockedPutNoReturn(K key,
V value)
Performs an unlocked putNoReturn(Object, Object) |
void |
unlockedRemoveNoReturn(K key)
Performs an unlocked removeNoReturn(Object) |
V |
unsafeGet(K key)
Perform a local unlocked read for the given key. |
| Methods inherited from interface java.util.concurrent.ConcurrentMap |
|---|
putIfAbsent, remove, replace, replace |
| Methods inherited from interface java.util.Map |
|---|
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values |
| Methods inherited from interface org.terracotta.locking.LockableMap |
|---|
lockEntry, unlockEntry |
| Method Detail |
|---|
void removeNoReturn(K key)
Map.remove(Object) method except that the previous value is not returned.
This can provide significant performance improvements when used in a Terracotta DSO cluster.
key - the key of the entry to removeV unsafeGet(K key)
This method performs no locking and thus provides absolutely no visibility guarantees. If the value is not local it will NOT be faulted and null is returned instead - thus one cannot distinguish between a non-existent mapping from an un-faulted value. USE WITH CAUTION
key - The key to lookup
void putNoReturn(K key,
V value)
Map.put(Object, Object)�method except that the previous value is not
returned. This can provide significant performance improvements when used in a Terracotta DSO cluster.
key - the key of the entry to putvalue - the value of the entry to putV unlockedGet(Object key)
This method performs no locking and thus provides no visibility guarantees.
key - the key to lookup
boolean tryRemove(Object key,
long time,
TimeUnit unit)
If the mapping is succesfully removed inside the specified time then true is returned.
key - key for the mapping to be removedtime - time to spend attempting removalunit - time unit for the timeout
true if the mapping was removedMapSizeListener registerMapSizeListener(MapSizeListener newListener)
This method returns the listener previously associated with this map. This allows for simple listener chaining or
composition when multiple listeners are required. If no listener was previously registered then null is
returned.
newListener - listener to register
void unlockedPutNoReturn(K key,
V value)
putNoReturn(Object, Object)
void unlockedRemoveNoReturn(K key)
removeNoReturn(Object)
int localSize()
boolean flush(Object key,
Object value)
key - key for the mappingvalue - value for the mapping
true if memory was recoveredCollection<Map.Entry<K,V>> getAllLocalEntriesSnapshot()
Collection<Map.Entry<K,V>> getAllEntriesSnapshot()
ClusteredLock createFinegrainedLock(K key)
This methods returns as finegrained a lock that still provides exclusion against modification of the mapping for this key.
createFinegrainedLock in interface LockableMap<K>key - the key for which a fine-grained lock has to be constructed
List<Map<K,V>> getConstituentMaps()
This list will be a singleton list whose element is this if this map is not a composite map.
Map.Entry<K,V> getRandomEntry()
Map.Entry<K,V> getRandomLocalEntry()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||