|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
K - key typeV - value typepublic interface DistributedCache<K,V>
A distributed, clustered cache with eviction
Object identity is maintained across the cluster such that an object put into the cache is seen as the same object across all nodes and changes to that object will be maintained across all nodes. Note that this implies that changes to keys or values held in the DistributedCache must be done with appropriate locking on the key or value object to maintain proper Java memory model semantics.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface java.util.Map |
|---|
Map.Entry<K,V> |
| Method Summary | |
|---|---|
CacheConfig |
getConfig()
Get the current config for the cache. |
TimestampedValue<V> |
getTimestampedValue(K key)
Get the value wrapped in a timestamped object. |
TimestampedValue<V> |
getTimestampedValueQuiet(K key)
Get the value wrapped in a timestamped object without updating the last usage statistics. |
int |
localSize()
Get the number of elements local in the current node. |
void |
putNoReturn(K key,
V value)
Put the key/value into the map, replacing the existing value if present. |
void |
removeNoReturn(Object key)
Remove the key from the map, if it exists. |
TimestampedValue<V> |
removeTimestampedValue(K key)
Remove the timestamped value for the given key. |
void |
shutdown()
Shut down the background eviction thread, if any. |
| 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 |
|---|
createFinegrainedLock, lockEntry, unlockEntry |
| Method Detail |
|---|
void putNoReturn(K key,
V value)
This method differs from the normal put() method only in that it returns void instead of the prior value. This is important in the cluster as it avoids faulting that value to return when it is rarely used.
key - Keyvalue - Valuevoid removeNoReturn(Object key)
This method differs from the normal remove() method only in that it returns void instead of the prior value. This is important in the cluster as it avoids faulting that value to return it when it is rarely used.
key - KeyTimestampedValue<V> getTimestampedValue(K key)
This value is used entirely for maintaining the creation and last accessed time for TTI and TTL eviction.
key - The key to search for
TimestampedValue<V> getTimestampedValueQuiet(K key)
key - The key to search for
getTimestampedValue(Object)TimestampedValue<V> removeTimestampedValue(K key)
Previous values will be returned as null if they are expired.
key - The key to search for
CacheConfig getConfig()
This may or may not be the same config object as was orignally supplied to the cache.
int localSize()
This number should always be less than size(), and is likely to be different as all cache entries are not required to be stored in the local heap.
void shutdown()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||