public abstract class GridCacheAdapter<K,V> extends GridMetadataAwareAdapter implements GridCache<K,V>, GridCacheProjectionEx<K,V>, Externalizable
| Modifier and Type | Class and Description |
|---|---|
protected class |
GridCacheAdapter.AsyncOp<T>
Cache operation.
|
protected static class |
GridCacheAdapter.FutureHolder
Holder for last async operation future.
|
| Modifier and Type | Field and Description |
|---|---|
protected GridInClosure3<K,Boolean,GridCacheOperation> |
afterPessimisticUnlock
After lock callback.
|
protected GridBiClosure<Collection<K>,Boolean,GridFuture<Object>> |
beforePessimisticLock
Before lock callback.
|
protected GridCacheConfiguration |
cacheCfg
Cache configuration.
|
static int |
CLEAR_ALL_SPLIT_THRESHOLD
clearAll() split threshold.
|
protected GridCacheContext<K,V> |
ctx
Cache configuration.
|
protected GridConfiguration |
gridCfg
Grid configuration.
|
protected ThreadLocal<GridCacheAdapter.FutureHolder> |
lastFut
Last asynchronous future.
|
protected UUID |
locNodeId
Local node ID.
|
protected GridLogger |
log
Logger.
|
protected GridCacheConcurrentMap<K,V> |
map
Local map.
|
protected GridCacheMetricsAdapter |
metrics
Cache metrics.
|
| Modifier | Constructor and Description |
|---|---|
protected |
GridCacheAdapter()
Empty constructor required by
Externalizable. |
protected |
GridCacheAdapter(GridCacheContext<K,V> ctx,
GridCacheConcurrentMap<K,V> map) |
protected |
GridCacheAdapter(GridCacheContext<K,V> ctx,
int startSize) |
| Modifier and Type | Method and Description |
|---|---|
GridCacheAffinity<K> |
affinity()
Gets affinity service to provide information about data partitioning
and distribution.
|
GridInClosure3<K,Boolean,GridCacheOperation> |
afterPessimisticUnlock() |
void |
afterPessimisticUnlock(GridInClosure3<K,Boolean,GridCacheOperation> afterPessimisticUnlock)
Sets callback that will be invoked after keys are unlocked.
|
Set<GridCacheEntryEx<K,V>> |
allEntries() |
protected <T> GridFuture<T> |
asyncOp(GridCacheTxLocalAdapter<K,V> tx,
GridCacheAdapter.AsyncOp<T> op) |
protected <T> GridFuture<T> |
asyncOpAcquire()
Tries to acquire asynchronous operations permit, if limited.
|
protected void |
asyncOpRelease()
Releases asynchronous operations permit, if limited.
|
GridBiClosure<Collection<K>,Boolean,GridFuture<Object>> |
beforePessimisticLock() |
void |
beforePessimisticLock(GridBiClosure<Collection<K>,Boolean,GridFuture<Object>> beforePessimisticLock)
Sets callback that will be invoked before keys are locked.
|
<K1,V1> GridCache<K1,V1> |
cache()
Gets base cache for this projection.
|
protected void |
checkJta()
Checks if cache is working in JTA transaction and enlist cache as XAResource if necessary.
|
boolean |
clear(K key)
Clears an entry from this cache and swap storage only if the entry
is not currently locked, and is not participating in a transaction.
|
boolean |
clear0(K key,
GridPredicate<GridCacheEntry<K,V>>... filter) |
void |
clearAll()
Clears all entries from this cache only if the entry is not
currently locked or participating in a transaction.
|
void |
clearAll(Collection<? extends K> keys,
boolean readers) |
void |
clearAll0(Collection<? extends K> keys,
GridPredicate<GridCacheEntry<K,V>>... filter) |
boolean |
compact(K key)
Clears serialized value bytes from entry (if any) leaving only object representation.
|
boolean |
compact(K key,
GridPredicate<GridCacheEntry<K,V>>... filter) |
void |
compactAll()
Clears serialized value bytes from cache entries (if any) leaving only object representation.
|
void |
compactAll(Iterable<K> keys,
GridPredicate<GridCacheEntry<K,V>>... filter) |
GridCacheConfiguration |
configuration()
Gets configuration bean for this cache.
|
boolean |
containsAllKeys(Collection<? extends K> keys,
GridPredicate<GridCacheEntry<K,V>> filter) |
boolean |
containsAllValues(Collection<? extends V> vals,
GridPredicate<GridCacheEntry<K,V>> filter) |
boolean |
containsAnyKeys(Collection<? extends K> keys,
GridPredicate<GridCacheEntry<K,V>> filter) |
boolean |
containsAnyValues(Collection<? extends V> vals,
GridPredicate<GridCacheEntry<K,V>> filter) |
boolean |
containsKey(K key)
Returns
true if this cache contains a mapping for the specified
key. |
boolean |
containsKey(K key,
GridPredicate<GridCacheEntry<K,V>> filter) |
boolean |
containsValue(V val)
Returns
true if this cache contains given value. |
boolean |
containsValue(V val,
GridPredicate<GridCacheEntry<K,V>> filter) |
GridCacheContext<K,V> |
context() |
GridCacheDataStructures |
dataStructures()
Gets data structures service to provide a gateway for creating various
distributed data structures similar in APIs to
java.util.concurrent package. |
void |
dgc()
Runs DGC procedure on demand using
GridCacheConfiguration.getDgcSuspectLockTimeout() to identify suspect locks. |
void |
dgc(long suspectLockTimeout,
boolean global,
boolean rmvLocks)
Runs DGC procedure on demand using provided parameter to identify suspect locks.
|
protected int |
drBackupQueueSize() |
Collection<GridDrStateTransferDescriptor> |
drListStateTransfers()
List currently active state transfers.
|
void |
drPause()
Pauses data center replication for this cache.
|
GridDrStatus |
drPauseState()
Get DR pause state.
|
void |
drResume()
Resumes data center replication for this cache.
|
GridFuture<?> |
drStateTransfer(Collection<Byte> dataCenterIds)
Starts full state transfer.
|
Set<GridCacheEntryEx<K,V>> |
entries() |
GridCacheEntry<K,V> |
entry(K key)
Gets entry from cache with the specified key.
|
GridCacheEntryEx<K,V> |
entryEx(K key) |
GridCacheEntryEx<K,V> |
entryEx(K key,
boolean touch) |
GridCacheEntryEx<K,V> |
entryEx(K key,
long topVer) |
protected GridCacheEntryEx<K,V> |
entryExSafe(K key,
long topVer) |
Set<GridCacheEntry<K,V>> |
entrySet()
Gets set containing all cache entries.
|
Set<GridCacheEntry<K,V>> |
entrySet(Collection<? extends K> keys,
GridPredicate<K> keyFilter,
GridPredicate<GridCacheEntry<K,V>>... filter) |
Set<GridCacheEntry<K,V>> |
entrySet(GridPredicate<GridCacheEntry<K,V>>... filter) |
Set<GridCacheEntry<K,V>> |
entrySet(int part)
Gets set containing cache entries that belong to provided partition or
null
if partition not found locally. |
Set<GridCacheEntry<K,V>> |
entrySetx(GridPredicate<GridCacheEntry<K,V>>... filter)
Gets entry set containing internal entries.
|
boolean |
evict(K key)
Evicts entry associated with given key from cache.
|
boolean |
evict(K key,
GridPredicate<GridCacheEntry<K,V>>... filter) |
void |
evictAll()
Attempts to evict all cache entries.
|
void |
evictAll(Collection<? extends K> keys)
Attempts to evict all entries associated with keys.
|
void |
evictAll(Collection<? extends K> keys,
GridPredicate<GridCacheEntry<K,V>>... filter) |
Set<GridCacheFlag> |
flags()
Gets cache flags enabled on this projection.
|
GridCacheProjection<K,V> |
flagsOff(GridCacheFlag[] flags)
Gets cache projection base on this but with the specified flags turned off.
|
GridCacheProjection<K,V> |
flagsOn(GridCacheFlag[] flags)
Gets cache projection base on this one, but with the specified flags turned on.
|
boolean |
forAll(GridPredicate<GridCacheEntry<K,V>> vis)
Tests whether the predicate holds for all entries.
|
GridFuture<?> |
forceRepartition()
Forces this cache node to re-balance its partitions.
|
void |
forEach(GridInClosure<GridCacheEntry<K,V>> vis)
Executes visitor closure on each cache element.
|
GridCacheProjectionEx<K,V> |
forSubjectId(UUID subjId)
Creates projection for specified subject ID.
|
V |
get(K key)
Retrieves value mapped to the specified key from cache.
|
V |
get(K key,
GridCacheEntryEx<K,V> entry,
GridPredicate<GridCacheEntry<K,V>>... filter) |
V |
get(K key,
GridPredicate<GridCacheEntry<K,V>> filter) |
Map<K,V> |
getAll(Collection<? extends K> keys)
Retrieves values mapped to the specified keys from cache.
|
Map<K,V> |
getAll(Collection<? extends K> keys,
GridPredicate<GridCacheEntry<K,V>> filter) |
GridFuture<Map<K,V>> |
getAllAsync(Collection<? extends K> keys)
Asynchronously retrieves values mapped to the specified keys from cache.
|
protected GridFuture<Map<K,V>> |
getAllAsync(Collection<? extends K> keys,
boolean forcePrimary,
boolean skipTx,
GridCacheEntryEx<K,V> entry,
UUID subjId,
GridPredicate<GridCacheEntry<K,V>>... filter) |
GridFuture<Map<K,V>> |
getAllAsync(Collection<? extends K> keys,
GridCacheEntryEx<K,V> cached,
boolean checkTx,
UUID subjId,
GridPredicate<GridCacheEntry<K,V>>... filter) |
GridFuture<Map<K,V>> |
getAllAsync(Collection<? extends K> keys,
GridPredicate<GridCacheEntry<K,V>> filter) |
Map<K,V> |
getAllOutTx(List<K> keys)
Gets values from cache.
|
GridFuture<Map<K,V>> |
getAllOutTxAsync(List<K> keys)
Asynchronously gets values from cache.
|
GridFuture<V> |
getAsync(K key)
Asynchronously retrieves value mapped to the specified key from cache.
|
GridFuture<V> |
getAsync(K key,
GridPredicate<GridCacheEntry<K,V>> filter) |
V |
getForcePrimary(K key)
Gets value from cache.
|
GridFuture<V> |
getForcePrimaryAsync(K key)
Asynchronously gets value from cache.
|
long |
ggfsDataSpaceMax()
Get maximum space available for GGFS.
|
long |
ggfsDataSpaceUsed()
Get current amount of used GGFS space in bytes.
|
void |
globalClearAll()
Clears cache on all nodes that store it's data.
|
GridProjection |
gridProjection()
Gets grid projection for this cache.
|
protected void |
init()
Post constructor initialization for subclasses.
|
boolean |
isColocated() |
boolean |
isDht() |
boolean |
isDhtAtomic() |
boolean |
isDrSystemCache()
Checks whether this cache is DR system cache.
|
boolean |
isEmpty()
Returns
true if this map contains no key-value mappings. |
boolean |
isGgfsDataCache()
Checks whether this cache is GGFS data cache.
|
boolean |
isLocal() |
boolean |
isLocked(K key)
Checks if any node owns a lock for this key.
|
boolean |
isLockedByThread(K key)
Checks if current thread owns a lock on this key.
|
boolean |
isMongoDataCache()
Checks whether this cache is Mongo data cache.
|
boolean |
isMongoMetaCache()
Checks whether this cache is Mongo meta cache.
|
boolean |
isNear() |
Iterator<GridCacheEntry<K,V>> |
iterator() |
Set<K> |
keySet()
Set of cached keys.
|
Set<K> |
keySet(GridPredicate<GridCacheEntry<K,V>>... filter) |
void |
loadCache(GridBiPredicate<K,V> p,
long ttl,
Object[] args)
Delegates to
GridCacheStore.loadCache(GridBiInClosure,Object...) method
to load state from the underlying persistent storage. |
GridFuture<?> |
loadCacheAsync(GridBiPredicate<K,V> p,
long ttl,
Object[] args)
Asynchronously delegates to
GridCacheStore.loadCache(GridBiInClosure, Object...) method
to reload state from the underlying persistent storage. |
boolean |
lock(K key,
long timeout,
GridPredicate<GridCacheEntry<K,V>>... filter)
Synchronously acquires lock on a cached object with given
key only if the passed in filter (if any) passes.
|
boolean |
lockAll(Collection<? extends K> keys,
long timeout,
GridPredicate<GridCacheEntry<K,V>>... filter)
All or nothing synchronous lock for passed in keys.
|
GridFuture<Boolean> |
lockAsync(K key,
long timeout,
GridPredicate<GridCacheEntry<K,V>>... filter)
Asynchronously acquires lock on a cached object with given
key only if the passed in filter (if any) passes.
|
protected GridLogger |
log() |
GridCacheConcurrentMap<K,V> |
map() |
GridCacheMetrics |
metrics()
Gets metrics (statistics) for this cache.
|
GridCacheMetricsAdapter |
metrics0() |
String |
name()
Gets name of this cache (
null for default cache). |
int |
nearSize()
Gets size of near cache key set.
|
abstract GridCacheTxLocalAdapter<K,V> |
newTx(boolean implicit,
boolean implicitSingle,
GridCacheTxConcurrency concurrency,
GridCacheTxIsolation isolation,
long timeout,
boolean invalidate,
boolean syncCommit,
boolean syncRollback,
boolean swapOrOffheapEnabled,
boolean storeEnabled,
int txSize,
Object grpLockKey,
boolean partLock) |
long |
offHeapAllocatedSize()
Gets memory size allocated in off-heap.
|
long |
offHeapEntriesCount()
Gets number of cache entries stored in off-heap memory.
|
Iterator<Map.Entry<K,V>> |
offHeapIterator()
Gets iterator over keys and values belonging to this cache off-heap memory on local node.
|
abstract void |
onDeferredDelete(GridCacheEntryEx<K,V> entry,
GridCacheVersion ver) |
void |
onGgfsDataSizeChanged(long delta)
Callback invoked when data is added to GGFS cache.
|
protected void |
onKernalStart()
Kernal start callback.
|
void |
onKernalStop()
Kernal stop callback.
|
void |
onUndeploy(UUID leftNodeId,
ClassLoader ldr)
Undeploys and removes all entries for class loader.
|
long |
overflowSize()
Gets size (in bytes) of all entries swapped to disk.
|
V |
peek(K key)
Peeks at in-memory cached value using default
GridCachePeekMode.SMART
peek mode. |
V |
peek(K key,
Collection<GridCachePeekMode> modes)
Peeks at cached value using optional set of peek modes.
|
V |
peek(K key,
GridPredicate<GridCacheEntry<K,V>> filter) |
protected GridTuple<V> |
peek0(boolean failFast,
K key,
Collection<GridCachePeekMode> modes,
GridCacheTxEx<K,V> tx) |
protected GridTuple<V> |
peek0(boolean failFast,
K key,
GridCachePeekMode mode,
GridPredicate<GridCacheEntry<K,V>>... filter) |
protected V |
peek0(K key,
Collection<GridCachePeekMode> modes,
GridCacheTxEx<K,V> tx) |
Map<K,V> |
peekAll(Collection<? extends K> keys,
GridPredicate<GridCacheEntry<K,V>>... filter) |
protected Map<K,V> |
peekAll0(Collection<? extends K> keys,
Collection<GridCachePeekMode> modes,
GridCacheTxEx<K,V> tx,
Collection<K> skipped) |
protected Map<K,V> |
peekAll0(Collection<? extends K> keys,
GridPredicate<GridCacheEntry<K,V>>[] filter,
Collection<K> skipped) |
GridCacheEntryEx<K,V> |
peekEx(K key) |
GridPredicate<GridCacheEntry<K,V>> |
predicate()
Gets predicate on which this projection is based on or
null
if predicate is not defined. |
abstract GridCachePreloader<K,V> |
preloader() |
Set<GridCacheEntry<K,V>> |
primaryEntrySet()
Gets set containing cache entries for which local node is the primary node.
|
Set<GridCacheEntry<K,V>> |
primaryEntrySet(GridPredicate<GridCacheEntry<K,V>>... filter) |
Set<K> |
primaryKeySet()
Set of cached primary keys for which local node is the primary node.
|
Set<K> |
primaryKeySet(GridPredicate<GridCacheEntry<K,V>>... filter) |
int |
primarySize()
Gets size of all primary keys for this cache.
|
Collection<V> |
primaryValues()
Collection of primary cached values.for which local node is the primary node.
|
Collection<V> |
primaryValues(GridPredicate<GridCacheEntry<K,V>>... filter) |
void |
printMemoryStats()
Prints memory stats.
|
protected void |
processCheckCommittedTxRequest(UUID nodeId,
GridCachePessimisticCheckCommittedTxRequest<K,V> req) |
protected void |
processCheckCommittedTxResponse(UUID nodeId,
GridCachePessimisticCheckCommittedTxResponse<K,V> res) |
protected void |
processCheckPreparedTxRequest(UUID nodeId,
GridCacheOptimisticCheckPreparedTxRequest<K,V> req) |
protected void |
processCheckPreparedTxResponse(UUID nodeId,
GridCacheOptimisticCheckPreparedTxResponse<K,V> res) |
<K1,V1> GridCacheProjection<K1,V1> |
projection(Class<? super K1> keyType,
Class<? super V1> valType)
Gets cache projection only for given key and value type.
|
GridCacheProjection<K,V> |
projection(GridBiPredicate<K,V> p)
Gets cache projection based on given key-value predicate.
|
GridCacheProjection<K,V> |
projection(GridPredicate<GridCacheEntry<K,V>> filter)
Gets cache projection based on given entry filter.
|
V |
promote(K key)
This method promotes cache entry from offheap by given key, if any, from offheap or swap storage
into memory.
|
void |
promoteAll(Collection<? extends K> keys)
This method unswaps cache entries by given keys, if any, from swap storage
into memory.
|
V |
put(K key,
V val,
GridCacheEntryEx<K,V> cached,
long ttl,
GridPredicate<GridCacheEntry<K,V>>[] filter)
Internal method that is called from
GridCacheEntryImpl. |
V |
put(K key,
V val,
GridPredicate<GridCacheEntry<K,V>>... filter)
Stores given key-value pair in cache.
|
void |
putAll(Map<? extends K,? extends V> m,
GridPredicate<GridCacheEntry<K,V>>[] filter)
Stores given key-value pairs in cache.
|
GridFuture<?> |
putAllAsync(Map<? extends K,? extends V> m,
GridPredicate<GridCacheEntry<K,V>>... filter)
Asynchronously stores given key-value pairs in cache.
|
void |
putAllDr(Map<? extends K,GridCacheDrInfo<V>> drMap)
Store DR data.
|
GridFuture<?> |
putAllDrAsync(Map<? extends K,GridCacheDrInfo<V>> drMap)
Store DR data asynchronously.
|
GridFuture<V> |
putAsync(K key,
V val,
GridCacheEntryEx<K,V> entry,
long ttl,
GridPredicate<GridCacheEntry<K,V>>... filter)
Internal method that is called from
GridCacheEntryImpl. |
GridFuture<V> |
putAsync(K key,
V val,
GridPredicate<GridCacheEntry<K,V>>[] filter)
Asynchronously stores given key-value pair in cache.
|
V |
putIfAbsent(K key,
V val)
Stores given key-value pair in cache only if cache had no previous mapping for it.
|
GridFuture<V> |
putIfAbsentAsync(K key,
V val)
Asynchronously stores given key-value pair in cache only if cache had no previous mapping for it.
|
boolean |
putx(K key,
V val,
GridCacheEntryEx<K,V> cached,
long ttl,
GridPredicate<GridCacheEntry<K,V>>... filter)
Internal method that is called from
GridCacheEntryImpl. |
boolean |
putx(K key,
V val,
GridPredicate<GridCacheEntry<K,V>>[] filter)
Stores given key-value pair in cache.
|
GridFuture<Boolean> |
putxAsync(K key,
V val,
GridCacheEntryEx<K,V> entry,
long ttl,
GridPredicate<GridCacheEntry<K,V>>... filter)
Internal method that is called from
GridCacheEntryImpl. |
GridFuture<Boolean> |
putxAsync(K key,
V val,
GridPredicate<GridCacheEntry<K,V>>... filter)
Stores given key-value pair in cache.
|
boolean |
putxIfAbsent(K key,
V val)
Stores given key-value pair in cache only if cache had no previous mapping for it.
|
GridFuture<Boolean> |
putxIfAbsentAsync(K key,
V val)
Asynchronously stores given key-value pair in cache only if cache had no previous mapping for it.
|
GridCacheQueries<K,V> |
queries()
Returns queries facade responsible for creating various SQL, TEXT, or SCAN queries.
|
GridCacheEntry<K,V> |
randomEntry()
Gets a random entry out of cache.
|
void |
readExternal(ObjectInput in) |
protected Object |
readResolve()
Reconstructs object on demarshalling.
|
GridFuture<Object> |
readThroughAllAsync(Collection<? extends K> keys,
boolean reload,
GridCacheTxEx<K,V> tx,
GridPredicate<GridCacheEntry<K,V>>[] filter,
UUID subjId,
GridBiInClosure<K,V> vis) |
V |
reload(K key)
Reloads a single key from persistent storage.
|
V |
reload(K key,
GridPredicate<GridCacheEntry<K,V>>... filter) |
void |
reloadAll()
Reloads all currently cached keys form persistent storage.
|
void |
reloadAll(Collection<? extends K> keys)
Reloads specified entries from underlying persistent storage.
|
Map<K,V> |
reloadAll(Collection<? extends K> keys,
boolean ret,
GridPredicate<GridCacheEntry<K,V>>... filter) |
void |
reloadAll(Collection<? extends K> keys,
GridPredicate<GridCacheEntry<K,V>>... filter) |
void |
reloadAll(GridPredicate<GridCacheEntry<K,V>>... filter) |
GridFuture<?> |
reloadAllAsync()
Asynchronously reloads all specified entries from underlying
persistent storage.
|
GridFuture<?> |
reloadAllAsync(Collection<? extends K> keys)
Asynchronously reloads all specified entries from underlying
persistent storage.
|
GridFuture<Map<K,V>> |
reloadAllAsync(Collection<? extends K> keys,
boolean ret,
UUID subjId,
GridPredicate<GridCacheEntry<K,V>>... filter) |
GridFuture<?> |
reloadAllAsync(Collection<? extends K> keys,
GridPredicate<GridCacheEntry<K,V>>... filter) |
GridFuture<?> |
reloadAllAsync(GridPredicate<GridCacheEntry<K,V>> filter) |
GridFuture<V> |
reloadAsync(K key)
Asynchronously reloads a single key from persistent storage.
|
GridFuture<V> |
reloadAsync(K key,
GridPredicate<GridCacheEntry<K,V>>... filter) |
V |
remove(K key,
GridCacheEntryEx<K,V> entry,
GridPredicate<GridCacheEntry<K,V>>... filter)
Internal method that is called from
GridCacheEntryImpl. |
V |
remove(K key,
GridPredicate<GridCacheEntry<K,V>>[] filter)
Removes given key mapping from cache.
|
boolean |
remove(K key,
V val)
Removes given key mapping from cache if one exists and value is equal to the passed in value.
|
void |
removeAll(Collection<? extends K> keys,
GridPredicate<GridCacheEntry<K,V>>... filter)
Removes given key mappings from cache for entries for which the optionally passed in filters do
pass.
|
void |
removeAll(GridPredicate<GridCacheEntry<K,V>>... filter)
Removes mappings from cache for entries for which the optionally passed in filters do
pass.
|
GridFuture<?> |
removeAllAsync(Collection<? extends K> keys,
GridPredicate<GridCacheEntry<K,V>>... filter)
Asynchronously removes given key mappings from cache for entries for which the optionally
passed in filters do pass.
|
GridFuture<?> |
removeAllAsync(GridPredicate<GridCacheEntry<K,V>>... filter)
Asynchronously removes mappings from cache for entries for which the optionally passed in filters do
pass.
|
void |
removeAllDr(Map<? extends K,GridCacheVersion> drMap)
Removes DR data.
|
GridFuture<?> |
removeAllDrAsync(Map<? extends K,GridCacheVersion> drMap)
Removes DR data asynchronously.
|
GridFuture<V> |
removeAsync(K key,
GridCacheEntryEx<K,V> entry,
GridPredicate<GridCacheEntry<K,V>>... filter)
Internal method that is called from
GridCacheEntryImpl. |
GridFuture<V> |
removeAsync(K key,
GridPredicate<GridCacheEntry<K,V>>... filter)
Asynchronously removes given key mapping from cache.
|
GridFuture<Boolean> |
removeAsync(K key,
V val)
Asynchronously removes given key mapping from cache if one exists and value is equal to the passed in value.
|
protected void |
removeEntry(GridCacheEntryEx<K,V> entry) |
void |
removeIfObsolete(K key) |
boolean |
removex(K key,
GridCacheEntryEx<K,V> entry,
GridPredicate<GridCacheEntry<K,V>>... filter)
Internal method that is called from
GridCacheEntryImpl. |
boolean |
removex(K key,
GridPredicate<GridCacheEntry<K,V>>... filter)
Removes given key mapping from cache.
|
GridCacheReturn<V> |
removex(K key,
V val)
Removes given key mapping from cache if one exists and value is equal to the passed in value.
|
GridFuture<Boolean> |
removexAsync(K key,
GridCacheEntryEx<K,V> entry,
GridPredicate<GridCacheEntry<K,V>>... filter)
Internal method that is called from
GridCacheEntryImpl. |
GridFuture<Boolean> |
removexAsync(K key,
GridPredicate<GridCacheEntry<K,V>>... filter)
Asynchronously removes given key mapping from cache.
|
GridFuture<GridCacheReturn<V>> |
removexAsync(K key,
V val)
Asynchronously removes given key mapping from cache if one exists and value is equal to the passed in value.
|
V |
replace(K key,
V val)
Stores given key-value pair in cache only if if there is a previous mapping for it.
|
boolean |
replace(K key,
V oldVal,
V newVal)
Stores given key-value pair in cache only if only if the previous value is equal to the
'oldVal' passed in. |
GridFuture<V> |
replaceAsync(K key,
V val)
Asynchronously stores given key-value pair in cache only if if there is a previous mapping for it.
|
GridFuture<Boolean> |
replaceAsync(K key,
V oldVal,
V newVal)
Asynchronously stores given key-value pair in cache only if only if the previous value is equal to the
'oldVal' passed in. |
boolean |
replacex(K key,
V val)
Stores given key-value pair in cache only if only if there is a previous mapping for it.
|
GridCacheReturn<V> |
replacex(K key,
V oldVal,
V newVal)
Stores given key-value pair in cache only if only if the previous value is equal to the
'oldVal' passed in. |
GridFuture<Boolean> |
replacexAsync(K key,
V val)
Asynchronously stores given key-value pair in cache only if only if there is a previous mapping for it.
|
GridFuture<GridCacheReturn<V>> |
replacexAsync(K key,
V oldVal,
V newVal)
Asynchronously stores given key-value pair in cache only if only if the previous value is equal to the
'oldVal' passed in. |
void |
resetMetrics()
Resets metrics for current cache.
|
protected void |
saveFuture(GridCacheAdapter.FutureHolder holder,
GridFuture<?> fut)
Saves future in thread local holder and adds listener
that will clear holder when future is finished.
|
int |
size()
Gets size of cache key set.
|
List<GridCacheClearAllRunnable<K,V>> |
splitClearAll()
Split clear all task into multiple runnables.
|
void |
start()
Starts this cache.
|
protected String |
startInfo()
Startup info.
|
void |
stop()
Stops this cache.
|
protected String |
stopInfo()
Stop info.
|
Iterator<Map.Entry<K,V>> |
swapIterator()
Gets iterator over keys and values belonging to this cache swap space on local node.
|
long |
swapKeys()
Gets number of swap entries (keys).
|
long |
swapSize()
Gets size in bytes for swap space.
|
ConcurrentMap<K,V> |
toMap()
Converts this API into standard Java
ConcurrentMap interface. |
String |
toString() |
void |
transform(K key,
GridClosure<V,V> transformer)
Stores result of applying
valTransform closure to the previous value associated with
given key in cache. |
void |
transformAll(Map<? extends K,? extends GridClosure<V,V>> m)
Stores result of applying transform closures from the given map to previous values associated
with corresponding keys in cache.
|
void |
transformAll(Set<? extends K> keys,
GridClosure<V,V> transformer)
Stores result of applying the specified transform closure to previous values associated
with the specified keys in cache.
|
GridFuture<?> |
transformAllAsync(Map<? extends K,? extends GridClosure<V,V>> m)
Stores result of applying transform closures from the given map to previous values associated
with corresponding keys in cache.
|
GridFuture<?> |
transformAllAsync(Set<? extends K> keys,
GridClosure<V,V> transformer)
Stores result of applying the specified transform closure to previous values associated
with the specified keys in cache.
|
<R> R |
transformAndCompute(K key,
GridClosure<V,GridBiTuple<V,R>> transformer)
Applies
transformer closure to the previous value associated with given key in cache,
closure should return GridBiTuple instance where first value is new value stored in cache
and second value is returned as result of this method. |
GridFuture<?> |
transformAsync(K key,
GridClosure<V,V> transformer)
Stores result of applying
transformer closure to the previous value associated with
given key in cache. |
GridFuture<?> |
transformAsync(K key,
GridClosure<V,V> transformer,
GridCacheEntryEx<K,V> entry,
long ttl)
Internal method that is called from
GridCacheEntryImpl. |
GridCacheTx |
tx()
Gets transaction started by this thread or
null if this thread does
not have a transaction. |
abstract GridFuture<Boolean> |
txLockAsync(Collection<? extends K> keys,
long timeout,
GridCacheTxLocalEx<K,V> tx,
boolean isRead,
boolean retval,
GridCacheTxIsolation isolation,
boolean invalidate,
GridPredicate<GridCacheEntry<K,V>>[] filter) |
GridCacheTx |
txStart()
Starts transaction with default isolation, concurrency, timeout, and invalidation policy.
|
GridCacheTx |
txStart(GridCacheTxConcurrency concurrency,
GridCacheTxIsolation isolation)
Starts new transaction with the specified concurrency and isolation.
|
GridCacheTx |
txStart(GridCacheTxConcurrency concurrency,
GridCacheTxIsolation isolation,
long timeout,
int txSize)
Starts transaction with specified isolation, concurrency, timeout, invalidation flag,
and number of participating entries.
|
GridCacheTx |
txStartAffinity(Object affinityKey,
GridCacheTxConcurrency concurrency,
GridCacheTxIsolation isolation,
long timeout,
int txSize)
Starts
affinity-group-locked transaction based on affinity key. |
GridCacheTx |
txStartPartition(int partId,
GridCacheTxConcurrency concurrency,
GridCacheTxIsolation isolation,
long timeout,
int txSize)
Starts
partition-group-locked transaction based on partition ID. |
Collection<GridCacheTxSynchronization> |
txSynchronizations()
Gets registered transaction synchronizations.
|
void |
txSynchronize(GridCacheTxSynchronization syncs)
Registers transactions synchronizations for all transactions started by this cache.
|
void |
txUnsynchronize(GridCacheTxSynchronization syncs)
Removes transaction synchronizations.
|
void |
unlock(K key,
GridPredicate<GridCacheEntry<K,V>>... filter)
Unlocks given key only if current thread owns the lock.
|
Collection<V> |
values()
Collection of cached values.
|
Collection<V> |
values(GridPredicate<GridCacheEntry<K,V>>... filter) |
Set<GridCacheEntryImpl<K,V>> |
wrappers()
Same as
entrySet() but for internal use only to
avoid casting. |
void |
writeExternal(ObjectOutput out) |
addMeta, addMetaIfAbsent, addMetaIfAbsent, allMeta, clone, copyMeta, copyMeta, hasMeta, hasMeta, meta, putMetaIfAbsent, putMetaIfAbsent, readExternalMeta, removeMeta, removeMeta, replaceMeta, writeExternalMetaequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitlockAllAsync, unlockAlladdMeta, addMetaIfAbsent, addMetaIfAbsent, allMeta, copyMeta, copyMeta, hasMeta, hasMeta, meta, putMetaIfAbsent, putMetaIfAbsent, removeMeta, removeMeta, replaceMetapublic static final int CLEAR_ALL_SPLIT_THRESHOLD
protected ThreadLocal<GridCacheAdapter.FutureHolder> lastFut
@GridToStringExclude protected GridCacheContext<K,V> ctx
@GridToStringExclude protected GridCacheConcurrentMap<K,V> map
@GridToStringExclude protected UUID locNodeId
@GridToStringExclude protected GridCacheConfiguration cacheCfg
@GridToStringExclude protected GridConfiguration gridCfg
protected volatile GridCacheMetricsAdapter metrics
protected GridBiClosure<Collection<K>,Boolean,GridFuture<Object>> beforePessimisticLock
protected GridInClosure3<K,Boolean,GridCacheOperation> afterPessimisticUnlock
protected GridLogger log
protected GridCacheAdapter()
Externalizable.protected GridCacheAdapter(GridCacheContext<K,V> ctx, int startSize)
ctx - Cache context.startSize - Start size.protected GridCacheAdapter(GridCacheContext<K,V> ctx, GridCacheConcurrentMap<K,V> map)
ctx - Cache context.map - Concurrent map.public String name()
null for default cache).name in interface GridCacheProjection<K,V>public GridProjection gridProjection()
gridProjection in interface GridCacheProjection<K,V>public void printMemoryStats()
public GridCacheConcurrentMap<K,V> map()
public GridCacheContext<K,V> context()
protected GridLogger log()
public boolean isNear()
True if this is near cache.public boolean isLocal()
True if cache is local.public boolean isColocated()
True if cache is colocated.public boolean isDhtAtomic()
True if cache is DHT Atomic.public boolean isDht()
True if cache is DHT.public abstract GridCachePreloader<K,V> preloader()
public GridCacheQueries<K,V> queries()
queries in interface GridCacheProjection<K,V>public GridCacheAffinity<K> affinity()
public GridCacheDataStructures dataStructures()
java.util.concurrent package.dataStructures in interface GridCache<K,V>public <K1,V1> GridCache<K1,V1> cache()
cache in interface GridCacheProjection<K,V>K1 - Cache key type.V1 - Cache value type.public Set<GridCacheFlag> flags()
flags in interface GridCacheProjection<K,V>public GridPredicate<GridCacheEntry<K,V>> predicate()
null
if predicate is not defined.predicate in interface GridCacheProjectionEx<K,V>public GridCacheProjectionEx<K,V> forSubjectId(UUID subjId)
forSubjectId in interface GridCacheProjectionEx<K,V>subjId - Client ID.public GridCacheProjection<K,V> flagsOn(@Nullable GridCacheFlag[] flags)
flagsOn in interface GridCacheProjection<K,V>flags - Flags to turn on (if empty, then no-op).public void beforePessimisticLock(GridBiClosure<Collection<K>,Boolean,GridFuture<Object>> beforePessimisticLock)
beforePessimisticLock - Before lock callback.public GridBiClosure<Collection<K>,Boolean,GridFuture<Object>> beforePessimisticLock()
public GridCacheProjection<K,V> flagsOff(@Nullable GridCacheFlag[] flags)
flagsOff in interface GridCacheProjection<K,V>flags - Flags to turn off (if empty, then all flags will be turned off).public <K1,V1> GridCacheProjection<K1,V1> projection(Class<? super K1> keyType, Class<? super V1> valType)
non-null key-value
pairs that have matching key and value pairs will be used in this projection.projection in interface GridCacheProjection<K,V>K1 - Key type.V1 - Value type.keyType - Key type.valType - Value type.public GridCacheProjection<K,V> projection(GridBiPredicate<K,V> p)
For example, for GridCacheProjection.putAll(Map, GridPredicate[]) method only
elements that pass the filter will be given to GridCache.putAll(m, filter)
where it will be checked once again prior to put.
projection in interface GridCacheProjection<K,V>p - Key-value predicate for this projection. If null, then the
same projection is returned.public GridCacheProjection<K,V> projection(GridPredicate<GridCacheEntry<K,V>> filter)
GridCacheProjection.projection(GridBiPredicate)
method, this filter will not be used for pre-filtering.projection in interface GridCacheProjection<K,V>filter - Filter to be passed through to all cache operations. If null, then the
same projection is returned. If cache operation receives its own filter, then filters
will be 'anded'.public GridCacheConfiguration configuration()
configuration in interface GridCache<K,V>public abstract GridFuture<Boolean> txLockAsync(Collection<? extends K> keys, long timeout, GridCacheTxLocalEx<K,V> tx, boolean isRead, boolean retval, GridCacheTxIsolation isolation, boolean invalidate, GridPredicate<GridCacheEntry<K,V>>[] filter)
keys - Keys to lock.timeout - Lock timeout.tx - Transaction.isRead - True for read operations.retval - Flag to return value.isolation - Transaction isolation.invalidate - Invalidate flag.filter - Optional filter.public abstract GridCacheTxLocalAdapter<K,V> newTx(boolean implicit, boolean implicitSingle, GridCacheTxConcurrency concurrency, GridCacheTxIsolation isolation, long timeout, boolean invalidate, boolean syncCommit, boolean syncRollback, boolean swapOrOffheapEnabled, boolean storeEnabled, int txSize, @Nullable Object grpLockKey, boolean partLock)
implicit - True if transaction is implicit.implicitSingle - Implicit-with-single-key flag.concurrency - Concurrency.isolation - Isolation.timeout - transaction timeout.invalidate - Invalidation flag.syncCommit - Synchronous commit flag.syncRollback - Synchronous rollback flag.swapOrOffheapEnabled - If true then swap storage will be used.storeEnabled - if true then read/write through will be used.txSize - Expected transaction size.grpLockKey - Group lock key if this is a group-lock transaction.partLock - True if partition is locked.protected void init()
public void start()
throws GridException
GridException - If start failed.protected final String startInfo()
public void stop()
protected final String stopInfo()
protected void onKernalStart()
throws GridException
GridException - If callback failed.public void onKernalStop()
public boolean isEmpty()
true if this map contains no key-value mappings.isEmpty in interface GridCacheProjection<K,V>true if this map contains no key-value mappings.public boolean containsKey(K key)
true if this cache contains a mapping for the specified
key.containsKey in interface GridCacheProjection<K,V>key - key whose presence in this map is to be tested.true if this map contains a mapping for the specified key.public boolean containsValue(V val)
true if this cache contains given value.containsValue in interface GridCacheProjection<K,V>val - Value to check.True if given value is present in cache.public V peek(K key)
GridCachePeekMode.SMART
peek mode.
This method will not load value from any persistent store or from a remote node.
GridCachePeekMode.SMART mode
semantics. If you need to look at global cached value even from within transaction,
you can use GridCacheProjection.peek(Object, Collection) method.peek in interface GridCacheProjection<K,V>key - Entry key.public V peek(K key, @Nullable Collection<GridCachePeekMode> modes) throws GridException
non-null value is found, it will be immediately returned.
Note that if modes are not provided this method works exactly the same way as
GridCacheProjection.peek(Object), implicitly using GridCachePeekMode.SMART mode.
peek in interface GridCacheProjection<K,V>key - Entry key.modes - Optional set of peek modes.GridException - If peek operation failed.public Map<K,V> peekAll(@Nullable Collection<? extends K> keys, @Nullable GridPredicate<GridCacheEntry<K,V>>... filter)
@Nullable protected GridTuple<V> peek0(boolean failFast, K key, GridCachePeekMode mode, @Nullable GridPredicate<GridCacheEntry<K,V>>... filter) throws GridCacheFilterFailedException
failFast - Fail fast flag.key - Key.mode - Peek mode.filter - Filter.GridCacheFilterFailedException - If filter failed.protected Map<K,V> peekAll0(@Nullable Collection<? extends K> keys, @Nullable GridPredicate<GridCacheEntry<K,V>>[] filter, @Nullable Collection<K> skipped)
keys - Keys.filter - Filter.skipped - Skipped keys, possibly null.@Nullable protected V peek0(K key, @Nullable Collection<GridCachePeekMode> modes, GridCacheTxEx<K,V> tx) throws GridException
key - Key.modes - Peek modes.tx - Transaction to peek at (if modes contains TX value).GridException - In case of error.@Nullable protected GridTuple<V> peek0(boolean failFast, K key, @Nullable Collection<GridCachePeekMode> modes, GridCacheTxEx<K,V> tx) throws GridException, GridCacheFilterFailedException
failFast - If true, then filter failure will result in exception.key - Key.modes - Peek modes.tx - Transaction to peek at (if modes contains TX value).GridException - In case of error.GridCacheFilterFailedException - If filer validation failed.protected Map<K,V> peekAll0(@Nullable Collection<? extends K> keys, @Nullable Collection<GridCachePeekMode> modes, GridCacheTxEx<K,V> tx, @Nullable Collection<K> skipped) throws GridException
keys - Keys.modes - Modes.tx - Transaction.skipped - Keys skipped during filter validation.GridException - If failed.public void forEach(GridInClosure<GridCacheEntry<K,V>> vis)
forEach in interface GridCacheProjection<K,V>vis - Closure which will be invoked for each cache entry.public boolean forAll(GridPredicate<GridCacheEntry<K,V>> vis)
true is returned.
forAll in interface GridCacheProjection<K,V>vis - Predicate to test for each cache entry.True if the given predicate holds for all visited entries, false otherwise.public void onUndeploy(@Nullable UUID leftNodeId, ClassLoader ldr)
leftNodeId - Left node ID.ldr - Class loader to undeploy.@Nullable public GridCacheEntry<K,V> entry(K key)
Note that this method can return null if projection is configured as
pre-filtered and entry key and value don't pass key-value filter of the projection.
entry in interface GridCacheProjection<K,V>key - Entry key.null if projection pre-filtering was not passed.@Nullable public GridCacheEntryEx<K,V> peekEx(K key)
key - Entry key.public GridCacheEntryEx<K,V> entryEx(K key)
key - Entry key.null).public GridCacheEntryEx<K,V> entryEx(K key, boolean touch)
key - Entry key.touch - Whether created entry should be touched.null).public GridCacheEntryEx<K,V> entryEx(K key, long topVer)
topVer - Topology version.key - Entry key.null).public Set<GridCacheEntryImpl<K,V>> wrappers()
entrySet() but for internal use only to
avoid casting.public Set<GridCacheEntryEx<K,V>> entries()
GridCacheInternal keys.public Set<GridCacheEntryEx<K,V>> allEntries()
GridCacheInternal keys.public Set<GridCacheEntry<K,V>> entrySet()
If optional filters are provided, then only entries that successfully pass the filters will be included in the resulting set.
entrySet in interface GridCacheProjection<K,V>public Set<GridCacheEntry<K,V>> entrySetx(GridPredicate<GridCacheEntry<K,V>>... filter)
entrySetx in interface GridCacheProjectionEx<K,V>filter - Filter.public Set<GridCacheEntry<K,V>> entrySet(int part)
null
if partition not found locally.entrySet in interface GridCacheProjection<K,V>part - Partition.null if partition
not found locally.public Set<GridCacheEntry<K,V>> primaryEntrySet()
If optional filters are provided, then only entries that successfully pass the filters will be included in the resulting set.
primaryEntrySet in interface GridCacheProjection<K,V>public Set<K> keySet()
Iterator over this set will not fail if set was concurrently updated by another thread. This means that iterator may or may not return latest keys depending on whether they were added before or after current iterator position.
keySet in interface GridCacheProjection<K,V>public Set<K> primaryKeySet()
null because they were invalidated. You can remove elements from
this set, but you cannot add elements to this set. All removal operation will be
reflected on the cache itself.
Iterator over this set will not fail if set was concurrently updated by another thread. This means that iterator may or may not return latest keys depending on whether they were added before or after current iterator position.
primaryKeySet in interface GridCacheProjection<K,V>public Collection<V> values()
null because they were invalided. You can remove
elements from this collection, but you cannot add elements to this collection.
All removal operation will be reflected on the cache itself.
If filter is provided, then only the values for the entries that pass provided filters are returned.
Iterator over this collection will not fail if collection was concurrently updated by another thread. This means that iterator may or may not return latest values depending on whether they were added before or after current iterator position.
values in interface GridCacheProjection<K,V>public Collection<V> values(GridPredicate<GridCacheEntry<K,V>>... filter)
public Collection<V> primaryValues()
null
because they were invalided. You can remove elements from this collection,
but you cannot add elements to this collection. All removal operation will be
reflected on the cache itself.
If filter is provided, then only the values for the entries that pass provided filters are returned.
Iterator over this collection will not fail if collection was concurrently updated by another thread. This means that iterator may or may not return latest values depending on whether they were added before or after current iterator position.
primaryValues in interface GridCacheProjection<K,V>public void removeIfObsolete(K key)
key - Entry key.public List<GridCacheClearAllRunnable<K,V>> splitClearAll()
public boolean clear(K key)
If GridCacheConfiguration.isSwapEnabled() is set to true and
GridCacheFlag.SKIP_SWAP is not enabled, the evicted entries will
also be cleared from swap.
Note that this operation is local as it merely clears an entry from local cache. It does not remove entries from remote caches or from underlying persistent storage.
GridCacheFlag.READ.clear in interface GridCacheProjection<K,V>key - Key to clear.True if entry was successfully cleared from cache, false
if entry was in use at the time of this method invocation and could not be
cleared.public void clearAll()
If GridCacheConfiguration.isSwapEnabled() is set to true and
GridCacheFlag.SKIP_SWAP is not enabled, the evicted entries will
also be cleared from swap.
Note that this operation is local as it merely clears entries from local cache. It does not remove entries from remote caches or from underlying persistent storage.
GridCacheFlag.READ.clearAll in interface GridCacheProjection<K,V>public void clearAll(Collection<? extends K> keys, boolean readers)
keys - Keys.readers - Readers flag.public void globalClearAll()
throws GridException
GridCacheProjection.clearAll() method which only
clears local node's cache.
GridGain will make the best attempt to clear caches on all nodes. If some caches could not be cleared, then exception will be thrown.
globalClearAll in interface GridCacheProjection<K,V>GridException - In case of cache could not be cleared on any of the nodes.public boolean compact(K key) throws GridException
compact in interface GridCacheProjection<K,V>key - Key to compact.true if entry was deleted from cache (i.e. was expired).GridException - If failed to compact.public void compactAll()
throws GridException
compactAll in interface GridCacheProjection<K,V>GridException - If failed to compact.protected void removeEntry(GridCacheEntryEx<K,V> entry)
entry - Removes entry from cache if currently mapped value is the same as passed.public V get(K key, @Nullable GridCacheEntryEx<K,V> entry, @Nullable GridPredicate<GridCacheEntry<K,V>>... filter) throws GridException
get in interface GridCacheProjectionEx<K,V>key - Key to retrieve the value for.entry - Cached entry when called from entry wrapper.filter - Filter to check prior to getting the value. Note that filter check
together with getting the value is an atomic operation.GridException - If failed.public V getForcePrimary(K key) throws GridException
getForcePrimary in interface GridCacheProjectionEx<K,V>key - Key to get value for.GridException - If failed.public GridFuture<V> getForcePrimaryAsync(K key)
getForcePrimaryAsync in interface GridCacheProjectionEx<K,V>key - Key to get value for.@Nullable public Map<K,V> getAllOutTx(List<K> keys) throws GridException
getAllOutTx in interface GridCacheProjectionEx<K,V>keys - Keys to get values for.GridException - If failed.public GridFuture<Map<K,V>> getAllOutTxAsync(List<K> keys)
getAllOutTxAsync in interface GridCacheProjectionEx<K,V>keys - Keys to get values for.@Nullable public V reload(K key) throws GridException
GridCacheStore.load(GridCacheTx, Object)
method.
reload in interface GridCacheProjection<K,V>key - Key to reload.GridException - If reloading failed.public GridFuture<V> reloadAsync(K key)
GridCacheStore.load(GridCacheTx, Object)
method.
reloadAsync in interface GridCacheProjection<K,V>key - Key to reload.public void reloadAll(@Nullable Collection<? extends K> keys) throws GridException
reloadAll in interface GridCacheProjection<K,V>keys - Keys to reload.GridException - if reloading failed.public GridFuture<?> reloadAllAsync(@Nullable Collection<? extends K> keys)
reloadAllAsync in interface GridCacheProjection<K,V>keys - Keys to reload.reload completes.public void reloadAll()
throws GridException
reloadAll in interface GridCacheProjection<K,V>GridException - If reloading failed.public GridFuture<?> reloadAllAsync()
reloadAllAsync in interface GridCacheProjection<K,V>reload completes.public GridFuture<Object> readThroughAllAsync(Collection<? extends K> keys, boolean reload, @Nullable GridCacheTxEx<K,V> tx, GridPredicate<GridCacheEntry<K,V>>[] filter, @Nullable UUID subjId, GridBiInClosure<K,V> vis)
keys - Keys.reload - Reload flag.tx - Transaction.filter - Filter.vis - Visitor.@Nullable public Map<K,V> reloadAll(@Nullable Collection<? extends K> keys, boolean ret, @Nullable GridPredicate<GridCacheEntry<K,V>>... filter) throws GridException
keys - Keys.ret - Return flag.filter - Optional filter.null map if return flag is true.GridException - If failed.public GridFuture<Map<K,V>> reloadAllAsync(@Nullable Collection<? extends K> keys, boolean ret, @Nullable UUID subjId, @Nullable GridPredicate<GridCacheEntry<K,V>>... filter)
keys - Keys.ret - Return flag.filter - Filter.@Nullable protected GridCacheEntryEx<K,V> entryExSafe(K key, long topVer)
key - Key.public boolean evict(K key)
If GridCacheConfiguration.isSwapEnabled() is set to true and
GridCacheFlag.SKIP_SWAP is not enabled, the evicted entry will
be swapped to offheap, and then to disk.
GridCacheFlag.READ.evict in interface GridCacheProjection<K,V>key - Key to evict from cache.True if entry could be evicted, false otherwise.public void evictAll()
If GridCacheConfiguration.isSwapEnabled() is set to true and
GridCacheFlag.SKIP_SWAP is not enabled, the evicted entry will
be swapped to offheap, and then to disk.
GridCacheFlag.READ.evictAll in interface GridCacheProjection<K,V>public void evictAll(@Nullable Collection<? extends K> keys)
If GridCacheConfiguration.isSwapEnabled() is set to true and
GridCacheFlag.SKIP_SWAP is not enabled, the evicted entry will
be swapped to offheap, and then to disk.
GridCacheFlag.READ.evictAll in interface GridCacheProjection<K,V>keys - Keys to evict.@Nullable public V get(K key) throws GridException
null
means entry did not pass the provided filter or cache has no mapping for the
key.
If the value is not present in cache, then it will be looked up from swap storage. If
it's not present in swap, or if swap is disable, and if read-through is allowed, value
will be loaded from GridCacheStore persistent storage via
GridCacheStore.load(GridCacheTx, Object) method.
GridCacheFlag.LOCAL flag is set on projection.get in interface GridCacheProjection<K,V>key - Key to retrieve the value for.GridException - If get operation failed.public GridFuture<V> getAsync(K key)
null
means entry did not pass the provided filter or cache has no mapping for the
key.
If the value is not present in cache, then it will be looked up from swap storage. If
it's not present in swap, or if swap is disabled, and if read-through is allowed, value
will be loaded from GridCacheStore persistent storage via
GridCacheStore.load(GridCacheTx, Object) method.
GridCacheFlag.LOCAL flag is set on projection.getAsync in interface GridCacheProjection<K,V>key - Key for the value to get.public Map<K,V> getAll(@Nullable Collection<? extends K> keys) throws GridException
If some value is not present in cache, then it will be looked up from swap storage. If
it's not present in swap, or if swap is disabled, and if read-through is allowed, value
will be loaded from GridCacheStore persistent storage via
GridCacheStore.loadAll(GridCacheTx, Collection, GridBiInClosure) method.
GridCacheFlag.LOCAL flag is set on projection.getAll in interface GridCacheProjection<K,V>keys - Keys to get.GridException - If get operation failed.public GridFuture<Map<K,V>> getAllAsync(@Nullable Collection<? extends K> keys)
If some value is not present in cache, then it will be looked up from swap storage. If
it's not present in swap, or if swap is disabled, and if read-through is allowed, value
will be loaded from GridCacheStore persistent storage via
GridCacheStore.loadAll(GridCacheTx, Collection, GridBiInClosure) method.
GridCacheFlag.LOCAL flag is set on projection.getAllAsync in interface GridCacheProjection<K,V>keys - Key for the value to get.protected GridFuture<Map<K,V>> getAllAsync(@Nullable Collection<? extends K> keys, boolean forcePrimary, boolean skipTx, @Nullable GridCacheEntryEx<K,V> entry, @Nullable UUID subjId, @Nullable GridPredicate<GridCacheEntry<K,V>>... filter)
public GridFuture<Map<K,V>> getAllAsync(@Nullable Collection<? extends K> keys, @Nullable GridCacheEntryEx<K,V> cached, boolean checkTx, @Nullable UUID subjId, @Nullable GridPredicate<GridCacheEntry<K,V>>... filter)
public V put(K key, V val, @Nullable GridPredicate<GridCacheEntry<K,V>>... filter) throws GridException
GridCacheMode.PARTITIONED or GridCacheMode.REPLICATED caches,
the value will be loaded from the primary node, which in its turn may load the value
from the swap storage, and consecutively, if it's not in swap,
from the underlying persistent storage. If value has to be loaded from persistent
storage, GridCacheStore.load(GridCacheTx, Object) method will be used.
If the returned value is not needed, method GridCacheProjection.putx(Object, Object, GridPredicate[]) should
always be used instead of this one to avoid the overhead associated with returning of the previous value.
If write-through is enabled, the stored value will be persisted to GridCacheStore
via GridCacheStore.put(GridCacheTx, Object, Object) method.
GridCacheFlag.LOCAL, GridCacheFlag.READ.put in interface GridCacheProjection<K,V>key - Key to store in cache.val - Value to be associated with the given key.filter - Optional filter to check prior to putting value in cache. Note
that filter check is atomic with put operation.null
if entry did not pass the filter, or if there was no mapping for the key in swap
or in persistent storage.GridException - If put operation failed.@Nullable public V put(K key, V val, @Nullable GridCacheEntryEx<K,V> cached, long ttl, @Nullable GridPredicate<GridCacheEntry<K,V>>[] filter) throws GridException
GridCacheEntryImpl.put in interface GridCacheProjectionEx<K,V>key - Key.val - Value.cached - Cached entry. If not provided, equivalent to {GridCacheProjection#put}.ttl - Optional time-to-live. If negative, leaves ttl value unchanged.filter - Optional filter.GridException - If failed.public boolean putx(K key, V val, @Nullable GridCacheEntryEx<K,V> cached, long ttl, @Nullable GridPredicate<GridCacheEntry<K,V>>... filter) throws GridException
GridCacheEntryImpl.putx in interface GridCacheProjectionEx<K,V>key - Key.val - Value.cached - Cached entry. If not provided, equivalent to {GridCacheProjection#put}.ttl - Optional time-to-live. If negative, leaves ttl value unchanged.filter - Optional filter.GridException - If failed.public GridFuture<V> putAsync(K key, V val, @Nullable GridPredicate<GridCacheEntry<K,V>>[] filter)
GridCacheMode.REPLICATED caches, the value will be loaded from swap
and, if it's not there, and read-through is allowed, from the underlying
GridCacheStore storage. In case of GridCacheMode.PARTITIONED caches,
the value will be loaded from the primary node, which in its turn may load the value
from the swap storage, and consecutively, if it's not in swap and read-through is allowed,
from the underlying persistent storage. If value has to be loaded from persistent
storage, GridCacheStore.load(GridCacheTx, Object) method will be used.
If the returned value is not needed, method GridCacheProjection.putx(Object, Object, GridPredicate[]) should
always be used instead of this one to avoid the overhead associated with returning of the previous value.
If write-through is enabled, the stored value will be persisted to GridCacheStore
via GridCacheStore.put(GridCacheTx, Object, Object) method.
GridCacheFlag.LOCAL, GridCacheFlag.READ.putAsync in interface GridCacheProjection<K,V>key - Key to store in cache.val - Value to be associated with the given key.filter - Optional filter to check prior to putting value in cache. Note
that filter check is atomic with put operation.public GridFuture<V> putAsync(K key, V val, @Nullable GridCacheEntryEx<K,V> entry, long ttl, @Nullable GridPredicate<GridCacheEntry<K,V>>... filter)
GridCacheEntryImpl.putAsync in interface GridCacheProjectionEx<K,V>key - Key.val - Value.entry - Optional cached entry.ttl - Optional time-to-live value. If negative, leaves ttl value unchanged.filter - Optional filter.public boolean putx(K key, V val, GridPredicate<GridCacheEntry<K,V>>[] filter) throws GridException
This method will return true if value is stored in cache and false otherwise.
Unlike GridCacheProjection.put(Object, Object, GridPredicate[]) method, it does not return previous
value and, therefore, does not have any overhead associated with returning a value. It
should be used whenever return value is not required.
If write-through is enabled, the stored value will be persisted to GridCacheStore
via GridCacheStore.put(GridCacheTx, Object, Object) method.
GridCacheFlag.LOCAL, GridCacheFlag.READ.putx in interface GridCacheProjection<K,V>key - Key to store in cache.val - Value to be associated with the given key.filter - Optional filter to check prior to putting value in cache. Note
that filter check is atomic with put operation.True if optional filter passed and value was stored in cache,
false otherwise. Note that this method will return true if filter is not
specified.GridException - If put operation failed.public void putAllDr(Map<? extends K,GridCacheDrInfo<V>> drMap) throws GridException
putAllDr in interface GridCacheProjectionEx<K,V>drMap - DR map.GridException - If put operation failed.public GridFuture<?> putAllDrAsync(Map<? extends K,GridCacheDrInfo<V>> drMap) throws GridException
putAllDrAsync in interface GridCacheProjectionEx<K,V>drMap - DR map.GridException - If put operation failed.public void transform(K key, GridClosure<V,V> transformer) throws GridException
valTransform closure to the previous value associated with
given key in cache. Result of closure application is guaranteed to be atomic, however, closure
itself can be applied more than once.
Note that transform closure must not throw any exceptions. If exception is thrown from apply
method, the transaction will be invalidated and entries participating in transaction will be nullified.
Unlike GridCacheProjection.putx(Object, Object, GridPredicate[]) or GridCacheProjection.put(Object, Object, GridPredicate[])
methods, this method will not transfer the whole updated value over the network, but instead will
transfer the transforming closure that will be applied on each remote node involved in transaction.
It may add significant performance gain when dealing with large values as the value is much larger
than the closure itself. If write-through is enabled, the stored value will be persisted to
GridCacheStore via GridCacheStore.put(GridCacheTx, Object, Object) method.
GridCacheFlag.LOCAL, GridCacheFlag.READ.transform in interface GridCacheProjection<K,V>key - Key to store in cache.transformer - Closure to be applied to the previous value in cache. If this closure returns
null, the associated value will be removed from cache.GridException - On any error occurred while storing value in cache.public <R> R transformAndCompute(K key, GridClosure<V,GridBiTuple<V,R>> transformer) throws GridException
transformer closure to the previous value associated with given key in cache,
closure should return GridBiTuple instance where first value is new value stored in cache
and second value is returned as result of this method.
GridCacheFlag.LOCAL, GridCacheFlag.READ.transformAndCompute in interface GridCacheProjection<K,V>key - Key to store in cache.transformer - Closure to be applied to the previous value in cache.GridException - On any error occurred while storing value in cache.public GridFuture<Boolean> putxAsync(K key, V val, @Nullable GridPredicate<GridCacheEntry<K,V>>... filter)
This method will return true if value is stored in cache and false otherwise.
Unlike GridCacheProjection.put(Object, Object, GridPredicate[]) method, it does not return previous
value and, therefore, does not have any overhead associated with returning of a value. It
should always be used whenever return value is not required.
If write-through is enabled, the stored value will be persisted to GridCacheStore
via GridCacheStore.put(GridCacheTx, Object, Object) method.
GridCacheFlag.LOCAL, GridCacheFlag.READ.putxAsync in interface GridCacheProjection<K,V>key - Key to store in cache.val - Value to be associated with the given key.filter - Optional filter to check prior to putting value in cache. Note
that filter check is atomic with put operation.true if optional filter
passed and value was stored in cache, false otherwise. Note that future will
return true if filter is not specified.public GridFuture<Boolean> putxAsync(K key, V val, @Nullable GridCacheEntryEx<K,V> entry, long ttl, @Nullable GridPredicate<GridCacheEntry<K,V>>... filter)
GridCacheEntryImpl.putxAsync in interface GridCacheProjectionEx<K,V>key - Key.val - Value.entry - Cached entry. If not provided, equivalent to {GridCacheProjection#put}.ttl - Optional time-to-live. If negative, leave ttl value unchanged.filter - Optional filter.public GridFuture<?> transformAsync(K key, GridClosure<V,V> transformer)
transformer closure to the previous value associated with
given key in cache. Result of closure application is guaranteed to be atomic, however, closure
itself can be applied more than once.
Note that transform closure must not throw any exceptions. If exception is thrown from apply
method, the transaction will be invalidated and entries participating in transaction will be nullified.
Unlike GridCacheProjection.putx(Object, Object, GridPredicate[]) method, this method will not transfer
the whole updated value over the network, but instead will transfer the transforming closure
that will be applied on each remote node involved in transaction. It may add significant performance
gain when dealing with large values as the value is much larger than the closure itself.
If write-through is enabled, the stored value will be persisted to GridCacheStore
via GridCacheStore.put(GridCacheTx, Object, Object) method.
GridCacheFlag.LOCAL, GridCacheFlag.READ.transformAsync in interface GridCacheProjection<K,V>key - Key to store in cache.transformer - Closure to be applied to the previous value in cache. If this closure returns
null, the associated value will be removed from cache.public GridFuture<?> transformAsync(K key, GridClosure<V,V> transformer, @Nullable GridCacheEntryEx<K,V> entry, long ttl)
GridCacheEntryImpl.transformAsync in interface GridCacheProjectionEx<K,V>key - Key.transformer - Transformer closure.entry - Cached entry.ttl - Optional time-to-lve.@Nullable public V putIfAbsent(K key, V val) throws GridException
GridCacheMode.PARTITIONED or GridCacheMode.REPLICATED caches,
the value will be loaded from the primary node, which in its turn may load the value
from the swap storage, and consecutively, if it's not in swap,
from the underlying persistent storage. If value has to be loaded from persistent
storage, GridCacheStore.load(GridCacheTx, Object) method will be used.
If the returned value is not needed, method GridCacheProjection.putxIfAbsent(Object, Object) should
always be used instead of this one to avoid the overhead associated with returning of the
previous value.
If write-through is enabled, the stored value will be persisted to GridCacheStore
via GridCacheStore.put(GridCacheTx, Object, Object) method.
GridCacheFlag.LOCAL, GridCacheFlag.READ.putIfAbsent in interface GridCacheProjection<K,V>key - Key to store in cache.val - Value to be associated with the given key.GridException - If put operation failed.public GridFuture<V> putIfAbsentAsync(K key, V val)
GridCacheMode.PARTITIONED or GridCacheMode.REPLICATED caches,
the value will be loaded from the primary node, which in its turn may load the value
from the swap storage, and consecutively, if it's not in swap,
from the underlying persistent storage. If value has to be loaded from persistent
storage, GridCacheStore.load(GridCacheTx, Object) method will be used.
If the returned value is not needed, method GridCacheProjection.putxIfAbsentAsync(Object, Object) should
always be used instead of this one to avoid the overhead associated with returning of the
previous value.
If write-through is enabled, the stored value will be persisted to GridCacheStore
via GridCacheStore.put(GridCacheTx, Object, Object) method.
GridCacheFlag.LOCAL, GridCacheFlag.READ.putIfAbsentAsync in interface GridCacheProjection<K,V>key - Key to store in cache.val - Value to be associated with the given key.public boolean putxIfAbsent(K key, V val) throws GridException
This method will return true if value is stored in cache and false otherwise.
Unlike GridCacheProjection.putIfAbsent(Object, Object) method, it does not return previous
value and, therefore, does not have any overhead associated with returning of a value. It
should always be used whenever return value is not required.
If write-through is enabled, the stored value will be persisted to GridCacheStore
via GridCacheStore.put(GridCacheTx, Object, Object) method.
GridCacheFlag.LOCAL, GridCacheFlag.READ.putxIfAbsent in interface GridCacheProjection<K,V>key - Key to store in cache.val - Value to be associated with the given key.true if value is stored in cache and false otherwise.GridException - If put operation failed.public GridFuture<Boolean> putxIfAbsentAsync(K key, V val)
This method will return true if value is stored in cache and false otherwise.
Unlike GridCacheProjection.putIfAbsent(Object, Object) method, it does not return previous
value and, therefore, does not have any overhead associated with returning of a value. It
should always be used whenever return value is not required.
If write-through is enabled, the stored value will be persisted to GridCacheStore
via GridCacheStore.put(GridCacheTx, Object, Object) method.
GridCacheFlag.LOCAL, GridCacheFlag.READ.putxIfAbsentAsync in interface GridCacheProjection<K,V>key - Key to store in cache.val - Value to be associated with the given key.@Nullable public V replace(K key, V val) throws GridException
GridCacheMode.PARTITIONED or GridCacheMode.REPLICATED caches,
the value will be loaded from the primary node, which in its turn may load the value
from the swap storage, and consecutively, if it's not in swap,
from the underlying persistent storage. If value has to be loaded from persistent
storage, GridCacheStore.load(GridCacheTx, Object) method will be used.
If the returned value is not needed, method GridCacheProjection.replacex(Object, Object) should
always be used instead of this one to avoid the overhead associated with returning of the
previous value.
If write-through is enabled, the stored value will be persisted to GridCacheStore
via GridCacheStore.put(GridCacheTx, Object, Object) method.
GridCacheFlag.LOCAL, GridCacheFlag.READ.replace in interface GridCacheProjection<K,V>key - Key to store in cache.val - Value to be associated with the given key.GridException - If replace operation failed.public GridFuture<V> replaceAsync(K key, V val)
GridCacheMode.PARTITIONED caches, the value will be loaded from the primary node,
which in its turn may load the value from the swap storage, and consecutively, if it's not in swap,
from the underlying persistent storage. If value has to be loaded from persistent
storage, GridCacheStore.load(GridCacheTx, Object) method will be used.
If the returned value is not needed, method GridCacheProjection.replacex(Object, Object) should
always be used instead of this one to avoid the overhead associated with returning of the
previous value.
If write-through is enabled, the stored value will be persisted to GridCacheStore
via GridCacheStore.put(GridCacheTx, Object, Object) method.
GridCacheFlag.LOCAL, GridCacheFlag.READ.replaceAsync in interface GridCacheProjection<K,V>key - Key to store in cache.val - Value to be associated with the given key.public boolean replacex(K key, V val) throws GridException
This method will return true if value is stored in cache and false otherwise.
Unlike GridCacheProjection.replace(Object, Object) method, it does not return previous
value and, therefore, does not have any overhead associated with returning of a value. It
should always be used whenever return value is not required.
If write-through is enabled, the stored value will be persisted to GridCacheStore
via GridCacheStore.put(GridCacheTx, Object, Object) method.
GridCacheFlag.LOCAL, GridCacheFlag.READ.replacex in interface GridCacheProjection<K,V>key - Key to store in cache.val - Value to be associated with the given key.True if replace happened, false otherwise.GridException - If replace operation failed.public GridFuture<Boolean> replacexAsync(K key, V val)
This method will return true if value is stored in cache and false otherwise.
Unlike GridCacheProjection.replaceAsync(Object, Object) method, it does not return previous
value and, therefore, does not have any overhead associated with returning of a value. It
should always be used whenever return value is not required.
If write-through is enabled, the stored value will be persisted to GridCacheStore
via GridCacheStore.put(GridCacheTx, Object, Object) method.
GridCacheFlag.LOCAL, GridCacheFlag.READ.replacexAsync in interface GridCacheProjection<K,V>key - Key to store in cache.val - Value to be associated with the given key.public boolean replace(K key, V oldVal, V newVal) throws GridException
'oldVal' passed in.
This method will return true if value is stored in cache and false otherwise.
If write-through is enabled, the stored value will be persisted to GridCacheStore
via GridCacheStore.put(GridCacheTx, Object, Object) method.
GridCacheFlag.LOCAL, GridCacheFlag.READ.replace in interface GridCacheProjection<K,V>key - Key to store in cache.oldVal - Old value to match.newVal - Value to be associated with the given key.True if replace happened, false otherwise.GridException - If replace operation failed.public GridFuture<Boolean> replaceAsync(K key, V oldVal, V newVal)
'oldVal' passed in.
This method will return true if value is stored in cache and false otherwise.
If write-through is enabled, the stored value will be persisted to GridCacheStore
via GridCacheStore.put(GridCacheTx, Object, Object) method.
GridCacheFlag.LOCAL, GridCacheFlag.READ.replaceAsync in interface GridCacheProjection<K,V>key - Key to store in cache.oldVal - Old value to match.newVal - Value to be associated with the given key.public void putAll(@Nullable Map<? extends K,? extends V> m, GridPredicate<GridCacheEntry<K,V>>[] filter) throws GridException
If write-through is enabled, the stored values will be persisted to GridCacheStore
via GridCacheStore.putAll(GridCacheTx, Map) method.
GridCacheFlag.LOCAL, GridCacheFlag.READ.putAll in interface GridCacheProjection<K,V>m - Key-value pairs to store in cache.filter - Optional entry filter. If provided, then entry will
be stored only if the filter returned true.GridException - If put operation failed.public void transformAll(@Nullable Map<? extends K,? extends GridClosure<V,V>> m) throws GridException
Note that transform closure must not throw any exceptions. If exception is thrown from apply
method, the transaction will be invalidated and entries participating in transaction will be nullified.
Unlike GridCacheProjection.putAll(Map, GridPredicate[]) method, this method will not transfer
the whole updated value over the network, but instead will transfer the transforming closures
that will be applied on each remote node involved in transaction. It may add significant
performance gain when dealing with large values as the value is much larger than the closure itself.
If write-through is enabled, the stored value will be persisted to GridCacheStore
via GridCacheStore.put(GridCacheTx, Object, Object) method.
GridCacheFlag.LOCAL, GridCacheFlag.READ.transformAll in interface GridCacheProjection<K,V>m - Map containing keys and closures to be applied to values.GridException - On any error occurred while storing value in cache.public void transformAll(@Nullable Set<? extends K> keys, GridClosure<V,V> transformer) throws GridException
Note that transform closure must not throw any exceptions. If exception is thrown from apply
method, the transaction will be invalidated and entries participating in transaction will be nullified.
Unlike GridCacheProjection.putAll(Map, GridPredicate[]) method, this method will not transfer
the whole updated value over the network, but instead will transfer the transforming closure
that will be applied on each remote node involved in transaction. It may add significant
performance gain when dealing with large values as the value is much larger than the closure itself.
If write-through is enabled, the stored value will be persisted to GridCacheStore
via GridCacheStore.put(GridCacheTx, Object, Object) method.
GridCacheFlag.LOCAL, GridCacheFlag.READ.transformAll in interface GridCacheProjection<K,V>keys - Keys for entries, to which the transformation closure will be applied.
If the collection is null or empty, this method is no-op.transformer - Transformation closure to be applied to each value.GridException - On any error occurred while storing value in cache.public GridFuture<?> putAllAsync(Map<? extends K,? extends V> m, @Nullable GridPredicate<GridCacheEntry<K,V>>... filter)
If write-through is enabled, the stored values will be persisted to GridCacheStore
via GridCacheStore.putAll(GridCacheTx, Map) method.
GridCacheFlag.LOCAL, GridCacheFlag.READ.putAllAsync in interface GridCacheProjection<K,V>m - Key-value pairs to store in cache.filter - Optional entry filter. If provided, then entry will
be stored only if the filter returned true.public GridFuture<?> transformAllAsync(@Nullable Map<? extends K,? extends GridClosure<V,V>> m)
Note that transform closure must not throw any exceptions. If exception is thrown from apply
method, the transaction will be invalidated and entries participating in transaction will be nullified.
Unlike GridCacheProjection.putAll(Map, GridPredicate[]) method, this method will not transfer
the whole updated value over the network, but instead will transfer the transforming closures
that will be applied on each remote node involved in transaction. It may add significant performance
gain when dealing with large values as the value is much larger than the closure itself.
If write-through is enabled, the stored value will be persisted to GridCacheStore
via GridCacheStore.put(GridCacheTx, Object, Object) method.
GridCacheFlag.LOCAL, GridCacheFlag.READ.transformAllAsync in interface GridCacheProjection<K,V>m - Map containing keys and closures to be applied to values.public GridFuture<?> transformAllAsync(@Nullable Set<? extends K> keys, GridClosure<V,V> transformer) throws GridException
Note that transform closure must not throw any exceptions. If exception is thrown from apply
method, the transaction will be invalidated and entries participating in transaction will be nullified.
Unlike GridCacheProjection.putAll(Map, GridPredicate[]) method, this method will not transfer
the whole updated value over the network, but instead will transfer the transforming closure
that will be applied on each remote node involved in transaction. It may add significant
performance gain when dealing with large values as the value is much larger than the closure itself.
If write-through is enabled, the stored value will be persisted to GridCacheStore
via GridCacheStore.put(GridCacheTx, Object, Object) method.
GridCacheFlag.LOCAL, GridCacheFlag.READ.transformAllAsync in interface GridCacheProjection<K,V>keys - Keys for entries, to which the transformation closure will be applied.
If the collection is null or empty, this method is no-op.transformer - Transformation closure to be applied to each value.GridException - On any error occurred while storing value in cache.@Nullable public V remove(K key, GridPredicate<GridCacheEntry<K,V>>[] filter) throws GridException
GridCacheMode.PARTITIONED or GridCacheMode.REPLICATED
caches, the value will be loaded from the primary node, which in its turn may load the value
from the disk-based swap storage, and consecutively, if it's not in swap,
from the underlying persistent storage. If value has to be loaded from persistent
storage, GridCacheStore.load(GridCacheTx, Object) method will be used.
If the returned value is not needed, method GridCacheProjection.removex(Object, GridPredicate[]) should
always be used instead of this one to avoid the overhead associated with returning of the
previous value.
If write-through is enabled, the value will be removed from GridCacheStore
via GridCacheStore.remove(GridCacheTx, Object) method.
GridCacheFlag.LOCAL, GridCacheFlag.READ.remove in interface GridCacheProjection<K,V>key - Key whose mapping is to be removed from cache.filter - Optional filter to check prior to removing value form cache. Note
that filter is checked atomically together with remove operation.null
if there was no value for this key.GridException - If remove operation failed.public V remove(K key, @Nullable GridCacheEntryEx<K,V> entry, @Nullable GridPredicate<GridCacheEntry<K,V>>... filter) throws GridException
GridCacheEntryImpl.remove in interface GridCacheProjectionEx<K,V>key - Key to remove.entry - Cached entry. If not provided, equivalent to {GridCacheProjection#put}.filter - Optional filter.GridException - If failed.public GridFuture<V> removeAsync(K key, GridPredicate<GridCacheEntry<K,V>>... filter)
GridCacheMode.PARTITIONED or GridCacheMode.REPLICATED
caches, the value will be loaded from the primary node, which in its turn may load the value
from the swap storage, and consecutively, if it's not in swap,
from the underlying persistent storage. If value has to be loaded from persistent
storage, GridCacheStore.load(GridCacheTx, Object) method will be used.
If the returned value is not needed, method GridCacheProjection.removex(Object, GridPredicate[]) should
always be used instead of this one to avoid the overhead associated with returning of the
previous value.
If write-through is enabled, the value will be removed from GridCacheStore
via GridCacheStore.remove(GridCacheTx, Object) method.
GridCacheFlag.LOCAL, GridCacheFlag.READ.removeAsync in interface GridCacheProjection<K,V>key - Key whose mapping is to be removed from cache.filter - Optional filter to check prior to removing value form cache. Note
that filter is checked atomically together with remove operation.public GridFuture<V> removeAsync(K key, @Nullable GridCacheEntryEx<K,V> entry, @Nullable GridPredicate<GridCacheEntry<K,V>>... filter)
GridCacheEntryImpl.removeAsync in interface GridCacheProjectionEx<K,V>key - Key to remove.entry - Optional cached entry.filter - Optional filter.public void removeAll(@Nullable Collection<? extends K> keys, GridPredicate<GridCacheEntry<K,V>>... filter) throws GridException
If write-through is enabled, the values will be removed from GridCacheStore
via GridCacheStore.removeAll(GridCacheTx, Collection) method.
GridCacheFlag.LOCAL, GridCacheFlag.READ.removeAll in interface GridCacheProjection<K,V>keys - Keys whose mappings are to be removed from cache.filter - Optional filter to check prior to removing value form cache. Note
that filter is checked atomically together with remove operation.GridException - If remove failed.public GridFuture<?> removeAllAsync(@Nullable Collection<? extends K> keys, GridPredicate<GridCacheEntry<K,V>>... filter)
If write-through is enabled, the values will be removed from GridCacheStore
via GridCacheStore.removeAll(GridCacheTx, Collection) method.
GridCacheFlag.LOCAL, GridCacheFlag.READ.removeAllAsync in interface GridCacheProjection<K,V>keys - Keys whose mappings are to be removed from cache.filter - Optional filter to check prior to removing value form cache. Note
that filter is checked atomically together with remove operation.public boolean removex(K key, GridPredicate<GridCacheEntry<K,V>>... filter) throws GridException
This method will return true if remove did occur, which means that all optionally
provided filters have passed and there was something to remove, false otherwise.
If write-through is enabled, the value will be removed from GridCacheStore
via GridCacheStore.remove(GridCacheTx, Object) method.
GridCacheFlag.LOCAL, GridCacheFlag.READ.removex in interface GridCacheProjection<K,V>key - Key whose mapping is to be removed from cache.filter - Optional filter to check prior to removing value form cache. Note
that filter is checked atomically together with remove operation.True if filter passed validation and entry was removed, false otherwise.
Note that if filter is not specified, this method will return true.GridException - If remove failed.public boolean removex(K key, @Nullable GridCacheEntryEx<K,V> entry, @Nullable GridPredicate<GridCacheEntry<K,V>>... filter) throws GridException
GridCacheEntryImpl.removex in interface GridCacheProjectionEx<K,V>key - Key to remove.entry - Cached entry. If not provided, equivalent to {GridCacheProjection#put}.filter - Optional filter.GridException - If failed.public GridFuture<Boolean> removexAsync(K key, GridPredicate<GridCacheEntry<K,V>>... filter)
This method will return true if remove did occur, which means that all optionally
provided filters have passed and there was something to remove, false otherwise.
If write-through is enabled, the value will be removed from GridCacheStore
via GridCacheStore.remove(GridCacheTx, Object) method.
GridCacheFlag.LOCAL, GridCacheFlag.READ.removexAsync in interface GridCacheProjection<K,V>key - Key whose mapping is to be removed from cache.filter - Optional filter to check prior to removing value form cache. Note
that filter is checked atomically together with remove operation.true
if optional filters passed validation and remove did occur, false otherwise.
Note that if filter is not specified, this method will return true.public GridFuture<Boolean> removexAsync(K key, @Nullable GridCacheEntryEx<K,V> entry, @Nullable GridPredicate<GridCacheEntry<K,V>>... filter)
GridCacheEntryImpl.removexAsync in interface GridCacheProjectionEx<K,V>key - Key to remove.entry - Cached entry. If not provided, equivalent to {GridCacheProjection#put}.filter - Optional filter.public GridCacheReturn<V> removex(K key, V val) throws GridException
If write-through is enabled, the value will be removed from GridCacheStore
via GridCacheStore.remove(GridCacheTx, Object) method.
GridCacheFlag.LOCAL, GridCacheFlag.READ.removex in interface GridCacheProjectionEx<K,V>key - Key whose mapping is to be removed from cache.val - Value to match against currently cached value.GridException - If remove failed.public void removeAllDr(Map<? extends K,GridCacheVersion> drMap) throws GridException
removeAllDr in interface GridCacheProjectionEx<K,V>drMap - DR map.GridException - If remove failed.public GridFuture<?> removeAllDrAsync(Map<? extends K,GridCacheVersion> drMap) throws GridException
removeAllDrAsync in interface GridCacheProjectionEx<K,V>drMap - DR map.GridException - If remove failed.public GridCacheReturn<V> replacex(K key, V oldVal, V newVal) throws GridException
'oldVal' passed in.
This method will return true if value is stored in cache and false otherwise.
If write-through is enabled, the stored value will be persisted to GridCacheStore
via GridCacheStore.put(GridCacheTx, Object, Object) method.
GridCacheFlag.LOCAL, GridCacheFlag.READ.replacex in interface GridCacheProjectionEx<K,V>key - Key to store in cache.oldVal - Old value to match.newVal - Value to be associated with the given key.GridException - If replace operation failed.public GridFuture<GridCacheReturn<V>> removexAsync(K key, V val)
This method will return true if remove did occur, which means that all optionally
provided filters have passed and there was something to remove, false otherwise.
If write-through is enabled, the value will be removed from GridCacheStore
via GridCacheStore.remove(GridCacheTx, Object) method.
GridCacheFlag.LOCAL, GridCacheFlag.READ.removexAsync in interface GridCacheProjectionEx<K,V>key - Key whose mapping is to be removed from cache.val - Value to match against currently cached value.public GridFuture<GridCacheReturn<V>> replacexAsync(K key, V oldVal, V newVal)
'oldVal' passed in.
This method will return true if value is stored in cache and false otherwise.
If write-through is enabled, the stored value will be persisted to GridCacheStore
via GridCacheStore.put(GridCacheTx, Object, Object) method.
GridCacheFlag.LOCAL, GridCacheFlag.READ.replacexAsync in interface GridCacheProjectionEx<K,V>key - Key to store in cache.oldVal - Old value to match.newVal - Value to be associated with the given key.public boolean remove(K key, V val) throws GridException
If write-through is enabled, the value will be removed from GridCacheStore
via GridCacheStore.remove(GridCacheTx, Object) method.
GridCacheFlag.LOCAL, GridCacheFlag.READ.remove in interface GridCacheProjection<K,V>key - Key whose mapping is to be removed from cache.val - Value to match against currently cached value.True if entry was removed and passed in value matched the cached one,
false otherwise.GridException - If remove failed.public GridFuture<Boolean> removeAsync(K key, V val)
This method will return true if remove did occur, which means that all optionally
provided filters have passed and there was something to remove, false otherwise.
If write-through is enabled, the value will be removed from GridCacheStore
via GridCacheStore.remove(GridCacheTx, Object) method.
GridCacheFlag.LOCAL, GridCacheFlag.READ.removeAsync in interface GridCacheProjection<K,V>key - Key whose mapping is to be removed from cache.val - Value to match against currently cached value.true
if currently cached value will match the passed in one.public void removeAll(GridPredicate<GridCacheEntry<K,V>>... filter) throws GridException
null, then all entries in cache will be enrolled
into transaction.
USE WITH CARE - if your cache has many entries that pass through the filter or if filter is empty, then transaction will quickly become very heavy and slow. Also, locks are acquired in undefined order, so it may cause a deadlock when used with other concurrent transactional updates.
If write-through is enabled, the values will be removed from GridCacheStore
via GridCacheStore.removeAll(GridCacheTx, Collection) method.
GridCacheFlag.LOCAL, GridCacheFlag.READ.removeAll in interface GridCacheProjection<K,V>filter - Filter used to supply keys for remove operation (if null,
then nothing will be removed).GridException - If remove failed.public GridFuture<?> removeAllAsync(GridPredicate<GridCacheEntry<K,V>>... filter)
null, then all entries in cache will be enrolled
into transaction.
USE WITH CARE - if your cache has many entries that pass through the filter or if filter is empty, then transaction will quickly become very heavy and slow.
If write-through is enabled, the values will be removed from GridCacheStore
via GridCacheStore.removeAll(GridCacheTx, Collection) method.
GridCacheFlag.LOCAL, GridCacheFlag.READ.removeAllAsync in interface GridCacheProjection<K,V>filter - Filter used to supply keys for remove operation (if null,
then nothing will be removed).public GridCacheMetrics metrics()
protected int drBackupQueueSize()
public GridCacheMetricsAdapter metrics0()
@Nullable public GridCacheTx tx()
null if this thread does
not have a transaction.tx in interface GridCacheProjection<K,V>null if this thread
does not have a transaction.public boolean lock(K key, long timeout, @Nullable GridPredicate<GridCacheEntry<K,V>>... filter) throws GridException
GridCacheTxConcurrency.PESSIMISTIC concurrency control for transaction
which will acquire explicit locks for relevant cache operations.
GridCacheFlag.LOCAL, GridCacheFlag.READ.lock in interface GridCacheProjection<K,V>key - Key to lock.timeout - Timeout in milliseconds to wait for lock to be acquired
('0' for no expiration), -1 for immediate failure if
lock cannot be acquired immediately).filter - Optional filter to validate prior to acquiring the lock.True if all filters passed and lock was acquired,
false otherwise.GridException - If lock acquisition resulted in error.public boolean lockAll(@Nullable Collection<? extends K> keys, long timeout, @Nullable GridPredicate<GridCacheEntry<K,V>>... filter) throws GridException
GridCacheTxConcurrency.PESSIMISTIC concurrency control for transaction
which will acquire explicit locks for relevant cache operations.
GridCacheFlag.LOCAL, GridCacheFlag.READ.lockAll in interface GridCacheProjection<K,V>keys - Keys to lock.timeout - Timeout in milliseconds to wait for lock to be acquired
('0' for no expiration).filter - Optional filter that needs to atomically pass in order for the locks
to be acquired.True if all filters passed and locks were acquired before
timeout has expired, false otherwise.GridException - If lock acquisition resulted in error.public GridFuture<Boolean> lockAsync(K key, long timeout, @Nullable GridPredicate<GridCacheEntry<K,V>>... filter)
GridCacheTxConcurrency.PESSIMISTIC concurrency control for transaction
which will acquire explicit locks for relevant cache operations.
GridCacheFlag.LOCAL, GridCacheFlag.READ.lockAsync in interface GridCacheProjection<K,V>key - Key to lock.timeout - Timeout in milliseconds to wait for lock to be acquired
('0' for no expiration, -1 for immediate failure if
lock cannot be acquired immediately).filter - Optional filter to validate prior to acquiring the lock.true
whenever all filters pass and locks are acquired before timeout is expired,
false otherwise.public void unlock(K key, GridPredicate<GridCacheEntry<K,V>>... filter) throws GridException
GridCacheTxConcurrency.PESSIMISTIC concurrency control for transaction
which will acquire explicit locks for relevant cache operations.
GridCacheFlag.LOCAL, GridCacheFlag.READ.unlock in interface GridCacheProjection<K,V>key - Key to unlock.filter - Optional filter that needs to pass prior to unlock taking effect.GridException - If unlock execution resulted in error.public boolean isLocked(K key)
This is a local in-VM operation and does not involve any network trips or access to persistent storage in any way.
isLocked in interface GridCacheProjection<K,V>key - Key to check.True if lock is owned by some node.public boolean isLockedByThread(K key)
This is a local in-VM operation and does not involve any network trips or access to persistent storage in any way.
isLockedByThread in interface GridCacheProjection<K,V>key - Key to check.True if key is locked by current thread.public GridCacheTx txStart() throws IllegalStateException
GridCacheConfiguration at startup.txStart in interface GridCacheProjection<K,V>IllegalStateException - If transaction is already started by this thread.public GridCacheTx txStart(GridCacheTxConcurrency concurrency, GridCacheTxIsolation isolation)
txStart in interface GridCacheProjection<K,V>concurrency - Concurrency.isolation - Isolation.public GridCacheTx txStart(GridCacheTxConcurrency concurrency, GridCacheTxIsolation isolation, long timeout, int txSize) throws IllegalStateException
txStart in interface GridCacheProjection<K,V>concurrency - Concurrency.isolation - Isolation.timeout - Timeout.txSize - Number of entries participating in transaction (may be approximate).IllegalStateException - If transaction is already started by this thread.public GridCacheTx txStartAffinity(Object affinityKey, GridCacheTxConcurrency concurrency, GridCacheTxIsolation isolation, long timeout, int txSize) throws IllegalStateException, GridException
affinity-group-locked transaction based on affinity key. In this mode only affinity key
is locked and all other entries in transaction are written without locking. However,
all keys in such transaction must have the same affinity key. Node on which transaction
is started must be primary for the given affinity key (an exception is thrown otherwise).
Since only affinity key is locked, and no individual keys, it is user's responsibility to make sure
there are no other concurrent explicit updates directly on individual keys participating in the
transaction. All updates to the keys involved should always go through affinity-group-locked
transaction, otherwise cache may be left in inconsistent state.
If cache sanity check is enabled (GridConfiguration.isCacheSanityCheckEnabled()),
the following checks are performed:
txStartAffinity in interface GridCacheProjection<K,V>affinityKey - Affinity key for all entries updated by transaction. This node
must be primary for this key.concurrency - Transaction concurrency control.isolation - Cache transaction isolation level.timeout - Timeout (0 for default).txSize - Number of entries participating in transaction (may be approximate), 0 for default.IllegalStateException - If transaction is already started by this thread.GridException - If local node is not primary for any of provided keys.public GridCacheTx txStartPartition(int partId, GridCacheTxConcurrency concurrency, GridCacheTxIsolation isolation, long timeout, int txSize) throws IllegalStateException, GridException
partition-group-locked transaction based on partition ID. In this mode the whole partition
is locked and all other entries in transaction are written without locking. However,
all keys in such transaction must belong to the same partition. Node on which transaction
is started must be primary for the given partition (an exception is thrown otherwise).
Since only partition is locked, and no individual keys, it is user's responsibility to make sure
there are no other concurrent explicit updates directly on individual keys participating in the
transaction. All updates to the keys involved should always go through partition-group-locked
transaction, otherwise, cache may be left in inconsistent state.
If cache sanity check is enabled (GridConfiguration.isCacheSanityCheckEnabled()),
the following checks are performed:
txStartPartition in interface GridCacheProjection<K,V>partId - Partition id for which transaction is started. This node
must be primary for this partition.concurrency - Transaction concurrency control.isolation - Cache transaction isolation level.timeout - Timeout (0 for default).txSize - Number of entries participating in transaction (may be approximate), 0 for default.IllegalStateException - If transaction is already started by this thread.GridException - If local node is not primary for any of provided keys.public long overflowSize()
throws GridException
overflowSize in interface GridCache<K,V>GridException - In case of error.public ConcurrentMap<K,V> toMap()
ConcurrentMap interface.toMap in interface GridCacheProjection<K,V>ConcurrentMap representation of given cache projection.protected void checkJta()
throws GridException
GridException - In case of error.public void txSynchronize(GridCacheTxSynchronization syncs)
txSynchronize in interface GridCache<K,V>syncs - Transaction synchronizations to register.public void txUnsynchronize(GridCacheTxSynchronization syncs)
txUnsynchronize in interface GridCache<K,V>syncs - Transactions synchronizations to remove.GridCache.txSynchronize(GridCacheTxSynchronization)public Collection<GridCacheTxSynchronization> txSynchronizations()
txSynchronizations in interface GridCache<K,V>GridCache.txSynchronize(GridCacheTxSynchronization)public void loadCache(GridBiPredicate<K,V> p, long ttl, Object[] args) throws GridException
GridCacheStore.loadCache(GridBiInClosure,Object...) method
to load state from the underlying persistent storage. The loaded values
will then be given to the optionally passed in predicate, and, if the predicate returns
true, will be stored in cache. If predicate is null, then
all loaded values will be stored in cache.
Note that this method does not receive keys as a parameter, so it is up to
GridCacheStore implementation to provide all the data to be loaded.
This method is not transactional and may end up loading a stale value into cache if another thread has updated the value immediately after it has been loaded. It is mostly useful when pre-loading the cache from underlying data store before start, or for read-only caches.
loadCache in interface GridCache<K,V>p - Optional predicate (may be null). If provided, will be used to
filter values to be put into cache.ttl - Time to live for loaded entries (0 for infinity).args - Optional user arguments to be passed into
GridCacheStore.loadCache(GridBiInClosure, Object...) method.GridException - If loading failed.public GridFuture<?> loadCacheAsync(GridBiPredicate<K,V> p, long ttl, Object[] args)
GridCacheStore.loadCache(GridBiInClosure, Object...) method
to reload state from the underlying persistent storage. The reloaded values
will then be given to the optionally passed in predicate, and if the predicate returns
true, will be stored in cache. If predicate is null, then
all reloaded values will be stored in cache.
Note that this method does not receive keys as a parameter, so it is up to
GridCacheStore implementation to provide all the data to be loaded.
This method is not transactional and may end up loading a stale value into cache if another thread has updated the value immediately after it has been loaded. It is mostly useful when pre-loading the cache from underlying data store before start, or for read-only caches.
loadCacheAsync in interface GridCache<K,V>p - Optional predicate (may be null). If provided, will be used to
filter values to be put into cache.ttl - Time to live for loaded entries (0 for infinity).args - Optional user arguments to be passed into
GridCacheStore.loadCache(GridBiInClosure,Object...) method.@Nullable public GridCacheEntry<K,V> randomEntry()
O(S * N/64)where
N is the size of internal hash
table and S is the number of hash table buckets to sample, which is 5
by default. However, if the table is pretty dense, with density factor of N/64,
which is true for near fully populated caches, this method will generally perform significantly
faster with complexity of O(S) where S = 5.
Note that this method is not available on GridCacheProjection API since it is
impossible (or very hard) to deterministically return a number value when pre-filtering
and post-filtering is involved (e.g. projection level predicate filters).
randomEntry in interface GridCache<K,V>null if cache is empty.public int size()
GridCache projection. It is essentially the
size of cache key set and is semantically identical to {GridCache.keySet().size().size in interface GridCacheProjection<K,V>public int nearSize()
null values and has O(1) complexity on base cache projection.
Note that for LOCAL caches this method will always return 0
nearSize in interface GridCacheProjection<K,V>0 if cache is not GridCacheMode.PARTITIONED.public int primarySize()
GridCacheMode.LOCAL mode,
this method is identical to GridCacheProjection.size().
For GridCacheMode.PARTITIONED and GridCacheMode.REPLICATED modes, this method will
return number of primary entries in the cache (excluding any backups). The complexity of this method
is O(P), where P is the total number of partitions.
primarySize in interface GridCacheProjection<K,V>public Iterator<GridCacheEntry<K,V>> iterator()
iterator in interface Iterable<GridCacheEntry<K,V>>@Nullable public V promote(K key) throws GridException
GridCacheFlag.SKIP_SWAP, GridCacheFlag.READ.promote in interface GridCacheProjection<K,V>key - Key to promote entry for.null for non-existing key.GridException - If promote failed.public void promoteAll(@Nullable Collection<? extends K> keys) throws GridException
GridCacheFlag.SKIP_SWAP, GridCacheFlag.READ.promoteAll in interface GridCacheProjection<K,V>keys - Keys to promote entries for.GridException - If promote failed.public Iterator<Map.Entry<K,V>> swapIterator() throws GridException
Returned iterator supports remove operation which delegates to
GridCacheProjection.removex(Object, GridPredicate[]) method.
GridCacheFlag.SKIP_SWAP.swapIterator in interface GridCache<K,V>GridException - If failed.GridCacheProjection.promote(Object)public Iterator<Map.Entry<K,V>> offHeapIterator() throws GridException
Returned iterator supports remove operation which delegates to
GridCacheProjection.removex(Object, GridPredicate[]) method.
offHeapIterator in interface GridCache<K,V>GridException - If failed.public long offHeapEntriesCount()
offHeapEntriesCount in interface GridCache<K,V>public long offHeapAllocatedSize()
offHeapAllocatedSize in interface GridCache<K,V>public long swapSize()
throws GridException
swapSize in interface GridCache<K,V>GridException - If failed.public long swapKeys()
throws GridException
swapKeys in interface GridCache<K,V>GridException - If failed.protected <T> GridFuture<T> asyncOp(GridCacheTxLocalAdapter<K,V> tx, GridCacheAdapter.AsyncOp<T> op)
T - Return type.tx - Transaction.op - Cache operation.protected void saveFuture(GridCacheAdapter.FutureHolder holder, GridFuture<?> fut)
holder - Future holder.fut - Future to save.@Nullable protected <T> GridFuture<T> asyncOpAcquire()
protected void asyncOpRelease()
public void writeExternal(ObjectOutput out) throws IOException
writeExternal in interface ExternalizableIOExceptionpublic void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal in interface ExternalizableIOExceptionClassNotFoundExceptionprotected Object readResolve() throws ObjectStreamException
ObjectStreamException - Thrown in case of demarshalling error.public void resetMetrics()
resetMetrics in interface GridCache<K,V>public void dgc()
GridCacheConfiguration.getDgcSuspectLockTimeout() to identify suspect locks.
Method blocks current thread until locks are examined and all DGC requests are sent to remote nodes.
DGC does not remove locks if GridCacheConfiguration.isDgcRemoveLocks()
is set to false.
public void dgc(long suspectLockTimeout,
boolean global,
boolean rmvLocks)
Method blocks current thread until locks are examined and all DGC requests are sent
to remote nodes and (if global is true) all nodes running this cache
will get signal to start GC procedure.
public GridFuture<?> forceRepartition()
GridCacheConfiguration.getPreloadPartitionedDelay() configuration parameter has non-zero value.
When many nodes are started or stopped almost concurrently, it is more efficient to delay
preloading until the node topology is stable to make sure that no redundant re-partitioning
happens.
In case ofGridCacheMode.PARTITIONED caches, for better efficiency user should
usually make sure that new nodes get placed on the same place of consistent hash ring as
the left nodes, and that nodes are restarted before
preloadDelay expires. To place nodes
on the same place in consistent hash ring, use
GridCacheConsistentHashAffinityFunction.setHashIdResolver(GridCacheAffinityNodeHashResolver) to make sure that
a node maps to the same hash ID if re-started.
See GridCacheConfiguration.getPreloadPartitionedDelay() for more information on how to configure
preload re-partition delay.
forceRepartition in interface GridCache<K,V>public boolean isGgfsDataCache()
isGgfsDataCache in interface GridCacheProjectionEx<K,V>True in case this cache is GGFS data cache.public long ggfsDataSpaceUsed()
ggfsDataSpaceUsed in interface GridCacheProjectionEx<K,V>public long ggfsDataSpaceMax()
ggfsDataSpaceMax in interface GridCacheProjectionEx<K,V>public boolean isMongoDataCache()
isMongoDataCache in interface GridCacheProjectionEx<K,V>True if this cache is mongo data cache.public boolean isMongoMetaCache()
isMongoMetaCache in interface GridCacheProjectionEx<K,V>True if this cache is mongo meta cache.public boolean isDrSystemCache()
isDrSystemCache in interface GridCacheProjectionEx<K,V>True if this cache is DR system cache.public void afterPessimisticUnlock(GridInClosure3<K,Boolean,GridCacheOperation> afterPessimisticUnlock)
afterPessimisticUnlock - After unlock callback.public GridInClosure3<K,Boolean,GridCacheOperation> afterPessimisticUnlock()
public GridFuture<?> drStateTransfer(Collection<Byte> dataCenterIds)
drStateTransfer in interface GridCacheProjectionEx<K,V>dataCenterIds - Data center IDs for which full state transfer was requested.public Collection<GridDrStateTransferDescriptor> drListStateTransfers()
drListStateTransfers in interface GridCacheProjectionEx<K,V>public void drPause()
drPause in interface GridCacheProjectionEx<K,V>public void drResume()
drResume in interface GridCacheProjectionEx<K,V>@Nullable public GridDrStatus drPauseState()
drPauseState in interface GridCacheProjectionEx<K,V>public void onGgfsDataSizeChanged(long delta)
delta - Size delta.public void clearAll0(Collection<? extends K> keys, @Nullable GridPredicate<GridCacheEntry<K,V>>... filter)
keys - Keys.filter - Filters to evaluate.public boolean clear0(K key, @Nullable GridPredicate<GridCacheEntry<K,V>>... filter)
key - Key.filter - Filters to evaluate.True if cleared.public boolean compact(K key, @Nullable GridPredicate<GridCacheEntry<K,V>>... filter) throws GridException
key - Key.filter - Filters to evaluate.True if compacted.GridException - If failed.public boolean evict(K key, @Nullable GridPredicate<GridCacheEntry<K,V>>... filter)
key - Key.filter - Filters to evaluate.True if evicted.public void evictAll(Collection<? extends K> keys, @Nullable GridPredicate<GridCacheEntry<K,V>>... filter)
keys - Keys.filter - Filters to evaluate.public boolean containsKey(K key, @Nullable GridPredicate<GridCacheEntry<K,V>> filter)
key - Key.filter - Filters to evaluate.True if contains key.public boolean containsAllKeys(@Nullable Collection<? extends K> keys, @Nullable GridPredicate<GridCacheEntry<K,V>> filter)
keys - Keys.filter - Filter to evaluate.True if contains all keys.public boolean containsAnyKeys(@Nullable Collection<? extends K> keys, @Nullable GridPredicate<GridCacheEntry<K,V>> filter)
keys - Keys.filter - Filter to evaluate.True if cache contains any of given keys.public boolean containsValue(V val, @Nullable GridPredicate<GridCacheEntry<K,V>> filter)
val - Value.filter - Filter to evaluate.True if contains value.public boolean containsAllValues(@Nullable Collection<? extends V> vals, @Nullable GridPredicate<GridCacheEntry<K,V>> filter)
vals - Values.filter - Filter to evaluate.True if contains all given values.public boolean containsAnyValues(@Nullable Collection<? extends V> vals, @Nullable GridPredicate<GridCacheEntry<K,V>> filter)
vals - Values.filter - Filter to evaluate.True if contains any of given values.public V peek(K key, @Nullable GridPredicate<GridCacheEntry<K,V>> filter)
key - Key.filter - Filter to evaluate.public Set<GridCacheEntry<K,V>> entrySet(@Nullable GridPredicate<GridCacheEntry<K,V>>... filter)
filter - Filters to evaluate.public Set<GridCacheEntry<K,V>> entrySet(@Nullable Collection<? extends K> keys, @Nullable GridPredicate<K> keyFilter, @Nullable GridPredicate<GridCacheEntry<K,V>>... filter)
keys - Keys.keyFilter - Key filter.filter - Entry filter.public Set<GridCacheEntry<K,V>> primaryEntrySet(@Nullable GridPredicate<GridCacheEntry<K,V>>... filter)
filter - Filters to evaluate.public Set<K> keySet(@Nullable GridPredicate<GridCacheEntry<K,V>>... filter)
filter - Filters to evaluate.public Set<K> primaryKeySet(@Nullable GridPredicate<GridCacheEntry<K,V>>... filter)
filter - Primary key set.public Collection<V> primaryValues(@Nullable GridPredicate<GridCacheEntry<K,V>>... filter)
filter - Filters to evaluate.public void compactAll(@Nullable Iterable<K> keys, @Nullable GridPredicate<GridCacheEntry<K,V>>... filter) throws GridException
keys - Keys.filter - Filters to evaluate.GridException - If failed.@Nullable public V get(K key, @Nullable GridPredicate<GridCacheEntry<K,V>> filter) throws GridException
key - Key.filter - Filter to evaluate.GridException - If failed.public final GridFuture<V> getAsync(K key, @Nullable GridPredicate<GridCacheEntry<K,V>> filter)
key - Key.filter - Filter to evaluate.public Map<K,V> getAll(Collection<? extends K> keys, GridPredicate<GridCacheEntry<K,V>> filter) throws GridException
keys - Keys.filter - Filter to evaluate.GridException - If read failed.@Nullable public V reload(K key, @Nullable GridPredicate<GridCacheEntry<K,V>>... filter) throws GridException
key - Key.filter - Filter to evaluate.GridException - If failed.public void reloadAll(@Nullable Collection<? extends K> keys, @Nullable GridPredicate<GridCacheEntry<K,V>>... filter) throws GridException
keys - Keys.filter - Filter to evaluate.GridException - If failed.public GridFuture<?> reloadAllAsync(@Nullable Collection<? extends K> keys, @Nullable GridPredicate<GridCacheEntry<K,V>>... filter)
keys - Keys.filter - Filter to evaluate.public GridFuture<V> reloadAsync(K key, @Nullable GridPredicate<GridCacheEntry<K,V>>... filter)
key - Key.filter - Filter to evaluate.public final void reloadAll(@Nullable GridPredicate<GridCacheEntry<K,V>>... filter) throws GridException
filter - Filter to evaluate.GridException - If reload failed.public GridFuture<?> reloadAllAsync(@Nullable GridPredicate<GridCacheEntry<K,V>> filter)
filter - Filter to evaluate.public GridFuture<Map<K,V>> getAllAsync(@Nullable Collection<? extends K> keys, @Nullable GridPredicate<GridCacheEntry<K,V>> filter)
keys - Keys.filter - Filter to evaluate.public abstract void onDeferredDelete(GridCacheEntryEx<K,V> entry, GridCacheVersion ver)
entry - Entry.ver - Version.protected void processCheckPreparedTxRequest(UUID nodeId, GridCacheOptimisticCheckPreparedTxRequest<K,V> req)
nodeId - Node ID.req - Request.protected void processCheckPreparedTxResponse(UUID nodeId, GridCacheOptimisticCheckPreparedTxResponse<K,V> res)
nodeId - Node ID.res - Response.protected void processCheckCommittedTxRequest(UUID nodeId, GridCachePessimisticCheckCommittedTxRequest<K,V> req)
nodeId - Node ID.req - Request.protected void processCheckCommittedTxResponse(UUID nodeId, GridCachePessimisticCheckCommittedTxResponse<K,V> res)
nodeId - Node ID.res - Response.Copyright © 2014. All rights reserved.