|
GridGain 3.6.0e
Enterprise Edition |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface GridCacheProjection<K,V>
This interface provides a rich API for working with distributed caches. It includes the following main functionality:
'get(..)' methods to synchronously or asynchronously get values from cache.
All 'get(..)' methods are transactional and will participate in an ongoing transaction
if there is one.
'put(..)', 'putIfAbsent(..)', and 'replace(..)' methods to
synchronously or asynchronously put single or multiple entries into cache.
All these methods are transactional and will participate in an ongoing transaction
if there is one.
'remove(..)' methods to synchronously or asynchronously remove single or multiple keys
from cache. All 'remove(..)' methods are transactional and will participate in an ongoing transaction
if there is one.
'contains(..)' method to check if cache contains certain keys or values.
'forEach(..)', 'forAny(..)', and 'reduce(..)' methods to visit
every cache entry within this projection.
flagsOn(..)', 'flagsOff(..)', and 'projection(..)' methods to
set specific flags and filters on a cache projection.
'keySet(..)', 'values(..)', and 'entrySet(..)' to provide
views on cache keys, values, and entries.
'peek(..)' methods to peek at values in global or transactional memory, swap
storage, or persistent storage.
'reload(..)' methods to reload latest values from persistent storage.
'unswap(..)' methods to load specified keys from swap storage into
global cache memory.
'invalidate(..)' methods to set cached values to null.
'lock(..)', 'unlock(..)', and 'isLocked(..)' methods to acquire, release,
and check on distributed locks on a single or multiple keys in cache. All locking methods
are not transactional and will not enlist keys into ongoing transaction, if any.
'clear(..)' methods to clear elements from cache, and optionally from
swap storage. All 'clear(..)' methods are not transactional and will not enlist cleared
keys into ongoing transaction, if any.
'evict(..)' methods to evict elements from cache, and optionally store
them in underlying swap storage for later access. All 'evict(..)' methods are not
transactional and will not enlist evicted keys into ongoing transaction, if any.
'txStart(..)' and 'inTx(..)' methods to perform various cache
operations within a transaction (see GridCacheTx for more information).
'createXxxQuery(..)' methods to query cache using either SQL,
LUCENE or H2TEXT text search, or
SCAN for filter-based full scan (see GridCacheQuery
for more information).
'mapKeysToNodes(..)' methods which provide node affinity mapping for
given keys. All 'mapKeysToNodes(..)' methods are not transactional and will not enlist
keys into ongoing transaction.
'gridProjection(..)' methods which provide GridProjection only
for nodes on which given keys reside. All 'gridProjection(..)' methods are not
transactional and will not enlist keys into ongoing transaction.
GridCacheProjection.toMap() to convert this interface into standard Java ConcurrentMap interface.
'x' provide the same functionality as their sibling
methods that don't end with 'x', however instead of returning a previous value they
return a boolean flag indicating whether operation succeeded or not. Returning
a previous value may involve a network trip or a persistent store lookup and should be
avoided whenever not needed.
'get(..)', 'put(..)', 'replace(..)',
and 'remove(..)' operations are transactional and will participate in an ongoing transaction,
if any. Other methods like 'peek(..)' or various 'contains(..)' methods may
be transaction-aware, i.e. check in-transaction entries first, but will not affect the current
state of transaction. See GridCacheTx documentation for more information
about transactions.
null keys or values are allowed to be stored in cache. If a null value
happens to be in cache (e.g. after invalidation or remove), then cache will treat this case
as there is no value at all.
All API method with @Nullable annotation on method parameters
or return values either accept or may return a null value. Parameters that do not
have this annotation cannot be null and invoking method with a null parameter
in this case will result in NullPointerException.
| Wiki | |
| Forum |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
| Method Summary | ||
|---|---|---|
Object |
affinityKey(K key)
Maps passed in key to a key which will be used for node affinity. |
|
Collection<GridRichNode> |
affinityNodes(K key)
Gets primary and backup nodes for the key. |
|
int[] |
allPartitions(GridProjection p)
Gets partition ids for which nodes of the given projection has ownership (either primary or backup). |
|
int[] |
backupPartitions(GridProjection p,
int... levels)
Gets partition ids for which nodes of the given projection has backup ownership. |
|
|
cache()
Gets base cache for this projection. |
|
boolean |
clear(K key,
GridPredicate<? super GridCacheEntry<K,V>>... filter)
Clears an entry from this cache and swap storage only if the entry is not currently locked, and is not participating in a transaction. |
|
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,
GridPredicate<? super GridCacheEntry<K,V>>... filter)
Clears all entries from this cache only if the entry is not currently locked, and is not participating in a transaction. |
|
void |
clearAll(GridPredicate<? super GridCacheEntry<K,V>>... filter)
Clears all entries from this cache only if the entry is not currently locked or participating in a transaction. |
|
void |
clearAll(K... keys)
Clears all entries from this cache only if the entry is not currently locked, is not participating in a transaction. |
|
boolean |
compact(K key,
GridPredicate<? super GridCacheEntry<K,V>>... filter)
Optimizes the size of an entry with given key. |
|
void |
compactAll(Collection<K> keys,
GridPredicate<? super GridCacheEntry<K,V>>... filter)
Optimizes the size of entries with given keys. |
|
void |
compactAll(K... keys)
Optimizes the size of entries with given keys. |
|
boolean |
containsAllEntries(GridPredicate<? super GridCacheEntry<K,V>>... filter)
Returns true if all cache entries pass through the filter. |
|
boolean |
containsAllKeys(Collection<? extends K> keys,
GridPredicate<? super GridCacheEntry<K,V>>... filter)
Returns true if this cache contains mappings for all the keys. |
|
boolean |
containsAllKeys(GridPredicate<? super K>... filter)
Returns true if this cache contains mappings for all the keys
that pass through the filter. |
|
boolean |
containsAllKeys(K... keys)
Returns true if this cache contains mappings for all the keys. |
|
boolean |
containsAllValues(Collection<? extends V> vals,
GridPredicate<? super GridCacheEntry<K,V>>... filter)
Returns true if this cache contains all the values. |
|
boolean |
containsAllValues(GridPredicate<? super V>... filter)
Returns true if all cache values pass through the filter. |
|
boolean |
containsAllValues(V... vals)
Returns true if this cache contains all the given values. |
|
boolean |
containsAnyEntries(GridPredicate<? super GridCacheEntry<K,V>>... filter)
Returns true if passed in predicate evaluates to true for any of the cache entries. |
|
boolean |
containsAnyKeys(Collection<? extends K> keys,
GridPredicate<? super GridCacheEntry<K,V>>... filter)
Returns true if this cache contains mappings for at least
one of the keys. |
|
boolean |
containsAnyKeys(GridPredicate<? super K>... filter)
Returns true if this cache contains mappings for at least
one of the keys. |
|
boolean |
containsAnyKeys(K... keys)
Returns true if this cache contains mappings for at least
one of the keys. |
|
boolean |
containsAnyValues(Collection<? extends V> vals,
GridPredicate<? super GridCacheEntry<K,V>>... filter)
Returns true if this cache contains mappings for at least one of the values. |
|
boolean |
containsAnyValues(GridPredicate<? super V>... filter)
Returns true if at least one of cache values passes through the filter. |
|
boolean |
containsAnyValues(V... vals)
Returns true if this cache contains mappings for at least one of the values. |
|
boolean |
containsKey(K key,
GridPredicate<? super GridCacheEntry<K,V>>... filter)
Returns true if this cache contains a mapping for the specified
key. |
|
boolean |
containsValue(V val,
GridPredicate<? super GridCacheEntry<K,V>>... filter)
Returns true if this cache contains given value. |
|
GridCacheQuery<K,V> |
createQuery(GridCacheQueryType type)
Creates user's query for given query type. |
|
GridCacheQuery<K,V> |
createQuery(GridCacheQueryType type,
Class<?> cls,
String clause)
Creates user's query for given query type, queried class, and query clause which is generally a where clause. |
|
GridCacheQuery<K,V> |
createQuery(GridCacheQueryType type,
String clsName,
String clause)
Creates user's query for given query type, queried class, and query clause which is generally a where clause. |
|
|
createReduceQuery()
Creates user's reduce query. |
|
|
createReduceQuery(GridCacheQueryType type)
Creates user's reduce query. |
|
|
createReduceQuery(GridCacheQueryType type,
Class<?> cls,
String clause)
Creates user's reduce query. |
|
|
createReduceQuery(GridCacheQueryType type,
String clsName,
String clause)
Creates user's reduce query. |
|
|
createTransformQuery()
Creates user's transform query. |
|
|
createTransformQuery(GridCacheQueryType type)
Creates user's transform query. |
|
|
createTransformQuery(GridCacheQueryType type,
Class<?> cls,
String clause)
Creates user's transform query. |
|
|
createTransformQuery(GridCacheQueryType type,
String clsName,
String clause)
Creates user's transform query. |
|
GridCacheEntry<K,V> |
entry(K key)
Gets entry from cache with the specified key. |
|
GridPredicate<? super GridCacheEntry<K,V>> |
entryPredicate()
Gets entry predicate on which this projection is based on or null
if entry predicate is not defined. |
|
Set<GridCacheEntry<K,V>> |
entrySet()
Gets set containing all cache entries. |
|
Set<GridCacheEntry<K,V>> |
entrySet(Collection<? extends K> keys,
GridPredicate<? super GridCacheEntry<K,V>>... filter)
Gets set containing all cache entries for given keys. |
|
Set<GridCacheEntry<K,V>> |
entrySet(GridPredicate<? super GridCacheEntry<K,V>>... filter)
Gets set containing all cache entries. |
|
Set<GridCacheEntry<K,V>> |
entrySet(K... keys)
Gets set containing all cache entries for given keys. |
|
boolean |
evict(K key,
GridPredicate<? super GridCacheEntry<K,V>>... filter)
Evicts entry associated with given key from cache. |
|
void |
evictAll()
Attempts to evict all cache entries. |
|
void |
evictAll(Collection<? extends K> keys,
GridPredicate<? super GridCacheEntry<K,V>>... filter)
Attempts to evict all entries associated with keys. |
|
void |
evictAll(GridPredicate<? super GridCacheEntry<K,V>>... filter)
Attempts to evict all cache entries. |
|
void |
evictAll(K... keys)
Attempts to evict all entries associated with keys. |
|
Set<GridCacheFlag> |
flags()
|
|
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<? super GridCacheEntry<K,V>> vis)
Tests whether the predicate holds for all entries. |
|
boolean |
forAll(GridPredicate<? super GridCacheEntry<K,V>> vis,
Collection<? extends K> keys)
Tests whether the predicate holds for all entries. |
|
boolean |
forAll(GridPredicate<? super GridCacheEntry<K,V>> vis,
K... keys)
Tests whether the predicate holds for all entries. |
|
GridFuture<Boolean> |
forAllAsync(GridPredicate<? super GridCacheEntry<K,V>> vis)
Asynchronously tests whether the predicate holds for all entries. |
|
GridFuture<Boolean> |
forAllAsync(GridPredicate<? super GridCacheEntry<K,V>> vis,
Collection<? extends K> keys)
Asynchronously tests whether the predicate holds for all entries. |
|
GridFuture<Boolean> |
forAllAsync(GridPredicate<? super GridCacheEntry<K,V>> vis,
K... keys)
Asynchronously tests whether the predicate holds for all entries. |
|
void |
forEach(GridInClosure<? super GridCacheEntry<K,V>> vis)
Executes visitor closure on each cache element. |
|
void |
forEach(GridInClosure<? super GridCacheEntry<K,V>> vis,
Collection<? extends K> keys)
Executes visitor closure on each cache element. |
|
void |
forEach(GridInClosure<? super GridCacheEntry<K,V>> vis,
K... keys)
Executes visitor closure on each cache element. |
|
GridFuture<?> |
forEachAsync(GridInClosure<? super GridCacheEntry<K,V>> vis)
Asynchronously executes visitor closure on each cache element. |
|
GridFuture<?> |
forEachAsync(GridInClosure<? super GridCacheEntry<K,V>> vis,
Collection<? extends K> keys)
Asynchronously executes visitor closure on each cache element. |
|
GridFuture<?> |
forEachAsync(GridInClosure<? super GridCacheEntry<K,V>> vis,
K... keys)
Asynchronously executes visitor closure on each cache element. |
|
V |
get(K key,
GridPredicate<? super GridCacheEntry<K,V>>... filter)
Retrieves value mapped to the specified key from cache. |
|
Map<K,V> |
getAll(Collection<? extends K> keys,
GridPredicate<? super GridCacheEntry<K,V>>... filter)
Retrieves values mapped to the specified keys from cache. |
|
Map<K,V> |
getAll(GridPredicate<? super GridCacheEntry<K,V>>... filter)
Retrieves all values whose entries pass the provided filter. |
|
Map<K,V> |
getAll(K... keys)
Retrieves values mapped to the specified keys from cache. |
|
GridFuture<Map<K,V>> |
getAllAsync(Collection<? extends K> keys,
GridPredicate<? super GridCacheEntry<K,V>>... filter)
Asynchronously retrieves values mapped to the specified keys from cache. |
|
GridFuture<Map<K,V>> |
getAllAsync(GridPredicate<? super GridCacheEntry<K,V>>... filter)
Asynchronously retrieves all values whose entries pass the provided filter. |
|
GridFuture<Map<K,V>> |
getAllAsync(K... keys)
Asynchronously retrieves values mapped to the specified keys from cache. |
|
GridFuture<V> |
getAsync(K key,
GridPredicate<? super GridCacheEntry<K,V>>... filter)
Asynchronously retrieves value mapped to the specified key from cache. |
|
GridProjection |
gridProjection()
Provides grid projection for all nodes participating in this cache. |
|
GridProjection |
gridProjection(Collection<? extends K> keys)
This method provides GridProjection for all nodes to which the
passed in keys are mapped. |
|
GridProjection |
gridProjection(GridPredicate<? super K>... filter)
This method provides GridProjection for all nodes to which all the
keys whose entries pass through the filter are mapped. |
|
GridProjection |
gridProjection(K... keys)
This method provides GridProjection for all nodes to which the
passed in keys are mapped. |
|
void |
inTx(GridCacheTxConcurrency concurrency,
GridCacheTxIsolation isolation,
GridInClosure<GridCacheProjection<K,V>>... closures)
Starts transaction with specified isolation and concurrency and sequentially executes given closures within it. |
|
|
inTx(GridCacheTxConcurrency concurrency,
GridCacheTxIsolation isolation,
GridOutClosure<? super R>... closures)
Starts transaction with specified isolation and concurrency and sequentially executes given closures within it. |
|
void |
inTx(GridCacheTxConcurrency concurrency,
GridCacheTxIsolation isolation,
long timeout,
boolean invalidate,
GridInClosure<GridCacheProjection<K,V>>... closures)
Starts transaction with specified isolation, concurrency, timeout, and invalidation flag and sequentially executes given closures within it. |
|
|
inTx(GridCacheTxConcurrency concurrency,
GridCacheTxIsolation isolation,
long timeout,
boolean invalidate,
GridOutClosure<? super R>... closures)
Starts transaction with specified isolation, concurrency, timeout, and invalidation flag and sequentially executes given closures within it. |
|
void |
inTx(GridInClosure<GridCacheProjection<K,V>>... closures)
Starts new transaction with default isolation, concurrency, and invalidation policy and sequentially executes given closures within it. |
|
|
inTx(GridOutClosure<? super R>... closures)
Starts transaction and sequentially executes given closures within it. |
|
void |
inTx(long timeout,
GridInClosure<GridCacheProjection<K,V>>... closures)
Starts new transaction with the specified timeout, isolation, concurrency and invalidation policy and sequentially executes given closures within it. |
|
|
inTx(long timeout,
GridOutClosure<? super R>... closures)
Starts new transaction with the specified timeout, isolation, concurrency and invalidation policy and sequentially executes given closures within it. |
|
GridFuture<?> |
inTxAsync(GridCacheTxConcurrency concurrency,
GridCacheTxIsolation isolation,
GridInClosure<GridCacheProjection<K,V>>... closures)
Starts transaction with specified isolation and concurrency and sequentially executes given closures within it. |
|
|
inTxAsync(GridCacheTxConcurrency concurrency,
GridCacheTxIsolation isolation,
GridOutClosure<? super R>... closures)
Starts transaction with specified isolation and concurrency and sequentially executes given closures within it. |
|
GridFuture<?> |
inTxAsync(GridCacheTxConcurrency concurrency,
GridCacheTxIsolation isolation,
long timeout,
boolean invalidate,
GridInClosure<GridCacheProjection<K,V>>... closures)
Starts transaction with specified isolation, concurrency, timeout, and invalidation flag and sequentially executes given closures within it. |
|
|
inTxAsync(GridCacheTxConcurrency concurrency,
GridCacheTxIsolation isolation,
long timeout,
boolean invalidate,
GridOutClosure<? super R>... closures)
Starts transaction with specified isolation, concurrency, timeout, and invalidation flag and sequentially executes given closures within it. |
|
GridFuture<?> |
inTxAsync(GridInClosure<GridCacheProjection<K,V>>... closures)
Starts new transaction with default isolation, concurrency, and invalidation policy and sequentially executes given closures within it. |
|
|
inTxAsync(GridOutClosure<? super R>... closures)
Starts transaction and sequentially executes given closures within it. |
|
GridFuture<?> |
inTxAsync(long timeout,
GridInClosure<GridCacheProjection<K,V>>... closures)
Starts new transaction with the specified timeout, isolation, concurrency and invalidation policy and sequentially executes given closures within it. |
|
|
inTxAsync(long timeout,
GridOutClosure<? super R>... closures)
Starts new transaction with the specified timeout, isolation, concurrency and invalidation policy and sequentially executes given closures within it. |
|
boolean |
invalidate(K key,
GridPredicate<? super GridCacheEntry<K,V>>... filter)
Invalidates (nullifies) an entry with given key. |
|
void |
invalidateAll(Collection<K> keys,
GridPredicate<? super GridCacheEntry<K,V>>... filter)
Invalidates (nullifies) all entries. |
|
void |
invalidateAll(K... keys)
Invalidates (nullifies) all entries. |
|
boolean |
isAllLocked(Collection<? extends K> keys)
Checks if every key provided is locked by some grid node. |
|
boolean |
isAllLocked(GridPredicate<? super K>... filter)
Checks if every key provided by the filter is locked by some grid node. |
|
boolean |
isAllLocked(K... keys)
Checks if every key provided is locked by some grid node. |
|
boolean |
isAllLockedByThread(Collection<? extends K> keys)
Checks if every key provided is locked by the current thread. |
|
boolean |
isAllLockedByThread(GridPredicate<? super K>... filter)
Checks if every key provided by the filter is locked by the current thread. |
|
boolean |
isAllLockedByThread(K... keys)
Checks if every key provided is locked by the current thread. |
|
boolean |
isEmpty()
Returns true if this map contains no key-value mappings. |
|
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. |
|
Set<K> |
keySet()
Set of cached keys. |
|
Set<K> |
keySet(Collection<? extends K> keys,
GridPredicate<? super GridCacheEntry<K,V>>... filter)
Set of cached keys. |
|
Set<K> |
keySet(GridPredicate<? super GridCacheEntry<K,V>>... filter)
Set of cached keys. |
|
Set<K> |
keySet(K... keys)
Set of cached keys. |
|
int |
keySize()
Gets size of cache key set. |
|
GridPredicate2<K,V> |
keyValuePredicate()
Gets key-value predicate on which this projection is based on or null
if key-value predicate is not defined. |
|
boolean |
lock(K key,
GridPredicate<? super GridCacheEntry<K,V>>... filter)
Synchronously acquires lock on a cached object with given key only if the passed in filter (if any) passes. |
|
boolean |
lock(K key,
long timeout,
GridPredicate<? super 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,
GridPredicate<? super GridCacheEntry<K,V>>... filter)
All or nothing synchronous lock for passed in keys. |
|
boolean |
lockAll(Collection<? extends K> keys,
long timeout,
GridPredicate<? super GridCacheEntry<K,V>>... filter)
All or nothing synchronous lock for passed in keys. |
|
boolean |
lockAll(GridPredicate<? super GridCacheEntry<K,V>>... filter)
All or nothing synchronous lock for passed in filter. |
|
boolean |
lockAll(K... keys)
All or nothing synchronous lock for passed in keys. |
|
boolean |
lockAll(long timeout,
GridPredicate<? super GridCacheEntry<K,V>>... filter)
All or nothing synchronous lock for passed in filter. |
|
boolean |
lockAll(long timeout,
K... keys)
All or nothing synchronous lock for passed in keys. |
|
GridFuture<Boolean> |
lockAllAsync(Collection<? extends K> keys,
GridPredicate<? super GridCacheEntry<K,V>>... filter)
All or nothing synchronous lock for passed in keys. |
|
GridFuture<Boolean> |
lockAllAsync(Collection<? extends K> keys,
long timeout,
GridPredicate<? super GridCacheEntry<K,V>>... filter)
All or nothing synchronous lock for passed in keys. |
|
GridFuture<Boolean> |
lockAllAsync(GridPredicate<? super GridCacheEntry<K,V>>... filter)
All or nothing asynchronous lock for passed in filter. |
|
GridFuture<Boolean> |
lockAllAsync(K... keys)
All or nothing synchronous lock for passed in keys. |
|
GridFuture<Boolean> |
lockAllAsync(long timeout,
GridPredicate<? super GridCacheEntry<K,V>>... filter)
All or nothing asynchronous lock for passed in filter. |
|
GridFuture<Boolean> |
lockAllAsync(long timeout,
K... keys)
All or nothing synchronous lock for passed in keys. |
|
GridFuture<Boolean> |
lockAsync(K key,
GridPredicate<? super GridCacheEntry<K,V>>... filter)
Asynchronously acquires lock on a cached object with given key only if the passed in filter (if any) passes. |
|
GridFuture<Boolean> |
lockAsync(K key,
long timeout,
GridPredicate<? super GridCacheEntry<K,V>>... filter)
Asynchronously acquires lock on a cached object with given key only if the passed in filter (if any) passes. |
|
Map<GridRichNode,Collection<K>> |
mapKeysToNodes(Collection<? extends K> keys)
This method provides ability to detect which keys are mapped to which nodes. |
|
Map<GridRichNode,Collection<K>> |
mapKeysToNodes(GridPredicate<? super K>... filter)
This method provides ability to detect which keys are mapped to which nodes. |
|
Map<GridRichNode,Collection<K>> |
mapKeysToNodes(K... keys)
This method provides ability to detect which keys are mapped to which nodes. |
|
GridRichNode |
mapKeyToNode(K key)
This method provides ability to detect to which primary node the given key is mapped. |
|
Map<Integer,GridRichNode> |
mapPartitionsToNodes(Collection<Integer> parts)
Gets primary nodes for the given partitions. |
|
Map<Integer,GridRichNode> |
mapPartitionsToNodes(int[] parts)
Gets primary nodes for the given partitions. |
|
Map<Integer,GridRichNode> |
mapPartitionsToNodes(int part,
int... parts)
Gets primary nodes for the given partitions. |
|
GridRichNode |
mapPartitionToNode(int part)
Gets primary node for the given partition. |
|
String |
name()
Gets name of this cache ( null for default cache). |
|
|
parent()
Returns parent projection from which this projection was created. |
|
int |
partition(K key)
Gets partition id for the given key. |
|
int |
partitions()
Gets number of partitions in cache according to configured affinity function. |
|
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,
GridCachePeekMode... modes)
Peeks at cached value using optional set of peek modes. |
|
V |
peek(K key,
GridPredicate<? super GridCacheEntry<K,V>>... filter)
Peeks at in-memory cached value using default GridCachePeekMode.SMART
peek mode. |
|
Map<K,V> |
peekAll(Collection<? extends K> keys)
Peeks at in-memory cached values using default GridCachePeekMode.SMART
peek mode. |
|
Map<K,V> |
peekAll(Collection<? extends K> keys,
Collection<GridCachePeekMode> modes)
Peeks at cached values using optional set of peek modes. |
|
Map<K,V> |
peekAll(Collection<? extends K> keys,
GridCachePeekMode... modes)
Peeks at cached values using optional set of peek modes. |
|
Map<K,V> |
peekAll(Collection<? extends K> keys,
GridPredicate<? super GridCacheEntry<K,V>>... filter)
Peeks at in-memory cached value using default GridCachePeekMode.SMART
peek mode. |
|
Map<K,V> |
peekAll(GridPredicate<? super GridCacheEntry<K,V>>... filter)
Peeks at in-memory cached value using default GridCachePeekMode.SMART
peek mode. |
|
Map<K,V> |
peekAll(K... keys)
Peeks at in-memory cached values using default GridCachePeekMode.SMART
peek mode. |
|
GridFuture<Map<K,V>> |
peekAllAsync(Collection<? extends K> keys,
Collection<GridCachePeekMode> modes)
Asynchronously peeks at cached values using optional set of peek modes. |
|
GridFuture<Map<K,V>> |
peekAllAsync(Collection<? extends K> keys,
GridCachePeekMode... modes)
Asynchronously peeks at cached values using optional set of peek modes. |
|
GridFuture<V> |
peekAsync(K key,
Collection<GridCachePeekMode> modes)
Asynchronously peeks at cached value using optional set of peek modes. |
|
GridFuture<V> |
peekAsync(K key,
GridCachePeekMode... modes)
Asynchronously peeks at cached value using optional set of peek modes. |
|
Set<GridCacheEntry<K,V>> |
primaryEntrySet()
Gets set containing cache entries for which local node is the primary node. |
|
Set<GridCacheEntry<K,V>> |
primaryEntrySet(Collection<? extends K> keys,
GridPredicate<? super GridCacheEntry<K,V>>... filter)
Gets set containing cache entries for which local node is the primary node. |
|
Set<GridCacheEntry<K,V>> |
primaryEntrySet(GridPredicate<? super GridCacheEntry<K,V>>... filter)
Gets set containing cache entries for which local node is the primary node. |
|
Set<GridCacheEntry<K,V>> |
primaryEntrySet(K... keys)
Gets set containing cache entries for which local node is the primary node. |
|
Set<K> |
primaryKeySet()
Set of cached primary keys for which local node is the primary node. |
|
Set<K> |
primaryKeySet(Collection<? extends K> keys,
GridPredicate<? super GridCacheEntry<K,V>>... filter)
Set of cached primary keys for which local node is the primary node. |
|
Set<K> |
primaryKeySet(GridPredicate<? super GridCacheEntry<K,V>>... filter)
Set of cached primary keys for which local node is the primary node. |
|
Set<K> |
primaryKeySet(K... keys)
Set of cached primary keys for which local node is the primary node. |
|
int[] |
primaryPartitions(GridProjection p)
Gets partition ids for which nodes of the given projection has primary ownership. |
|
Collection<V> |
primaryValues()
Collection of primary cached values.for which local node is the primary node. |
|
Collection<V> |
primaryValues(Collection<? extends K> keys,
GridPredicate<? super GridCacheEntry<K,V>>... filter)
Collection of primary cached values.for which local node is the primary node. |
|
Collection<V> |
primaryValues(GridPredicate<? super GridCacheEntry<K,V>>... filter)
Collection of primary cached values.for which local node is the primary node. |
|
Collection<V> |
primaryValues(K... keys)
Collection of primary cached values.for which local node is the primary node. |
|
|
projection(Class<?> keyType,
Class<?> valType)
Gets cache projection only for given key and value type. |
|
GridCacheProjection<K,V> |
projection(GridPredicate<? super GridCacheEntry<K,V>>... filter)
Gets cache projection based on given entry filter. |
|
GridCacheProjection<K,V> |
projection(GridPredicate2<K,V>... p)
Gets cache projection based on given key-value predicate. |
|
V |
put(K key,
V val,
GridPredicate<? super GridCacheEntry<K,V>>... filter)
Stores given key-value pair in cache. |
|
void |
putAll(Map<? extends K,? extends V> m,
GridPredicate<? super GridCacheEntry<K,V>>... filter)
Stores given key-value pairs in cache. |
|
GridFuture<?> |
putAllAsync(Map<? extends K,? extends V> m,
GridPredicate<? super GridCacheEntry<K,V>>... filter)
Asynchronously stores given key-value pairs in cache. |
|
GridFuture<V> |
putAsync(K key,
V val,
GridPredicate<? super 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,
GridPredicate<? super GridCacheEntry<K,V>>... filter)
Stores given key-value pair in cache. |
|
GridFuture<Boolean> |
putxAsync(K key,
V val,
GridPredicate<? super 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. |
|
|
reduce(GridReducer<? super GridCacheEntry<K,V>,R> rdc)
Visits every cache entry and then reduces the result. |
|
|
reduce(GridReducer<? super GridCacheEntry<K,V>,R> rdc,
Collection<? extends K> keys)
Visits specified cache entries and then reduces the result. |
|
|
reduce(GridReducer<? super GridCacheEntry<K,V>,R> rdc,
K... keys)
Visits specified cache entries and then reduces the result. |
|
|
reduceAsync(GridReducer<? super GridCacheEntry<K,V>,R> rdc)
Asynchronously visits every cache entry and then reduces the result. |
|
|
reduceAsync(GridReducer<? super GridCacheEntry<K,V>,R> rdc,
Collection<? extends K> keys)
Asynchronously visits specified cache entries and then reduces the result. |
|
|
reduceAsync(GridReducer<? super GridCacheEntry<K,V>,R> rdc,
K... keys)
Asynchronously visits specified cache entries and then reduces the result. |
|
V |
reload(K key,
GridPredicate<? super GridCacheEntry<K,V>>... filter)
Reloads a single key from persistent storage. |
|
void |
reloadAll()
Reloads all currently cached keys form persistent storage. |
|
void |
reloadAll(Collection<? extends K> keys,
GridPredicate<? super GridCacheEntry<K,V>>... filter)
Reloads specified entries from underlying persistent storage. |
|
void |
reloadAll(GridPredicate<? super GridCacheEntry<K,V>>... filter)
Reloads all currently cached entries which pass the passed in filter from the underlying persistent storage. |
|
void |
reloadAll(K... keys)
Reloads specified entries from underlying persistent storage. |
|
GridFuture<?> |
reloadAllAsync()
Asynchronously reloads all specified entries from underlying persistent storage. |
|
GridFuture<?> |
reloadAllAsync(Collection<? extends K> keys,
GridPredicate<? super GridCacheEntry<K,V>>... filter)
Asynchronously reloads all specified entries from underlying persistent storage. |
|
GridFuture<?> |
reloadAllAsync(GridPredicate<? super GridCacheEntry<K,V>>... filter)
Asynchronously reloads all currently cached entries which pass the filter from the underlying persistent storage. |
|
GridFuture<?> |
reloadAllAsync(K... keys)
Asynchronously reloads all specified entries from underlying persistent storage. |
|
GridFuture<V> |
reloadAsync(K key,
GridPredicate<? super GridCacheEntry<K,V>>... filter)
Asynchronously reloads a single key from persistent storage. |
|
V |
remove(K key,
GridPredicate<? super 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<? super GridCacheEntry<K,V>>... filter)
Removes given key mappings from cache for entries for which the optionally passed in filters do pass. |
|
void |
removeAll(GridPredicate<? super 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<? super 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<? super GridCacheEntry<K,V>>... filter)
Asynchronously removes mappings from cache for entries for which the optionally passed in filters do pass. |
|
GridFuture<V> |
removeAsync(K key,
GridPredicate<? super 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. |
|
boolean |
removex(K key,
GridPredicate<? super GridCacheEntry<K,V>>... filter)
Removes given key mapping from cache. |
|
GridFuture<Boolean> |
removexAsync(K key,
GridPredicate<? super GridCacheEntry<K,V>>... filter)
Asynchronously removes given key mapping from cache. |
|
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. |
|
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. |
|
int |
size()
Gets size of this cache projection. |
|
ConcurrentMap<K,V> |
toMap()
Converts this API into standard Java ConcurrentMap interface. |
|
GridCacheTx |
tx()
Gets transaction started by this thread or null if this thread does
not have a transaction. |
|
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,
boolean invalidate)
Starts transaction with specified isolation, concurrency, timeout, and invalidation flag. |
|
GridCacheTx |
txStart(long timeout)
Starts new transaction with the specified timeout and default concurrency, isolation, and invalidation policy. |
|
void |
unlock(K key,
GridPredicate<? super GridCacheEntry<K,V>>... filter)
Unlocks given key only if current thread owns the lock. |
|
void |
unlockAll(Collection<? extends K> keys,
GridPredicate<? super GridCacheEntry<K,V>>... filter)
Unlocks given keys only if current thread owns the locks. |
|
void |
unlockAll(GridPredicate<? super GridCacheEntry<K,V>>... filter)
Unlock the keys supplied by the given filter only if current thread owns the locks. |
|
void |
unlockAll(K... keys)
Unlocks given keys only if current thread owns the locks. |
|
V |
unswap(K key)
This method unswaps cache entry by given key, if any, from swap storage into memory. |
|
void |
unswapAll(Collection<? extends K> keys)
This method unswaps cache entries by given keys, if any, from swap storage into memory. |
|
void |
unswapAll(K... keys)
This method unswaps cache entries by given keys, if any, from swap storage into memory. |
|
Collection<V> |
values()
Collection of cached values. |
|
Collection<V> |
values(Collection<? extends K> keys,
GridPredicate<? super GridCacheEntry<K,V>>... filter)
Collection of cached values for given keys. |
|
Collection<V> |
values(GridPredicate<? super GridCacheEntry<K,V>>... filter)
Collection of cached values. |
|
Collection<V> |
values(K... keys)
Collection of cached values for given keys. |
|
| Methods inherited from interface java.lang.Iterable |
|---|
iterator |
| Methods inherited from interface org.gridgain.grid.GridMetadataAware |
|---|
addMeta, addMetaIfAbsent, addMetaIfAbsent, allMeta, copyMeta, copyMeta, hasMeta, hasMeta, meta, putMetaIfAbsent, putMetaIfAbsent, removeMeta, removeMeta, replaceMeta |
| Method Detail |
|---|
String name()
null for default cache).
@Nullable <K,V> GridCacheProjection<K,V> parent()
K - Key type of parent projection.V - Value type of parent projection.
<K,V> GridCache<K,V> cache()
K - Cache key type.V - Cache value type.
Set<GridCacheFlag> flags()
@Nullable GridPredicate2<K,V> keyValuePredicate()
null
if key-value predicate is not defined.
@Nullable GridPredicate<? super GridCacheEntry<K,V>> entryPredicate()
null
if entry predicate is not defined.
<K1,V1> GridCacheProjection<K1,V1> projection(Class<?> keyType, Class<?> valType)
non-null key-value
pairs that have matching key and value pairs will be used in this projection.
GridCacheFlag.STRICT set on it.
K1 - Key type.V1 - Value type.keyType - Key type.valType - Value type.
GridCacheProjection<K,V> projection(@Nullable GridPredicate2<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.
GridCacheFlag.STRICT set on it.
p - Key-value predicate for this projection. If null, then the
same projection is returned.
GridCacheProjection<K,V> projection(@Nullable GridPredicate<? super GridCacheEntry<K,V>>... filter)
GridCacheProjection.projection(GridPredicate2[])
method, this filter will not be used for pre-filtering.
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'.
GridCacheProjection<K,V> flagsOn(@Nullable GridCacheFlag... flags)
flags - Flags to turn on (if empty, then no-op).
GridCacheProjection<K,V> flagsOff(@Nullable GridCacheFlag... flags)
flags - Flags to turn off (if empty, then all flags will be turned off).
boolean isEmpty()
true if this map contains no key-value mappings.
true if this map contains no key-value mappings.
boolean containsKey(K key,
@Nullable
GridPredicate<? super GridCacheEntry<K,V>>... filter)
true if this cache contains a mapping for the specified
key.
NullPointerException - if the key is null.key - key whose presence in this map is to be tested.filter - Filter to test prior to checking containment.
true if this map contains a mapping for the specified key.
boolean containsAllKeys(@Nullable
Collection<? extends K> keys,
@Nullable
GridPredicate<? super GridCacheEntry<K,V>>... filter)
true if this cache contains mappings for all the keys.
If passed in keys are empty or null, then true is returned.
keys - Keys to check.filter - Filter to test prior to checking for containment.
true if this cache contains mappings for all given keys.
boolean containsAllKeys(@Nullable
K... keys)
true if this cache contains mappings for all the keys.
If passed in keys are empty, then true is returned.
keys - Keys to check.
true if this cache contains mappings for all the keys.
boolean containsValue(V val,
@Nullable
GridPredicate<? super GridCacheEntry<K,V>>... filter)
true if this cache contains given value.
NullPointerException - if the value is null.val - Value to check.filter - Filter to test prior to checking for containment.
True if given value is present in cache.
boolean containsAllKeys(@Nullable
GridPredicate<? super K>... filter)
true if this cache contains mappings for all the keys
that pass through the filter. If cache is empty then true is returned.
filter - Key filter to check.
True if this filter returns true for all cache keys.
boolean containsAnyKeys(@Nullable
Collection<? extends K> keys,
@Nullable
GridPredicate<? super GridCacheEntry<K,V>>... filter)
true if this cache contains mappings for at least
one of the keys. If passed in keys are empty, then
false is returned.
keys - Keys to check.filter - Filter to test prior to checking containment.
true if this cache contains mappings for at least
one of the keys.
boolean containsAnyKeys(@Nullable
K... keys)
true if this cache contains mappings for at least
one of the keys. If passed in keys are empty, then
false is returned.
keys - Keys to check.
true if this cache contains mappings for at least
one of the keys.
boolean containsAnyKeys(@Nullable
GridPredicate<? super K>... filter)
true if this cache contains mappings for at least
one of the keys. If cache is empty, then false is returned.
filter - Key filter to check.
true if this cache contains mappings for at least
one of the keys that passes through the filter.
boolean containsAllValues(@Nullable
Collection<? extends V> vals,
@Nullable
GridPredicate<? super GridCacheEntry<K,V>>... filter)
true if this cache contains all the values.
If cache is empty, then true is returned.
vals - Values to check.filter - Filter to test prior to checking containment.
true if this cache contains all the values.
boolean containsAllValues(@Nullable
V... vals)
true if this cache contains all the given values.
If cache is empty, then true is returned.
vals - Values to check.
true if this cache contains all the values.
boolean containsAllValues(@Nullable
GridPredicate<? super V>... filter)
true if all cache values pass through the filter.
If cache is empty, then true is returned.
filter - Value filter to check.
true if all cache values pass through the filter.
boolean containsAnyValues(@Nullable
Collection<? extends V> vals,
@Nullable
GridPredicate<? super GridCacheEntry<K,V>>... filter)
true if this cache contains mappings for at least one of the values.
If cache is empty, then false is returned.
vals - Values to check.filter - Filter to test prior to checking containment.
true if this cache contains mappings for at least
one of the values.
boolean containsAnyValues(@Nullable
V... vals)
true if this cache contains mappings for at least one of the values.
If cache is empty, then false is returned.
vals - Values to check.
true if this cache contains mappings for at least
one of the values.
boolean containsAnyValues(@Nullable
GridPredicate<? super V>... filter)
true if at least one of cache values passes through the filter.
If cache is empty, then false is returned.
filter - Filter to check.
true if at least one of cache values passes through the filter.
boolean containsAnyEntries(@Nullable
GridPredicate<? super GridCacheEntry<K,V>>... filter)
true if passed in predicate evaluates to true for any of the cache entries.
If cache is empty, then false is returned.
filter - Entry filter to check.
True if passed in predicate evaluates to true for
any of the cache entries, false otherwise.
boolean containsAllEntries(@Nullable
GridPredicate<? super GridCacheEntry<K,V>>... filter)
true if all cache entries pass through the filter.
If cache is empty, then true is returned.
filter - Entry filter to check.
True if all cache entries pass through the filter.void forEach(GridInClosure<? super GridCacheEntry<K,V>> vis, @Nullable Collection<? extends K> keys)
vis - Closure which will be invoked for each cache entry.keys - Keys to visit.GridFuture<?> forEachAsync(GridInClosure<? super GridCacheEntry<K,V>> vis, @Nullable Collection<? extends K> keys)
vis - Closure which will be invoked for each cache entry.keys - Keys to visit.
void forEach(GridInClosure<? super GridCacheEntry<K,V>> vis)
vis - Closure which will be invoked for each cache entry.GridFuture<?> forEachAsync(GridInClosure<? super GridCacheEntry<K,V>> vis)
vis - Closure which will be invoked for each cache entry.
void forEach(GridInClosure<? super GridCacheEntry<K,V>> vis, @Nullable K... keys)
vis - Closure which will be invoked for each cache entry.keys - Keys to visit.GridFuture<?> forEachAsync(GridInClosure<? super GridCacheEntry<K,V>> vis, @Nullable K... keys)
vis - Closure which will be invoked for each cache entry.keys - Keys to visit.
boolean forAll(GridPredicate<? super GridCacheEntry<K,V>> vis)
true is returned.
vis - Predicate to test for each cache entry.
True if the given predicate holds for all visited entries, false otherwise.GridFuture<Boolean> forAllAsync(GridPredicate<? super GridCacheEntry<K,V>> vis)
true is returned.
vis - Predicate to test for each cache entry.
boolean forAll(GridPredicate<? super GridCacheEntry<K,V>> vis, @Nullable Collection<? extends K> keys)
true is returned.
vis - Predicate to test for each cache entry.keys - Keys to visit.
True if the given predicate holds for all visited entries, false otherwise.GridFuture<Boolean> forAllAsync(GridPredicate<? super GridCacheEntry<K,V>> vis, @Nullable Collection<? extends K> keys)
true is returned.
vis - Predicate to test for each cache entry.keys - Keys to visit.
boolean forAll(GridPredicate<? super GridCacheEntry<K,V>> vis, @Nullable K... keys)
true is returned.
vis - Predicate to test for each cache entry.keys - Keys to visit.
True if the given predicate holds for all visited entries, false otherwise.GridFuture<Boolean> forAllAsync(GridPredicate<? super GridCacheEntry<K,V>> vis, @Nullable K... keys)
true is returned.
vis - Predicate to test for each cache entry.keys - Keys to visit.
@Nullable <R> R reduce(GridReducer<? super GridCacheEntry<K,V>,R> rdc)
rdc - Reducer which will be invoked for all keys-value pairs and
eventually return a value at the end.
<R> GridFuture<R> reduceAsync(GridReducer<? super GridCacheEntry<K,V>,R> rdc)
rdc - Reducer which will be invoked for all keys-value pairs and
eventually return a value at the end.
@Nullable <R> R reduce(GridReducer<? super GridCacheEntry<K,V>,R> rdc, @Nullable Collection<? extends K> keys)
rdc - Reducer which will be invoked for all keys-value pairs and
eventually return a value at the end.keys - Keys to visit.
<R> GridFuture<R> reduceAsync(GridReducer<? super GridCacheEntry<K,V>,R> rdc, @Nullable Collection<? extends K> keys)
rdc - Reducer which will be invoked for all keys-value pairs and
eventually return a value at the end.keys - Keys to visit.
@Nullable <R> R reduce(GridReducer<? super GridCacheEntry<K,V>,R> rdc, @Nullable K... keys)
rdc - Reducer which will be invoked for all keys-value pairs and
eventually return a value at the end.keys - Keys to visit.
<R> GridFuture<R> reduceAsync(GridReducer<? super GridCacheEntry<K,V>,R> rdc, @Nullable K... keys)
rdc - Reducer which will be invoked for all keys-value pairs and
eventually return a value at the end.keys - Keys to visit.
@Nullable
V reload(K key,
@Nullable
GridPredicate<? super GridCacheEntry<K,V>>... filter)
throws GridException
GridCacheStore.load(String, GridCacheTx, Object)
method.
GridException - If reloading failed.key - Key to reload.filter - Optional filter. If provided, will be used to filter entries before
loading and before they get set into cache.
GridFuture<V> reloadAsync(K key, @Nullable GridPredicate<? super GridCacheEntry<K,V>>... filter)
GridCacheStore.load(String, GridCacheTx, Object)
method.
key - Key to reload.filter - Optional filter. If provided, will be used to filter entries before
loading and before they get set into cache.
void reloadAll()
throws GridException
GridException - If reloading failed.GridFuture<?> reloadAllAsync()
reload completes.
void reloadAll(@Nullable
Collection<? extends K> keys,
@Nullable
GridPredicate<? super GridCacheEntry<K,V>>... filter)
throws GridException
GridException - if reloading failed.keys - Keys to reload.filter - Optional filter. If provided, will be used to filter key-value pairs
to be put into cache.GridFuture<?> reloadAllAsync(@Nullable Collection<? extends K> keys, @Nullable GridPredicate<? super GridCacheEntry<K,V>>... filter)
keys - Keys to reload.filter - Optional filter. If provided, will be used to filter key-value pairs
to be put into cache.
reload completes.
void reloadAll(@Nullable
K... keys)
throws GridException
GridException - if reloading failed.keys - Keys to reload.GridFuture<?> reloadAllAsync(@Nullable K... keys)
keys - Keys to reload.
reload completes.
void reloadAll(@Nullable
GridPredicate<? super GridCacheEntry<K,V>>... filter)
throws GridException
GridCacheStore.loadAll(String, GridCacheTx, Collection, GridInClosure2)
method, and is different from GridCache.loadCache(GridPredicate2, long, Object...)
in the sense that only all currently cached keys are reloaded.
GridException - If reloading failed.filter - Optional filter. If provided, will be used to filter key-value pairs
to be put into cache.GridFuture<?> reloadAllAsync(@Nullable GridPredicate<? super GridCacheEntry<K,V>>... filter)
GridCacheStore.loadAll(String, GridCacheTx, Collection, GridInClosure2)
method, and is different from GridCache.loadCache(GridPredicate2, long, Object...)
in the sense that only all currently cached keys are reloaded.
filter - Optional filter. If provided, will be used to filter key-value pairs
to be put into cache.
reload completes.@Nullable 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, GridCachePeekMode...) method.
NullPointerException - If key is null.key - Entry key.
@Nullable
V peek(K key,
@Nullable
GridPredicate<? super GridCacheEntry<K,V>>... filter)
GridCachePeekMode.SMART
peek mode.
This method will not load values from any persistent storage 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, GridCachePeekMode...) method.
NullPointerException - If key is null.key - Key to peek.filter - Optional filter. If entry does not pass the filter, null is returned.
null if entry does not have a value or did not
pass the filter.Map<K,V> peekAll(@Nullable Collection<? extends K> keys)
GridCachePeekMode.SMART
peek mode.
This method will not load values from any persistent storage 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, GridCachePeekMode...) method.
keys - Keys to peek.
Map<K,V> peekAll(@Nullable Collection<? extends K> keys, @Nullable GridPredicate<? super GridCacheEntry<K,V>>... filter)
GridCachePeekMode.SMART
peek mode. Only values that pass the filter will be returned.
This method will not load values from any persistent storage 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, GridCachePeekMode...) method.
keys - Keys to get.filter - Optional filter. If provided, will be used to filter entries prior to returning.
Map<K,V> peekAll(@Nullable K... keys)
GridCachePeekMode.SMART
peek mode.
This method will not load values from any persistent storage 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, GridCachePeekMode...) method.
keys - Keys to get.
Map<K,V> peekAll(@Nullable GridPredicate<? super GridCacheEntry<K,V>>... filter)
GridCachePeekMode.SMART
peek mode. Only values that pass the filter will be returned.
This method will not load values from any persistent storage 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, GridCachePeekMode...) method.
filter - Only keys that pass through all provided filters will be retrieved.
@Nullable
V peek(K key,
@Nullable
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.
GridException - If peek operation failed.
NullPointerException - If key is null.key - Entry key.modes - Optional set of peek modes.
@Nullable
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.
GridException - If peek operation failed.
NullPointerException - If key is null.key - Entry key.modes - Optional set of peek modes.
@Nullable GridFuture<V> peekAsync(K key, @Nullable GridCachePeekMode... modes)
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.
NullPointerException - If key is null.key - Entry key.modes - Optional set of peek modes.
@Nullable GridFuture<V> peekAsync(K key, @Nullable Collection<GridCachePeekMode> modes)
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.
NullPointerException - If key is null.key - Entry key.modes - Optional set of peek modes.
Map<K,V> peekAll(@Nullable Collection<? extends K> keys, @Nullable 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.peekAll(Collection), implicitly using GridCachePeekMode.SMART mode.
GridException - If peek operation failed.keys - Keys to peek.modes - Peek modes.
Map<K,V> peekAll(@Nullable Collection<? extends K> keys, @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.peekAll(Collection), implicitly using GridCachePeekMode.SMART mode.
GridException - If peek operation failed.keys - Keys to peek.modes - Peek modes.
GridFuture<Map<K,V>> peekAllAsync(@Nullable Collection<? extends K> keys, @Nullable GridCachePeekMode... modes)
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.
keys - Keys to peek.modes - Peek modes.
GridFuture<Map<K,V>> peekAllAsync(@Nullable Collection<? extends K> keys, @Nullable Collection<GridCachePeekMode> modes)
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.
keys - Keys to peek.modes - Peek modes.
@Nullable
V get(K key,
@Nullable
GridPredicate<? super GridCacheEntry<K,V>>... filter)
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(String, GridCacheTx, Object) method.
GridCacheFlag.LOCAL flag is set on projection.
GridException - If get operation failed.
org.gridgain.grid.kernal.processors.cache.GridCacheFlagException - If failed projection flags validation.
NullPointerException - if the key is null.key - Key to retrieve the value for.filter - Filter to check prior to getting the value. Note that filter check
together with getting the value is an atomic operation.
GridFuture<V> getAsync(K key, @Nullable GridPredicate<? super GridCacheEntry<K,V>>... filter)
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(String, GridCacheTx, Object) method.
GridCacheFlag.LOCAL flag is set on projection.
NullPointerException - if the key is null.
org.gridgain.grid.kernal.processors.cache.GridCacheFlagException - If projection flags validation failed.key - Key for the value to get.filter - Filter to check prior to getting the value. Note that filter check
together with getting the value is an atomic operation.
Map<K,V> getAll(@Nullable Collection<? extends K> keys, @Nullable GridPredicate<? super GridCacheEntry<K,V>>... filter) 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(String, GridCacheTx, Collection, GridInClosure2) method.
GridCacheFlag.LOCAL flag is set on projection.
GridException - If get operation failed.
org.gridgain.grid.kernal.processors.cache.GridCacheFlagException - If failed projection flags validation.keys - Keys to get.filter - Only keys that pass through all provided filters will be retrieved.
GridFuture<Map<K,V>> getAllAsync(@Nullable Collection<? extends K> keys, @Nullable GridPredicate<? super GridCacheEntry<K,V>>... filter)
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(String, GridCacheTx, Collection, GridInClosure2) method.
GridCacheFlag.LOCAL flag is set on projection.
org.gridgain.grid.kernal.processors.cache.GridCacheFlagException - If projection flags validation failed.keys - Key for the value to get.filter - Only keys that pass through all provided filters will be retrieved.
Map<K,V> getAll(@Nullable 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(String, GridCacheTx, Collection, GridInClosure2) method.
GridCacheFlag.LOCAL flag is set on projection.
GridException - If get operation failed.
org.gridgain.grid.kernal.processors.cache.GridCacheFlagException - If failed projection flags validation.keys - Keys to get.
GridFuture<Map<K,V>> getAllAsync(@Nullable 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(String, GridCacheTx, Collection, GridInClosure2) method.
GridCacheFlag.LOCAL flag is set on projection.
org.gridgain.grid.kernal.processors.cache.GridCacheFlagException - If projection flags validation failed.keys - Keys to get.
Map<K,V> getAll(@Nullable GridPredicate<? super GridCacheEntry<K,V>>... filter) throws GridException
GridCacheProjection.projection(GridPredicate[]) based
on entry filter, as it is simply a view on the underlying cache and not a copy.
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(String, GridCacheTx, Collection, GridInClosure2) method.
GridCacheFlag.LOCAL flag is set on projection.
GridException - If get operation failed.
org.gridgain.grid.kernal.processors.cache.GridCacheFlagException - If projection flags validation failed.filter - Only keys that pass through all provided filters will be retrieved.
GridFuture<Map<K,V>> getAllAsync(@Nullable GridPredicate<? super GridCacheEntry<K,V>>... filter)
GridCacheProjection.projection(GridPredicate[]) based
on entry filter, as it is simply a view on the underlying cache and not a copy.
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(String, GridCacheTx, Collection, GridInClosure2) method.
GridCacheFlag.LOCAL flag is set on projection.
org.gridgain.grid.kernal.processors.cache.GridCacheFlagException - If projection flags validation failed.filter - Only keys that pass through all provided filters will be retrieved.
@Nullable
V put(K key,
V val,
@Nullable
GridPredicate<? super GridCacheEntry<K,V>>... filter)
throws GridException
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(String, 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(String, GridCacheTx, Object, Object) method.
GridCacheFlag.LOCAL, GridCacheFlag.READ.
NullPointerException - If either key or value are null.
GridException - If put operation failed.
org.gridgain.grid.kernal.processors.cache.GridCacheFlagException - If projection flags validation failed.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.GridFuture<V> putAsync(K key, V val, @Nullable GridPredicate<? super 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(String, 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(String, GridCacheTx, Object, Object) method.
GridCacheFlag.LOCAL, GridCacheFlag.READ.
NullPointerException - If either key or value are null.
org.gridgain.grid.kernal.processors.cache.GridCacheFlagException - If projection flags validation failed.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.
boolean putx(K key,
V val,
@Nullable
GridPredicate<? super 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(String, GridCacheTx, Object, Object) method.
GridCacheFlag.LOCAL, GridCacheFlag.READ.
NullPointerException - If either key or value are null.
GridException - If put operation failed.
org.gridgain.grid.kernal.processors.cache.GridCacheFlagException - If projection flags validation failed.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 value was stored in cache, false otherwise.GridFuture<Boolean> putxAsync(K key, V val, @Nullable GridPredicate<? super 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(String, GridCacheTx, Object, Object) method.
GridCacheFlag.LOCAL, GridCacheFlag.READ.
NullPointerException - If either key or value are null.
org.gridgain.grid.kernal.processors.cache.GridCacheFlagException - If projection flags validation failed.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.
@Nullable
V putIfAbsent(K key,
V val)
throws GridException
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(String, 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(String, GridCacheTx, Object, Object) method.
GridCacheFlag.LOCAL, GridCacheFlag.READ.
NullPointerException - If either key or value are null.
GridException - If put operation failed.
org.gridgain.grid.kernal.processors.cache.GridCacheFlagException - If projection flags validation failed.key - Key to store in cache.val - Value to be associated with the given key.
GridFuture<V> putIfAbsentAsync(K key, V val)
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(String, 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(String, GridCacheTx, Object, Object) method.
GridCacheFlag.LOCAL, GridCacheFlag.READ.
NullPointerException - If either key or value are null.
org.gridgain.grid.kernal.processors.cache.GridCacheFlagException - If projection flags validation failed.key - Key to store in cache.val - Value to be associated with the given key.
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(String, GridCacheTx, Object, Object) method.
GridCacheFlag.LOCAL, GridCacheFlag.READ.
NullPointerException - If either key or value are null.
GridException - If put operation failed.
org.gridgain.grid.kernal.processors.cache.GridCacheFlagException - If projection flags validation failed.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.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(String, GridCacheTx, Object, Object) method.
GridCacheFlag.LOCAL, GridCacheFlag.READ.
NullPointerException - If either key or value are null.
org.gridgain.grid.kernal.processors.cache.GridCacheFlagException - If projection flags validation failed.key - Key to store in cache.val - Value to be associated with the given key.
@Nullable
V replace(K key,
V val)
throws GridException
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(String, 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(String, GridCacheTx, Object, Object) method.
GridCacheFlag.LOCAL, GridCacheFlag.READ.
NullPointerException - If either key or value are null.
GridException - If replace operation failed.
org.gridgain.grid.kernal.processors.cache.GridCacheFlagException - If projection flags validation failed.key - Key to store in cache.val - Value to be associated with the given key.
GridFuture<V> replaceAsync(K key, V val)
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(String, 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(String, GridCacheTx, Object, Object) method.
GridCacheFlag.LOCAL, GridCacheFlag.READ.
NullPointerException - If either key or value are null.
org.gridgain.grid.kernal.processors.cache.GridCacheFlagException - If projection flags validation failed.key - Key to store in cache.val - Value to be associated with the given key.
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(String, GridCacheTx, Object, Object) method.
GridCacheFlag.LOCAL, GridCacheFlag.READ.
NullPointerException - If either key or value are null.
GridException - If replace operation failed.
org.gridgain.grid.kernal.processors.cache.GridCacheFlagException - If projection flags validation failed.key - Key to store in cache.val - Value to be associated with the given key.
True if replace happened, false otherwise.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(String, GridCacheTx, Object, Object) method.
GridCacheFlag.LOCAL, GridCacheFlag.READ.
NullPointerException - If either key or value are null.
org.gridgain.grid.kernal.processors.cache.GridCacheFlagException - If projection flags validation failed.key - Key to store in cache.val - Value to be associated with the given key.
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(String, GridCacheTx, Object, Object) method.
GridCacheFlag.LOCAL, GridCacheFlag.READ.
NullPointerException - If either key or value are null.
GridException - If replace operation failed.
org.gridgain.grid.kernal.processors.cache.GridCacheFlagException - If projection flags validation failed.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.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(String, GridCacheTx, Object, Object) method.
GridCacheFlag.LOCAL, GridCacheFlag.READ.
NullPointerException - If either key or value are null.
org.gridgain.grid.kernal.processors.cache.GridCacheFlagException - If projection flags validation failed.key - Key to store in cache.oldVal - Old value to match.newVal - Value to be associated with the given key.
void putAll(@Nullable
Map<? extends K,? extends V> m,
@Nullable
GridPredicate<? super GridCacheEntry<K,V>>... filter)
throws GridException
If write-through is enabled, the stored values will be persisted to GridCacheStore
via GridCacheStore.putAll(String, GridCacheTx, Map) method.
GridCacheFlag.LOCAL, GridCacheFlag.READ.
GridException - If put operation failed.
org.gridgain.grid.kernal.processors.cache.GridCacheFlagException - If projection flags validation failed.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.GridFuture<?> putAllAsync(@Nullable Map<? extends K,? extends V> m, @Nullable GridPredicate<? super GridCacheEntry<K,V>>... filter)
If write-through is enabled, the stored values will be persisted to GridCacheStore
via GridCacheStore.putAll(String, GridCacheTx, Map) method.
GridCacheFlag.LOCAL, GridCacheFlag.READ.
org.gridgain.grid.kernal.processors.cache.GridCacheFlagException - If projection flags validation failed.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.
Set<K> keySet()
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.
Set<K> keySet(@Nullable GridPredicate<? super GridCacheEntry<K,V>>... filter)
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.
If filter is provided, then only the keys for the entries that pass provided filters are included in the set.
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.
filter - Filter for the key set. If not provided then key set for the
whole cache is returned.
Set<K> keySet(@Nullable Collection<? extends K> keys, @Nullable GridPredicate<? super GridCacheEntry<K,V>>... filter)
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.
If filter is provided, then only the keys for the entries that pass provided filters are returned.
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.
keys - Only keys specified here will be returned in the set.filter - Filter for the key set. If not provided then key set for the
whole cache is returned.
Set<K> keySet(@Nullable K... keys)
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.
keys - Only keys specified here will be returned in the set.
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.
Set<K> primaryKeySet(@Nullable GridPredicate<? super GridCacheEntry<K,V>>... filter)
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.
filter - Filter for the key set. If not provided then primary key set for the
current node is returned.
Set<K> primaryKeySet(@Nullable Collection<? extends K> keys, @Nullable GridPredicate<? super GridCacheEntry<K,V>>... filter)
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.
If filter is provided, then only the keys for the entries that pass provided filters are returned.
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.
keys - Only keys specified here will be returned in the set.filter - Filter for the key set. If not provided then primary key set for the
current node is returned.
Set<K> primaryKeySet(@Nullable K... keys)
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.
keys - Only keys specified here will be returned in the set.
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.
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.
Collection<V> values(@Nullable GridPredicate<? super GridCacheEntry<K,V>>... filter)
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.
filter - Filter for the collection of values. If not provided then
values for the whole cache is returned.
Collection<V> values(@Nullable Collection<? extends K> keys, @Nullable GridPredicate<? super GridCacheEntry<K,V>>... filter)
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.
keys - Keys for which value pairs will be returned.filter - Filter for the collection of values. If not provided then
values for the whole cache is returned.
Collection<V> values(@Nullable K... keys)
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.
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.
keys - Keys for which value pairs will be returned.
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.
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.
Collection<V> primaryValues(@Nullable GridPredicate<? super GridCacheEntry<K,V>>... filter)
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.
filter - Filter for the collection of values. If not provided then primary
values for the current node is returned.
Collection<V> primaryValues(@Nullable Collection<? extends K> keys, @Nullable GridPredicate<? super GridCacheEntry<K,V>>... filter)
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.
keys - Keys for which value pairs will be returned.filter - Filter for the collection of values. If not provided then primary
values for the current node is returned.
Collection<V> primaryValues(@Nullable K... keys)
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.
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.
keys - Keys for which value pairs will be returned.
Set<GridCacheEntry<K,V>> entrySet()
Set<GridCacheEntry<K,V>> entrySet(@Nullable Collection<? extends K> keys, @Nullable GridPredicate<? super GridCacheEntry<K,V>>... filter)
If optional filters are provided, then only entries that successfully pass the filters will be included in the resulting set.
keys - Keys to get entries for.filter - Filter for all entries in the set.
Set<GridCacheEntry<K,V>> entrySet(@Nullable K... keys)
keys - Keys to get entries for.
Set<GridCacheEntry<K,V>> entrySet(@Nullable GridPredicate<? super GridCacheEntry<K,V>>... filter)
If optional filters are provided, then only entries that successfully pass the filters will be included in the resulting set.
filter - Key filter for entries.
Set<GridCacheEntry<K,V>> primaryEntrySet()
Set<GridCacheEntry<K,V>> primaryEntrySet(@Nullable Collection<? extends K> keys, @Nullable GridPredicate<? super GridCacheEntry<K,V>>... filter)
If optional filters are provided, then only entries that successfully pass the filters will be included in the resulting set.
keys - Keys to get entries for.filter - Filter for primary entries in the set.
Set<GridCacheEntry<K,V>> primaryEntrySet(@Nullable K... keys)
keys - Keys to get entries for.
Set<GridCacheEntry<K,V>> primaryEntrySet(@Nullable GridPredicate<? super GridCacheEntry<K,V>>... filter)
If optional filters are provided, then only entries that successfully pass the filters will be included in the resulting set.
filter - Key filter for entries.
GridCacheQuery<K,V> createQuery(GridCacheQueryType type)
GridCacheQuery documentation.
type - Query type.
GridCacheQuery<K,V> createQuery(GridCacheQueryType type, @Nullable Class<?> cls, @Nullable String clause)
GridCacheQuery documentation.
type - Query type.cls - Query class (may be null for GridCacheQueryType.SCAN queries).clause - Query clause (should be null for GridCacheQueryType.SCAN queries).
GridCacheQuery<K,V> createQuery(GridCacheQueryType type, @Nullable String clsName, @Nullable String clause)
GridCacheQuery documentation.
type - Query type.clsName - Query class name (may be null for GridCacheQueryType.SCAN queries).clause - Query clause (should be null for GridCacheQueryType.SCAN queries).
<T> GridCacheTransformQuery<K,V,T> createTransformQuery()
GridCacheQuery documentation.
<T> GridCacheTransformQuery<K,V,T> createTransformQuery(GridCacheQueryType type)
GridCacheQuery documentation.
type - Query type.
<T> GridCacheTransformQuery<K,V,T> createTransformQuery(GridCacheQueryType type, @Nullable Class<?> cls, @Nullable String clause)
GridCacheQuery documentation.
type - Query type.cls - Query class (may be null for GridCacheQueryType.SCAN queries).clause - Query clause (should be null for GridCacheQueryType.SCAN queries).
<T> GridCacheTransformQuery<K,V,T> createTransformQuery(GridCacheQueryType type, @Nullable String clsName, @Nullable String clause)
GridCacheQuery documentation.
type - Query type.clsName - Query class name (may be null for GridCacheQueryType.SCAN queries).clause - Query clause (should be null for GridCacheQueryType.SCAN queries).
<R1,R2> GridCacheReduceQuery<K,V,R1,R2> createReduceQuery()
GridCacheQuery documentation.
<R1,R2> GridCacheReduceQuery<K,V,R1,R2> createReduceQuery(GridCacheQueryType type)
GridCacheQuery documentation.
type - Query type.
<R1,R2> GridCacheReduceQuery<K,V,R1,R2> createReduceQuery(GridCacheQueryType type, @Nullable Class<?> cls, @Nullable String clause)
GridCacheQuery documentation.
type - Query type.cls - Query class (may be null for GridCacheQueryType.SCAN queries).clause - Query clause (should be null for GridCacheQueryType.SCAN queries).
<R1,R2> GridCacheReduceQuery<K,V,R1,R2> createReduceQuery(GridCacheQueryType type, @Nullable String clsName, @Nullable String clause)
GridCacheQuery documentation.
type - Query type.clsName - Query class name (may be null for GridCacheQueryType.SCAN queries).clause - Query clause (should be null for GridCacheQueryType.SCAN queries).
GridCacheTx txStart()
throws IllegalStateException
GridCacheConfiguration at startup.
IllegalStateException - If transaction is already started by this thread.
GridCacheTx txStart(long timeout)
IllegalStateException - If transaction is already started by this thread.timeout - Transaction timeout.
GridCacheTx txStart(GridCacheTxConcurrency concurrency,
GridCacheTxIsolation isolation)
IllegalStateException - If transaction is already started by this thread.concurrency - Concurrency.isolation - Isolation.
GridCacheTx txStart(GridCacheTxConcurrency concurrency,
GridCacheTxIsolation isolation,
long timeout,
boolean invalidate)
IllegalStateException - If transaction is already started by this thread.concurrency - Concurrency.isolation - Isolation.timeout - Timeout.invalidate - Invalidation policy.
@Nullable GridCacheTx tx()
null if this thread does
not have a transaction.
null if this thread
does not have a transaction.@Nullable 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.
key - Entry key.
null if projection pre-filtering was not passed.
boolean evict(K key,
@Nullable
GridPredicate<? super GridCacheEntry<K,V>>... filter)
If GridCacheConfiguration.isSwapEnabled() is set to true and
GridCacheFlag.SKIP_SWAP is not enabled, the evicted entry will
be swapped to disk.
GridCacheFlag.READ.
key - Key to evict from cache.filter - Optional filter that entry should pass before it will be evicted.
True if entry could be evicted, false otherwise.void evictAll()
If GridCacheConfiguration.isSwapEnabled() is set to true and
GridCacheFlag.SKIP_SWAP is not enabled, the evicted entries will
be swapped to disk.
GridCacheFlag.READ.
void evictAll(@Nullable
GridPredicate<? super GridCacheEntry<K,V>>... filter)
If GridCacheConfiguration.isSwapEnabled() is set to true and
GridCacheFlag.SKIP_SWAP is not enabled, the evicted entries will
be swapped to disk.
GridCacheFlag.READ.
filter - Optional filter that entry should pass before it will be evicted.
void evictAll(@Nullable
Collection<? extends K> keys,
@Nullable
GridPredicate<? super GridCacheEntry<K,V>>... filter)
If GridCacheConfiguration.isSwapEnabled() is set to true and
GridCacheFlag.SKIP_SWAP is not enabled, the evicted entries will
be swapped to disk.
GridCacheFlag.READ.
keys - Keys to evict.filter - Optional filter that entry should pass before it will be evicted.
void evictAll(@Nullable
K... keys)
If GridCacheConfiguration.isSwapEnabled() is set to true and
GridCacheFlag.SKIP_SWAP is not enabled, the evicted entries will
be swapped to disk.
GridCacheFlag.READ.
keys - Keys to evict.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.
void clearAll(@Nullable
GridPredicate<? super GridCacheEntry<K,V>>... filter)
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.
filter - Optional entry filter that entry should pass
before it will be cleared.
void clearAll(@Nullable
Collection<? extends K> keys,
@Nullable
GridPredicate<? super GridCacheEntry<K,V>>... filter)
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.
keys - Keys to clear.filter - Optional entry filter that entry should pass
before it will be cleared.
void clearAll(@Nullable
K... keys)
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.
keys - Keys to clear.
boolean clear(K key,
@Nullable
GridPredicate<? super GridCacheEntry<K,V>>... filter)
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.
key - Key to clear.filter - Optional entry filter that entry should pass before it will be evicted.
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.
boolean invalidate(K key,
@Nullable
GridPredicate<? super GridCacheEntry<K,V>>... filter)
throws GridException
GridCacheFlag.READ.
GridException - In case of operation failure.key - Key to invalidate entry for.filter - Optional filter that entry should pass prior to invalidation.
true if entry was invalidated, false otherwise.
void invalidateAll(@Nullable
Collection<K> keys,
@Nullable
GridPredicate<? super GridCacheEntry<K,V>>... filter)
throws GridException
GridCacheFlag.READ.
GridException - In case of operation failure.keys - Keys to invalidate entries for.filter - Optional filter that entry should pass prior to invalidation.
void invalidateAll(@Nullable
K... keys)
throws GridException
GridException - In case of operation failure.keys - Keys to invalidate entries for.
boolean compact(K key,
@Nullable
GridPredicate<? super GridCacheEntry<K,V>>... filter)
throws GridException
null
at the time of the call then entry is removed locally.
GridException - If failed to compact.key - Key to optimize entry for.filter - Optional filter that entry should pass prior to optimization.
true if entry was cleared from cache (if value was null).
void compactAll(@Nullable
Collection<K> keys,
@Nullable
GridPredicate<? super GridCacheEntry<K,V>>... filter)
throws GridException
null at the time of the call then this entry is removed locally.
GridException - If failed to compact.keys - Keys to optimize entries for.filter - Optional filter that entry should pass prior to optimization.
void compactAll(@Nullable
K... keys)
throws GridException
null at the time of the call then this entry is removed locally.
GridException - If failed to compact.keys - Keys to optimize entries for.
@Nullable
V remove(K key,
@Nullable
GridPredicate<? super GridCacheEntry<K,V>>... filter)
throws GridException
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(String, 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(String, GridCacheTx, Object) method.
GridCacheFlag.LOCAL, GridCacheFlag.READ.
NullPointerException - If key is null.
GridException - If remove operation failed.
org.gridgain.grid.kernal.processors.cache.GridCacheFlagException - If projection flags validation failed.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.GridFuture<V> removeAsync(K key, GridPredicate<? super 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(String, 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(String, GridCacheTx, Object) method.
GridCacheFlag.LOCAL, GridCacheFlag.READ.
NullPointerException - if the key is null.
org.gridgain.grid.kernal.processors.cache.GridCacheFlagException - If projection flags validation failed.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.
boolean removex(K key,
@Nullable
GridPredicate<? super 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(String, GridCacheTx, Object) method.
GridCacheFlag.LOCAL, GridCacheFlag.READ.
NullPointerException - if the key is null.
GridException - If remove failed.
org.gridgain.grid.kernal.processors.cache.GridCacheFlagException - If projection flags validation failed.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.GridFuture<Boolean> removexAsync(K key, @Nullable GridPredicate<? super 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(String, GridCacheTx, Object) method.
GridCacheFlag.LOCAL, GridCacheFlag.READ.
NullPointerException - if the key is null.
org.gridgain.grid.kernal.processors.cache.GridCacheFlagException - If projection flags validation failed.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.
boolean remove(K key,
V val)
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(String, GridCacheTx, Object) method.
GridCacheFlag.LOCAL, GridCacheFlag.READ.
NullPointerException - if the key or value is null.
GridException - If remove failed.
org.gridgain.grid.kernal.processors.cache.GridCacheFlagException - If projection flags validation failed.key - Key whose mapping is to be removed from cache.val - Value to match against currently cached value.
True if filter passed validation, false otherwise.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(String, GridCacheTx, Object) method.
GridCacheFlag.LOCAL, GridCacheFlag.READ.
NullPointerException - if the key or value is null.
org.gridgain.grid.kernal.processors.cache.GridCacheFlagException - If projection flags validation failed.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.
void removeAll(@Nullable
Collection<? extends K> keys,
@Nullable
GridPredicate<? super GridCacheEntry<K,V>>... filter)
throws GridException
If write-through is enabled, the values will be removed from GridCacheStore
via GridCacheStore.removeAll(String, GridCacheTx, Collection) method.
GridCacheFlag.LOCAL, GridCacheFlag.READ.
GridException - If remove failed.
org.gridgain.grid.kernal.processors.cache.GridCacheFlagException - If flags validation failed.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.GridFuture<?> removeAllAsync(@Nullable Collection<? extends K> keys, @Nullable GridPredicate<? super GridCacheEntry<K,V>>... filter)
If write-through is enabled, the values will be removed from GridCacheStore
via GridCacheStore.removeAll(String, GridCacheTx, Collection) method.
GridCacheFlag.LOCAL, GridCacheFlag.READ.
org.gridgain.grid.kernal.processors.cache.GridCacheFlagException - If flags validation failed.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.
void removeAll(@Nullable
GridPredicate<? super 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.
If write-through is enabled, the values will be removed from GridCacheStore
via GridCacheStore.removeAll(String, GridCacheTx, Collection) method.
GridCacheFlag.LOCAL, GridCacheFlag.READ.
GridException - If remove failed.
org.gridgain.grid.kernal.processors.cache.GridCacheFlagException - If flags validation failed.filter - Filter used to supply keys for remove operation (if null,
then nothing will be removed).GridFuture<?> removeAllAsync(@Nullable GridPredicate<? super 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(String, GridCacheTx, Collection) method.
GridCacheFlag.LOCAL, GridCacheFlag.READ.
org.gridgain.grid.kernal.processors.cache.GridCacheFlagException - If flags validation failed.filter - Filter used to supply keys for remove operation (if null,
then nothing will be removed).
boolean lock(K key,
@Nullable
GridPredicate<? super 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.
GridException - If lock acquisition resulted in error.
org.gridgain.grid.kernal.processors.cache.GridCacheFlagException - If flags validation failed.key - Key to lock.filter - Optional filter to validate prior to acquiring the lock.
True if all filters passed and lock was acquired,
false otherwise.GridFuture<Boolean> lockAsync(K key, @Nullable GridPredicate<? super GridCacheEntry<K,V>>... filter)
GridCacheTxConcurrency.PESSIMISTIC concurrency control for transaction
which will acquire explicit locks for relevant cache operations.
GridCacheFlag.LOCAL, GridCacheFlag.READ.
org.gridgain.grid.kernal.processors.cache.GridCacheFlagException - If flags validation failed.key - Key to lock.filter - Optional filter to validate prior to acquiring the lock.
true
whenever lock was successfully acquired, false otherwise.
boolean lock(K key,
long timeout,
@Nullable
GridPredicate<? super 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.
GridException - If lock acquisition resulted in error.
org.gridgain.grid.kernal.processors.cache.GridCacheFlagException - If flags validation failed.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.GridFuture<Boolean> lockAsync(K key, long timeout, @Nullable GridPredicate<? super GridCacheEntry<K,V>>... filter)
GridCacheTxConcurrency.PESSIMISTIC concurrency control for transaction
which will acquire explicit locks for relevant cache operations.
GridCacheFlag.LOCAL, GridCacheFlag.READ.
org.gridgain.grid.kernal.processors.cache.GridCacheFlagException - If flags validation failed.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.
boolean lockAll(@Nullable
GridPredicate<? super 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.
GridException - If lock acquisition resulted in error.
org.gridgain.grid.kernal.processors.cache.GridCacheFlagException - If flags validation failed.filter - Filter to supply keys to be locked.
True if filters passed and all locks were acquired, false
otherwise.GridFuture<Boolean> lockAllAsync(@Nullable GridPredicate<? super GridCacheEntry<K,V>>... filter)
GridCacheTxConcurrency.PESSIMISTIC concurrency control for transaction
which will acquire explicit locks for relevant cache operations.
GridCacheFlag.LOCAL, GridCacheFlag.READ.
org.gridgain.grid.kernal.processors.cache.GridCacheFlagException - If flags validation failed.filter - Filter to supply keys to be locked.
true if filters passed and all locks were acquired,
false otherwise.
boolean lockAll(long timeout,
@Nullable
GridPredicate<? super 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.
GridException - If lock acquisition resulted in error.
org.gridgain.grid.kernal.processors.cache.GridCacheFlagException - If flags validation failed.timeout - Timeout in milliseconds to wait for lock to be acquired
('0' for no expiration).filter - Filter to supply keys to be locked.
True if all filters passed and locks were acquired before
timeout has expired, false otherwise.GridFuture<Boolean> lockAllAsync(long timeout, @Nullable GridPredicate<? super GridCacheEntry<K,V>>... filter)
GridCacheTxConcurrency.PESSIMISTIC concurrency control for transaction
which will acquire explicit locks for relevant cache operations.
GridCacheFlag.LOCAL, GridCacheFlag.READ.
org.gridgain.grid.kernal.processors.cache.GridCacheFlagException - If flags validation failed.timeout - Timeout in milliseconds to wait for lock to be acquired
('0' for no expiration).filter - Filter to supply keys to be locked.
true if all filters passed and locks were acquired before
timeout has expired, false otherwise.
boolean lockAll(@Nullable
Collection<? extends K> keys,
@Nullable
GridPredicate<? super GridCacheEntry<K,V>>... filter)
throws GridException
GridException - If lock acquisition resulted in error.
org.gridgain.grid.kernal.processors.cache.GridCacheFlagException - If flags validation failed.keys - Keys to lock.filter - Optional filter that needs to atomically pass in order for
the locks to be acquired.
True if all locks were acquired.GridFuture<Boolean> lockAllAsync(@Nullable Collection<? extends K> keys, @Nullable GridPredicate<? super GridCacheEntry<K,V>>... filter)
GridCacheTxConcurrency.PESSIMISTIC concurrency control for transaction
which will acquire explicit locks for relevant cache operations.
GridCacheFlag.LOCAL, GridCacheFlag.READ.
org.gridgain.grid.kernal.processors.cache.GridCacheFlagException - If flags validation failed.keys - Keys to lock.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, false
otherwise.
boolean lockAll(@Nullable
Collection<? extends K> keys,
long timeout,
@Nullable
GridPredicate<? super 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.
GridException - If lock acquisition resulted in error.
org.gridgain.grid.kernal.processors.cache.GridCacheFlagException - If flags validation failed.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.GridFuture<Boolean> lockAllAsync(@Nullable Collection<? extends K> keys, long timeout, @Nullable GridPredicate<? super GridCacheEntry<K,V>>... filter)
GridCacheTxConcurrency.PESSIMISTIC concurrency control for transaction
which will acquire explicit locks for relevant cache operations.
GridCacheFlag.LOCAL, GridCacheFlag.READ.
org.gridgain.grid.kernal.processors.cache.GridCacheFlagException - If flags validation failed.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.
boolean lockAll(@Nullable
K... keys)
throws GridException
GridCacheTxConcurrency.PESSIMISTIC concurrency control for transaction
which will acquire explicit locks for relevant cache operations.
GridCacheFlag.LOCAL, GridCacheFlag.READ.
GridException - If lock acquisition resulted in error.
org.gridgain.grid.kernal.processors.cache.GridCacheFlagException - If flags validation failed.keys - Keys to lock.
true or throws and exception.GridFuture<Boolean> lockAllAsync(@Nullable K... keys)
GridCacheTxConcurrency.PESSIMISTIC concurrency control for transaction
which will acquire explicit locks for relevant cache operations.
GridCacheFlag.LOCAL, GridCacheFlag.READ.
org.gridgain.grid.kernal.processors.cache.GridCacheFlagException - If flags validation failed.keys - Keys to lock.
true after all locks were acquired.
boolean lockAll(long timeout,
@Nullable
K... keys)
throws GridException
GridCacheTxConcurrency.PESSIMISTIC concurrency control for transaction
which will acquire explicit locks for relevant cache operations.
GridCacheFlag.LOCAL, GridCacheFlag.READ.
GridException - If lock acquisition resulted in error.
org.gridgain.grid.kernal.processors.cache.GridCacheFlagException - If flags validation failed.keys - Keys to lock.timeout - Timeout in milliseconds to wait for lock to be acquired
('0' for no expiration).
True if all locks were acquired before timeout expired,
false otherwise.GridFuture<Boolean> lockAllAsync(long timeout, @Nullable K... keys)
GridCacheTxConcurrency.PESSIMISTIC concurrency control for transaction
which will acquire explicit locks for relevant cache operations.
GridCacheFlag.LOCAL, GridCacheFlag.READ.
org.gridgain.grid.kernal.processors.cache.GridCacheFlagException - If flags validation failed.keys - Keys to lock.timeout - Timeout in milliseconds to wait for lock to be acquired
('0' for no expiration).
true if all locks were acquired before timeout expired,
false otherwise.
void unlock(K key,
GridPredicate<? super 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.
GridException - If unlock execution resulted in error.
org.gridgain.grid.kernal.processors.cache.GridCacheFlagException - If flags validation failed.key - Key to unlock.filter - Optional filter that needs to pass prior to unlock taking effect.
void unlockAll(@Nullable
K... keys)
throws GridException
GridCacheTxConcurrency.PESSIMISTIC concurrency control for transaction
which will acquire explicit locks for relevant cache operations.
GridCacheFlag.LOCAL, GridCacheFlag.READ.
GridException - If unlock execution resulted in error.
org.gridgain.grid.kernal.processors.cache.GridCacheFlagException - If flags validation failed.keys - Keys to unlock.
void unlockAll(@Nullable
Collection<? extends K> keys,
@Nullable
GridPredicate<? super 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.
GridException - If unlock execution resulted in error.
org.gridgain.grid.kernal.processors.cache.GridCacheFlagException - If flags validation failed.keys - Keys to unlock.filter - Optional filter which needs to pass for individual entries
to be unlocked.
void unlockAll(@Nullable
GridPredicate<? super 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.
GridException - If unlock execution resulted in error.
org.gridgain.grid.kernal.processors.cache.GridCacheFlagException - If flags validation failed.filter - Filter used to supply keys from cache (if null,
then no key will be unlocked).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.
key - Key to check.
True if lock is owned by some node.
boolean isAllLocked(@Nullable
GridPredicate<? super K>... filter)
This is a local in-VM operation and does not involve any network trips or access to persistent storage in any way.
filter - Key filter used to supply keys.
True if all keys accepted by the given filter are
locked by some nodes.boolean isAllLocked(Collection<? extends K> keys)
This is a local in-VM operation and does not involve any network trips or access to persistent storage in any way.
keys - Keys to check.
True if all of the locks are currently locked
by any of the grid nodes.boolean isAllLocked(K... keys)
This is a local in-VM operation and does not involve any network trips or access to persistent storage in any way.
keys - Keys to check.
True if all of the locks are currently locked
by any of the grid nodes.
boolean isAllLockedByThread(@Nullable
GridPredicate<? super K>... filter)
This is a local in-VM operation and does not involve any network trips or access to persistent storage in any way.
filter - Key filter used to supply keys.
True if all keys accepted by the given filter are
locked by current thread.
boolean isAllLockedByThread(@Nullable
Collection<? extends K> keys)
This is a local in-VM operation and does not involve any network trips or access to persistent storage in any way.
keys - Keys to check.
True if every key provided is locked by the current thread.
boolean isAllLockedByThread(@Nullable
K... keys)
This is a local in-VM operation and does not involve any network trips or access to persistent storage in any way.
keys - Keys to check.
True if every key provided is locked by the current thread.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.
key - Key to check.
True if key is locked by current thread.int size()
If you would like to find out how many entries are there in cache
altogether (including nulls), you should use
GridCacheProjection.keySize() method on base GridCache which will
return total size of internal hash table in constant time without iteration.
int keySize()
GridCacheProjection.size()
method in a way that GridCacheProjection.size() method will only provide size for not-null
values and has complexity of O(N), while keySize() will return the count of
all cache entries and has O(1) complexity on base cache projection. It is essentially the
size of cache key set and is semantically identical to {GridCache.keySet().size().
Collection<GridRichNode> affinityNodes(K key)
key - Key to get affinity nodes for.
Map<GridRichNode,Collection<K>> mapKeysToNodes(@Nullable Collection<? extends K> keys)
This method works as following:
GridCacheAffinity is
used to determine which keys are mapped to which nodes.
keys - Keys to map to nodes.
Map<GridRichNode,Collection<K>> mapKeysToNodes(@Nullable GridPredicate<? super K>... filter)
This method works as following:
GridCacheAffinity is
used to determine which keys are mapped to which nodes.
filter - Filter for keys to check.
Map<GridRichNode,Collection<K>> mapKeysToNodes(@Nullable K... keys)
This method works as following:
GridCacheAffinity is
used to determine which keys are mapped to which nodes.
keys - Keys to map to nodes.
GridRichNode mapKeyToNode(K key)
This method works as following:
GridCacheAffinity
is returned.
key - Keys to map to a node.
GridProjection gridProjection()
GridProjection gridProjection(@Nullable
Collection<? extends K> keys)
GridProjection for all nodes to which the
passed in keys are mapped. It works as following:
GridCacheAffinity is
used to determine which keys are mapped to which nodes.
keys - Keys to map to nodes.
GridProjection gridProjection(@Nullable
K... keys)
GridProjection for all nodes to which the
passed in keys are mapped. It works as following:
GridCacheAffinity is
used to determine which keys are mapped to which nodes.
keys - Keys to map to nodes.
GridProjection gridProjection(@Nullable
GridPredicate<? super K>... filter)
GridProjection for all nodes to which all the
keys whose entries pass through the filter are mapped. It works as following:
GridCacheAffinity is
used to determine which keys are mapped to which nodes.
filter - Filter used to supply keys.
@Nullable
V unswap(K key)
throws GridException
GridCacheFlag.SKIP_SWAP, GridCacheFlag.READ.
GridException - If unswap failed.
org.gridgain.grid.kernal.processors.cache.GridCacheFlagException - If flags validation failed.key - Key to unswap entry for.
null for non-existing key.
void unswapAll(@Nullable
Collection<? extends K> keys)
throws GridException
GridCacheFlag.SKIP_SWAP, GridCacheFlag.READ.
GridException - If unswap failed.
org.gridgain.grid.kernal.processors.cache.GridCacheFlagException - If flags validation failed.keys - Keys to unswap entries for.
void unswapAll(@Nullable
K... keys)
throws GridException
GridCacheFlag.SKIP_SWAP, GridCacheFlag.READ.
GridException - If unswap failed.
org.gridgain.grid.kernal.processors.cache.GridCacheFlagException - If flags validation failed.keys - Keys to unswap entries for.void inTx(GridInClosure<GridCacheProjection<K,V>>... closures) throws IllegalStateException, GridException
GridCacheFlag.LOCAL.
IllegalStateException - If transaction is already started by this thread.
GridException - If cache failure occurred.closures - Closures to execute in transaction.GridFuture<?> inTxAsync(GridInClosure<GridCacheProjection<K,V>>... closures) throws GridException
GridCacheProjection.inTx(GridInClosure[]) this method does not block and immediately returns
execution future.
GridCacheFlag.LOCAL.
GridException - If cache failure occurred.closures - Closures to execute in transaction.
void inTx(long timeout,
GridInClosure<GridCacheProjection<K,V>>... closures)
throws IllegalStateException,
GridException
GridCacheFlag.LOCAL.
IllegalStateException - If transaction is already started by this thread.
GridException - If cache failure occurred.timeout - Transaction timeout.closures - Closures to execute in transaction.GridFuture<?> inTxAsync(long timeout, GridInClosure<GridCacheProjection<K,V>>... closures) throws IllegalStateException, GridException
GridCacheProjection.inTx(long, GridInClosure[]) this method does not
block and immediately returns execution future.
GridCacheFlag.LOCAL.
IllegalStateException - If transaction is already started by this thread.
GridException - If cache failure occurred.timeout - Transaction timeout.closures - Closures to execute in transaction.
void inTx(GridCacheTxConcurrency concurrency,
GridCacheTxIsolation isolation,
GridInClosure<GridCacheProjection<K,V>>... closures)
throws IllegalStateException,
GridException
GridCacheFlag.LOCAL.
IllegalStateException - If transaction is already started by this thread.
GridException - If cache failure occurred.concurrency - Concurrency.isolation - Isolation.closures - Closures to execute in transaction.GridFuture<?> inTxAsync(GridCacheTxConcurrency concurrency, GridCacheTxIsolation isolation, GridInClosure<GridCacheProjection<K,V>>... closures) throws IllegalStateException, GridException
GridCacheProjection.inTx(GridCacheTxConcurrency, GridCacheTxIsolation, GridInClosure[])
this method does not block and immediately returns execution future.
GridCacheFlag.LOCAL.
IllegalStateException - If transaction is already started by this thread.
GridException - If cache failure occurred.concurrency - Concurrency.isolation - Isolation.closures - Closures to execute in transaction.
void inTx(GridCacheTxConcurrency concurrency,
GridCacheTxIsolation isolation,
long timeout,
boolean invalidate,
GridInClosure<GridCacheProjection<K,V>>... closures)
throws IllegalStateException,
GridException
GridCacheFlag.LOCAL.
IllegalStateException - If transaction is already started by this thread.
GridException - If cache failure occurred.concurrency - Concurrency.isolation - Isolation.timeout - Timeout.invalidate - Invalidation policy.closures - Closures to execute in transaction.GridFuture<?> inTxAsync(GridCacheTxConcurrency concurrency, GridCacheTxIsolation isolation, long timeout, boolean invalidate, GridInClosure<GridCacheProjection<K,V>>... closures) throws IllegalStateException, GridException
GridCacheProjection.inTx(GridCacheTxConcurrency, GridCacheTxIsolation, long, boolean, GridInClosure[])
this method does not block and immediately returns execution future.
GridCacheFlag.LOCAL.
IllegalStateException - If transaction is already started by this thread.
GridException - If cache failure occurred.concurrency - Concurrency.isolation - Isolation.timeout - Timeout.invalidate - Invalidation policy.closures - Closures to execute in transaction.
<R> Collection<R> inTx(GridOutClosure<? super R>... closures) throws IllegalStateException, GridException
GridCacheFlag.LOCAL.
IllegalStateException - If transaction is already started by this thread.
GridException - If cache failure occurred.R - Type of out-closure return value.closures - Closures to execute in transaction.
<R> GridFuture<Collection<R>> inTxAsync(GridOutClosure<? super R>... closures) throws IllegalStateException, GridException
GridCacheProjection.inTx(GridOutClosure[]) this method does not block and
immediately returns execution future.
GridCacheFlag.LOCAL.
IllegalStateException - If transaction is already started by this thread.
GridException - If cache failure occurred.R - Type of out-closure return value.closures - Closures to execute in transaction.
<R> Collection<R> inTx(long timeout, GridOutClosure<? super R>... closures) throws IllegalStateException, GridException
GridCacheFlag.LOCAL.
IllegalStateException - If transaction is already started by this thread.
GridException - If cache failure occurred.R - Type of out-closure return value.timeout - Transaction timeout.closures - Closures to execute in transaction.
<R> GridFuture<Collection<R>> inTxAsync(long timeout, GridOutClosure<? super R>... closures) throws IllegalStateException, GridException
GridCacheProjection.inTx(long, GridOutClosure[]) this method does not
block and immediately returns execution future.
GridCacheFlag.LOCAL.
IllegalStateException - If transaction is already started by this thread.
GridException - If cache failure occurred.R - Type of out-closure return value.timeout - Transaction timeout.closures - Closures to execute in transaction.
<R> Collection<R> inTx(GridCacheTxConcurrency concurrency, GridCacheTxIsolation isolation, GridOutClosure<? super R>... closures) throws IllegalStateException, GridException
GridCacheFlag.LOCAL.
IllegalStateException - If transaction is already started by this thread.
GridException - If cache failure occurred.R - Type of out-closure return value.concurrency - Concurrency.isolation - Isolation.closures - Closures to execute in transaction.
<R> GridFuture<Collection<R>> inTxAsync(GridCacheTxConcurrency concurrency, GridCacheTxIsolation isolation, GridOutClosure<? super R>... closures) throws IllegalStateException, GridException
GridCacheProjection.inTx(GridCacheTxConcurrency, GridCacheTxIsolation, GridOutClosure[])
this method does not block and immediately returns execution future.
GridCacheFlag.LOCAL.
IllegalStateException - If transaction is already started by this thread.
GridException - If cache failure occurred.R - Type of out-closure return value.concurrency - Concurrency.isolation - Isolation.closures - Closures to execute in transaction.
<R> Collection<R> inTx(GridCacheTxConcurrency concurrency, GridCacheTxIsolation isolation, long timeout, boolean invalidate, GridOutClosure<? super R>... closures) throws IllegalStateException, GridException
GridCacheFlag.LOCAL.
IllegalStateException - If transaction is already started by this thread.
GridException - If cache failure occurred.R - Type of out-closure return value.concurrency - Concurrency.isolation - Isolation.timeout - Timeout.invalidate - Invalidation policy.closures - Closures to execute in transaction.
<R> GridFuture<Collection<R>> inTxAsync(GridCacheTxConcurrency concurrency, GridCacheTxIsolation isolation, long timeout, boolean invalidate, GridOutClosure<? super R>... closures) throws IllegalStateException, GridException
GridCacheProjection.inTx(GridCacheTxConcurrency, GridCacheTxIsolation, long, boolean, GridOutClosure[])
this method does not block and immediately returns execution future.
GridCacheFlag.LOCAL.
IllegalStateException - If transaction is already started by this thread.
GridException - If cache failure occurred.R - Type of out-closure return value.concurrency - Concurrency.isolation - Isolation.timeout - Timeout.invalidate - Invalidation policy.closures - Closures to execute in transaction.
ConcurrentMap<K,V> toMap()
ConcurrentMap interface.
ConcurrentMap representation of given cache.int partitions()
GridCacheAffinity,
GridCacheConfiguration.getAffinity(),
GridCacheConfigurationAdapter.setAffinity(GridCacheAffinity)int partition(K key)
key - Key to get partition id for.
GridCacheAffinity,
GridCacheConfiguration.getAffinity(),
GridCacheConfigurationAdapter.setAffinity(GridCacheAffinity)int[] primaryPartitions(GridProjection p)
Note that since GridRichNode implements GridProjection,
to find out primary partitions for a single node just pass
a single node into this method.
p - Grid projection.
GridCacheAffinity,
GridCacheConfiguration.getAffinity(),
GridCacheConfigurationAdapter.setAffinity(GridCacheAffinity)
int[] backupPartitions(GridProjection p,
@Nullable
int... levels)
first backup or third backup by specifying the
'levels parameter. If no 'level' is specified then
all backup partitions are returned.
Note that since GridRichNode implements GridProjection,
to find out backup partitions for a single node, just pass that single
node into this method.
p - Grid projection.levels - Optional backup levels. If they are empty then this method checks
all backup levels. Level numbers starts with 0.
GridCacheAffinity,
GridCacheConfiguration.getAffinity(),
GridCacheConfigurationAdapter.setAffinity(GridCacheAffinity)int[] allPartitions(GridProjection p)
Note that since GridRichNode implements GridProjection,
to find out all partitions for a single node, just pass that single
node into this method.
p - Grid projection.
GridCacheAffinity,
GridCacheConfiguration.getAffinity(),
GridCacheConfigurationAdapter.setAffinity(GridCacheAffinity)GridRichNode mapPartitionToNode(int part)
part - Partition id.
GridCacheAffinity,
GridCacheConfiguration.getAffinity(),
GridCacheConfigurationAdapter.setAffinity(GridCacheAffinity)Map<Integer,GridRichNode> mapPartitionsToNodes(int part, @Nullable int... parts)
part - Partition id.parts - Optional additional partition ids.
GridCacheAffinity,
GridCacheConfiguration.getAffinity(),
GridCacheConfigurationAdapter.setAffinity(GridCacheAffinity)Map<Integer,GridRichNode> mapPartitionsToNodes(int[] parts)
parts - Partition ids.
GridCacheAffinity,
GridCacheConfiguration.getAffinity(),
GridCacheConfigurationAdapter.setAffinity(GridCacheAffinity)Map<Integer,GridRichNode> mapPartitionsToNodes(Collection<Integer> parts)
parts - Partition ids.
GridCacheAffinity,
GridCacheConfiguration.getAffinity(),
GridCacheConfigurationAdapter.setAffinity(GridCacheAffinity)Object affinityKey(K key)
key - Key to map.
|
GridGain 3.6.0e
Enterprise Edition |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
|
GridGain - Real Time Big Data
|
|
|