|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface ToolkitCacheInternal<K,V>
Internal api for ToolkitCache
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface java.util.Map |
|---|
Map.Entry<K,V> |
| Method Summary | |
|---|---|
void |
clearLocalCache()
Clear the local cache |
void |
clearVersioned()
This method clears the cache but wont generate the server events. |
boolean |
containsKeyLocalOffHeap(Object key)
Returns true if the key is present off-heap in current node. |
boolean |
containsKeyLocalOnHeap(Object key)
Returns true if the key is present on-heap in current node. |
boolean |
containsLocalKey(Object key)
Query whether key is present locally or not |
void |
disposeLocally()
Dispose the Store from this node. |
Map<Object,Set<org.terracotta.toolkit.cluster.ClusterNode>> |
getNodesWithKeys(Set portableKeys)
Returns set of nodes which has the corresponding key in its local jvm |
VersionedValue<V> |
getVersionedValue(Object key)
This method returns the VersionedValue corresponding to the given key. |
Set<K> |
keySetForSegment(int segmentIndex)
Return the set of Keys in the given segment of cache |
Set<K> |
localKeySet()
Returns a Set containing keys in the Store which are present in the node locally. |
int |
localOffHeapSize()
Return the number of elements present locally in off-heap of current node. |
long |
localOffHeapSizeInBytes()
Return the off-heap size in bytes present locally in current node. |
int |
localOnHeapSize()
Return the number of elements present locally on-heap in current node. The count returned might not be very accurate if maxEntriesLocalHeap is set to small values. |
long |
localOnHeapSizeInBytes()
Return the on-heap size in bytes present locally in current node. |
int |
localSize()
Return the count of local entries. |
V |
put(K key,
V value,
int createTimeInSecs,
int customMaxTTISeconds,
int customMaxTTLSeconds)
|
void |
putIfAbsentVersioned(K key,
V value,
long version)
This method is required for WAN specific usecase. |
void |
putIfAbsentVersioned(K key,
V value,
long version,
int createTimeInSecs,
int customMaxTTISeconds,
int customMaxTTLSeconds)
This method is required for WAN specific usecase. |
void |
putVersioned(K key,
V value,
long version)
|
void |
putVersioned(K key,
V value,
long version,
int createTimeInSecs,
int customMaxTTISeconds,
int customMaxTTLSeconds)
|
void |
quickClear()
This method submit a request to clear for this cache and returns. |
int |
quickSize()
Returns approximate size of this cache without waiting for all transaction to finish. |
void |
registerVersionUpdateListener(VersionUpdateListener listener)
|
boolean |
remove(Object key,
Object value,
ToolkitValueComparator<V> comparator)
Removes the entry for a key only if currently mapped to a given value. |
void |
removeAll(Set<K> keys)
|
void |
removeVersioned(Object key,
long version)
|
boolean |
replace(K key,
V oldValue,
V newValue,
ToolkitValueComparator<V> comparator)
Replaces the entry for a key only if currently mapped to a given value. |
V |
unlockedGet(Object k,
boolean quiet)
Performs an unlocked get. |
Map<K,V> |
unlockedGetAll(Collection<K> keys,
boolean quiet)
|
void |
unlockedPutNoReturn(K k,
V v,
int createTime,
int customTTI,
int customTTL)
Performs an unlocked put. |
void |
unlockedPutNoReturnVersioned(K k,
V v,
long version,
int createTime,
int customTTI,
int customTTL)
|
void |
unlockedRemoveNoReturn(Object k)
Performs an unlocked remove. |
void |
unlockedRemoveNoReturnVersioned(Object key,
long version)
|
V |
unsafeLocalGet(Object key)
Perform a local unlocked read for the given key. |
| Methods inherited from interface org.terracotta.toolkit.cache.ToolkitCache |
|---|
addListener, createLockForKey, getAll, getAllQuiet, getConfiguration, getQuiet, putIfAbsent, putNoReturn, putNoReturn, removeListener, removeNoReturn, setConfigField |
| 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.toolkit.object.Destroyable |
|---|
destroy, isDestroyed |
| Methods inherited from interface org.terracotta.toolkit.search.SearchableMap |
|---|
createQueryBuilder, setAttributeExtractor |
| Methods inherited from interface org.terracotta.toolkit.bulkload.ToolkitBulkLoadObject |
|---|
isBulkLoadEnabled, isNodeBulkLoadEnabled, setNodeBulkLoadEnabled, waitUntilBulkLoadComplete |
| Methods inherited from interface org.terracotta.toolkit.object.ToolkitObject |
|---|
getName |
| Method Detail |
|---|
Map<Object,Set<org.terracotta.toolkit.cluster.ClusterNode>> getNodesWithKeys(Set portableKeys)
void unlockedPutNoReturn(K k,
V v,
int createTime,
int customTTI,
int customTTL)
void unlockedPutNoReturnVersioned(K k,
V v,
long version,
int createTime,
int customTTI,
int customTTL)
void unlockedRemoveNoReturn(Object k)
void unlockedRemoveNoReturnVersioned(Object key,
long version)
V unlockedGet(Object k,
boolean quiet)
Map<K,V> unlockedGetAll(Collection<K> keys,
boolean quiet)
void clearLocalCache()
V unsafeLocalGet(Object key)
key - The key to lookup
key if present locally in the current node, otherwise null.boolean containsLocalKey(Object key)
int localSize()
Set<K> localKeySet()
long localOnHeapSizeInBytes()
long localOffHeapSizeInBytes()
int localOnHeapSize()
int localOffHeapSize()
boolean containsKeyLocalOnHeap(Object key)
boolean containsKeyLocalOffHeap(Object key)
V put(K key,
V value,
int createTimeInSecs,
int customMaxTTISeconds,
int customMaxTTLSeconds)
void putVersioned(K key,
V value,
long version)
void putVersioned(K key,
V value,
long version,
int createTimeInSecs,
int customMaxTTISeconds,
int customMaxTTLSeconds)
void putIfAbsentVersioned(K key,
V value,
long version)
key - value - version - the new version
void putIfAbsentVersioned(K key,
V value,
long version,
int createTimeInSecs,
int customMaxTTISeconds,
int customMaxTTLSeconds)
key - value - version - createTimeInSecs - customMaxTTISeconds - customMaxTTLSeconds - void disposeLocally()
IllegalStateException.
void removeAll(Set<K> keys)
void removeVersioned(Object key,
long version)
void registerVersionUpdateListener(VersionUpdateListener listener)
Set<K> keySetForSegment(int segmentIndex)
segmentIndex -
VersionedValue<V> getVersionedValue(Object key)
VersionedValue corresponding to the given key.
Note that it wont update the lastAccessedTime and will act as quite GET.
key -
void clearVersioned()
void quickClear()
size may not be 0 immediately after this method call.
int quickSize()
boolean remove(Object key,
Object value,
ToolkitValueComparator<V> comparator)
if (map.containsKey(key) &&comparator.equals(map.get(key), value)) {
map.remove(key);
return true;
} else return false;
except that the action is performed atomically.
key - key with which the specified value is associatedvalue - value expected to be associated with the specified keycomparator - comparator to compare values
UnsupportedOperationException - if the remove operation
is not supported by this map
ClassCastException - if the key or value is of an inappropriate
type for this map (optional)
NullPointerException - if the specified key or value is null,
and this map does not permit null keys or values (optional)
boolean replace(K key,
V oldValue,
V newValue,
ToolkitValueComparator<V> comparator)
if (map.containsKey(key) && comparator.equals(map.get(key), oldValue)) {
map.put(key, newValue);
return true;
} else return false;
except that the action is performed atomically.
key - key with which the specified value is associatedoldValue - value expected to be associated with the specified keynewValue - value to be associated with the specified keycomparator - comparator to compare values
UnsupportedOperationException - if the put operation
is not supported by this map
ClassCastException - if the class of a specified key or value
prevents it from being stored in this map
NullPointerException - if a specified key or value is null,
and this map does not permit null keys or values
IllegalArgumentException - if some property of a specified key
or value prevents it from being stored in this map
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||