org.terracotta.cache
Interface IncoherentDistributedCache<K,V>

Type Parameters:
K -
V -
All Superinterfaces:
ConcurrentMap<K,V>, DistributedCache<K,V>, LockableMap<K>, Map<K,V>
All Known Subinterfaces:
IncoherentDistributedCacheInternals<K,V>
All Known Implementing Classes:
TerracottaDistributedCache

public interface IncoherentDistributedCache<K,V>
extends DistributedCache<K,V>

An extension to DistributedCache providing incoherent features -- unlocked reads, unlocked puts, unsafe reads (reading local values in vm or null), unlocked removes, unlocked containsKey etc

Author:
Abhishek Sanoujam

Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Method Summary
 boolean unlockedContainsKey(Object key)
          Same as Map.containsKey(Object) except this operation is performed without any locking
 V unlockedGet(K key, boolean quiet)
          Same as Map.get(Object) except this operation is performed without any locking
 TimestampedValue<V> unlockedGetTimestampedValue(K key, boolean quiet)
          Same as IncoherentDistributedCache#unlockedGet(Object) except returns the TimestampedValue instead of the original value
 void unlockedPutNoReturn(K key, V value)
          Same as DistributedCache.putNoReturn(Object, Object) except that this operation is performed without any locking.
 void unlockedRemoveNoReturn(Object key)
          Same as DistributedCache.removeNoReturn(Object) except this operation is performed without any locking
 V unsafeGet(K key, boolean quiet)
          Returns the local value present for the key if present in the VM, otherwise returns null.
 TimestampedValue<V> unsafeGetTimestampedValue(K key, boolean quiet)
          Same as unsafeGet(Object, boolean) except returns the TimestampedValue instead of the original value
 
Methods inherited from interface org.terracotta.cache.DistributedCache
getConfig, getTimestampedValue, getTimestampedValueQuiet, localSize, putNoReturn, removeNoReturn, removeTimestampedValue, shutdown
 
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

unlockedGet

V unlockedGet(K key,
              boolean quiet)
Same as Map.get(Object) except this operation is performed without any locking

This operation may fault in the value from the server if it is not present in the VM locally but present in the server

Parameters:
key -
quiet -
Returns:

unlockedGetTimestampedValue

TimestampedValue<V> unlockedGetTimestampedValue(K key,
                                                boolean quiet)
Same as IncoherentDistributedCache#unlockedGet(Object) except returns the TimestampedValue instead of the original value

Parameters:
key -
quiet -
Returns:

unsafeGet

V unsafeGet(K key,
            boolean quiet)
Returns the local value present for the key if present in the VM, otherwise returns null.

If the value is not present in the local VM, it WILL NOT fault in the value from the server even when it is present on the server and will return null instead

Note: If quiet is true, it may return expired entries

Parameters:
key - key to lookup
quiet - if true, does not update last access time and skips checking for expired entries otherwise updates last access time and also checks for expired entries
Returns:
the local value, if present in the VM, otherwise null

unsafeGetTimestampedValue

TimestampedValue<V> unsafeGetTimestampedValue(K key,
                                              boolean quiet)
Same as unsafeGet(Object, boolean) except returns the TimestampedValue instead of the original value

Parameters:
key -
quiet -
Returns:

unlockedPutNoReturn

void unlockedPutNoReturn(K key,
                         V value)
Same as DistributedCache.putNoReturn(Object, Object) except that this operation is performed without any locking.

Parameters:
key -
value -

unlockedRemoveNoReturn

void unlockedRemoveNoReturn(Object key)
Same as DistributedCache.removeNoReturn(Object) except this operation is performed without any locking

Parameters:
key -

unlockedContainsKey

boolean unlockedContainsKey(Object key)
Same as Map.containsKey(Object) except this operation is performed without any locking

Parameters:
key -
Returns:


Copyright © 2015 Terracotta, Inc.. All Rights Reserved.