Apache Ignite.NET
Apache.Ignite.Core.Cache.ICache< TK, TV > Interface Template Reference

Main entry point for Ignite cache APIs. You can get a named cache by calling IIgnite.GetCache<TK,TV> method. More...

Inheritance diagram for Apache.Ignite.Core.Cache.ICache< TK, TV >:

Public Member Functions

CacheConfiguration GetConfiguration ()
 Gets the cache configuration. More...
 
bool IsEmpty ()
 Checks whether this cache contains no key-value mappings. More...
 
ICache< TK, TV > WithSkipStore ()
 Get another cache instance with read-through and write-through behavior disabled. More...
 
ICache< TK, TV > WithExpiryPolicy (IExpiryPolicy plc)
 Returns cache with the specified expired policy set. This policy will be used for each operation invoked on the returned cache. More...
 
ICache< TK1, TV1 > WithKeepBinary< TK1, TV1 > ()
 Gets cache with KeepBinary mode enabled, changing key and/or value types if necessary. You can only change key/value types when transitioning from non-binary to binary cache; Changing type of binary cache is not allowed and will throw an InvalidOperationException More...
 
void LoadCache (ICacheEntryFilter< TK, TV > p, params object[] args)
 Executes LocalLoadCache on all cache nodes. More...
 
Task LoadCacheAsync (ICacheEntryFilter< TK, TV > p, params object[] args)
 Executes LocalLoadCache on all cache nodes. More...
 
void LocalLoadCache (ICacheEntryFilter< TK, TV > p, params object[] args)
 Delegates to ICacheStore<K, V>.LoadCache method to load state from the underlying persistent storage. The loaded values will then be given to the optionally passed in predicate, and, if the predicate returns true, will be stored in cache. If predicate is null, then all loaded values will be stored in cache. More...
 
Task LocalLoadCacheAsync (ICacheEntryFilter< TK, TV > p, params object[] args)
 Delegates to ICacheStore<K, V>.LoadCache method to load state from the underlying persistent storage. The loaded values will then be given to the optionally passed in predicate, and, if the predicate returns true, will be stored in cache. If predicate is null, then all loaded values will be stored in cache. More...
 
void LoadAll (IEnumerable< TK > keys, bool replaceExistingValues)
 Loads the specified entries into the cache using the configured ICacheStore> for the given keys. More...
 
Task LoadAllAsync (IEnumerable< TK > keys, bool replaceExistingValues)
 Asynchronously loads the specified entries into the cache using the configured ICacheStore> for the given keys. More...
 
bool ContainsKey (TK key)
 Check if cache contains mapping for this key. More...
 
Task< bool > ContainsKeyAsync (TK key)
 Check if cache contains mapping for this key. More...
 
bool ContainsKeys (IEnumerable< TK > keys)
 Check if cache contains mapping for these keys. More...
 
Task< bool > ContainsKeysAsync (IEnumerable< TK > keys)
 Check if cache contains mapping for these keys. More...
 
TV LocalPeek (TK key, params CachePeekMode[] modes)
 Peeks at cached value using optional set of peek modes. This method will sequentially iterate over given peek modes, and try to peek at value using each peek mode. Once a non-null value is found, it will be immediately returned. This method does not participate in any transactions, however, it may peek at transactional value depending on the peek modes used. If key is not present in cache, KeyNotFoundException will be thrown. More...
 
bool TryLocalPeek (TK key, out TV value, params CachePeekMode[] modes)
 Peeks at cached value using optional set of peek modes. This method will sequentially iterate over given peek modes, and try to peek at value using each peek mode. Once a non-null value is found, it will be immediately returned. This method does not participate in any transactions, however, it may peek at transactional value depending on the peek modes used. More...
 
TV Get (TK key)
 Retrieves value mapped to the specified key from cache. Throws an exception if t More...
 
Task< TV > GetAsync (TK key)
 Retrieves value mapped to the specified key from cache. Throws an exception if t More...
 
bool TryGet (TK key, out TV value)
 Retrieves value mapped to the specified key from cache. 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 persistent store. This method is transactional and will enlist the entry into ongoing transaction if there is one. More...
 
Task< CacheResult< TV > > TryGetAsync (TK key)
 Retrieves value mapped to the specified key from cache. 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 persistent store. This method is transactional and will enlist the entry into ongoing transaction if there is one. More...
 
ICollection< ICacheEntry< TK, TV > > GetAll (IEnumerable< TK > keys)
 Retrieves values mapped to the specified keys from cache. 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 persistent store. This method is transactional and will enlist the entry into ongoing transaction if there is one. More...
 
Task< ICollection< ICacheEntry< TK, TV > > > GetAllAsync (IEnumerable< TK > keys)
 Retrieves values mapped to the specified keys from cache. 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 persistent store. This method is transactional and will enlist the entry into ongoing transaction if there is one. More...
 
void Put (TK key, TV val)
 Associates the specified value with the specified key in the cache. More...
 
Task PutAsync (TK key, TV val)
 Associates the specified value with the specified key in the cache. More...
 
CacheResult< TV > GetAndPut (TK key, TV val)
 Associates the specified value with the specified key in this cache, returning an existing value if one existed. More...
 
Task< CacheResult< TV > > GetAndPutAsync (TK key, TV val)
 Associates the specified value with the specified key in this cache, returning an existing value if one existed. More...
 
CacheResult< TV > GetAndReplace (TK key, TV val)
 Atomically replaces the value for a given key if and only if there is a value currently mapped by the key. More...
 
Task< CacheResult< TV > > GetAndReplaceAsync (TK key, TV val)
 Atomically replaces the value for a given key if and only if there is a value currently mapped by the key. More...
 
CacheResult< TV > GetAndRemove (TK key)
 Atomically removes the entry for a key only if currently mapped to some value. More...
 
Task< CacheResult< TV > > GetAndRemoveAsync (TK key)
 Atomically removes the entry for a key only if currently mapped to some value. More...
 
bool PutIfAbsent (TK key, TV val)
 Atomically associates the specified key with the given value if it is not already associated with a value. More...
 
Task< bool > PutIfAbsentAsync (TK key, TV val)
 Atomically associates the specified key with the given value if it is not already associated with a value. More...
 
CacheResult< TV > GetAndPutIfAbsent (TK key, TV val)
 Stores given key-value pair in cache only if cache had no previous mapping for it. If cache previously contained value for the given key, then this value is returned. In case of PARTITIONED or REPLICATED caches, the value will be loaded from the primary node, which in its turn may load the value from the swap storage, and consecutively, if it's not in swap, from the underlying persistent storage. If the returned value is not needed, method putxIfAbsent() should 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 store. This method is transactional and will enlist the entry into ongoing transaction if there is one. More...
 
Task< CacheResult< TV > > GetAndPutIfAbsentAsync (TK key, TV val)
 Stores given key-value pair in cache only if cache had no previous mapping for it. If cache previously contained value for the given key, then this value is returned. In case of PARTITIONED or REPLICATED caches, the value will be loaded from the primary node, which in its turn may load the value from the swap storage, and consecutively, if it's not in swap, from the underlying persistent storage. If the returned value is not needed, method putxIfAbsent() should 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 store. This method is transactional and will enlist the entry into ongoing transaction if there is one. More...
 
bool Replace (TK key, TV val)
 Stores given key-value pair in cache only if there is a previous mapping for it. If cache previously contained value for the given key, then this value is returned. In case of PARTITIONED or REPLICATED caches, the value will be loaded from the primary node, which in its turn may load the value from the swap storage, and consecutively, if it's not in swap, rom the underlying persistent storage. If write-through is enabled, the stored value will be persisted to store. This method is transactional and will enlist the entry into ongoing transaction if there is one. More...
 
Task< bool > ReplaceAsync (TK key, TV val)
 Stores given key-value pair in cache only if there is a previous mapping for it. If cache previously contained value for the given key, then this value is returned. In case of PARTITIONED or REPLICATED caches, the value will be loaded from the primary node, which in its turn may load the value from the swap storage, and consecutively, if it's not in swap, rom the underlying persistent storage. If write-through is enabled, the stored value will be persisted to store. This method is transactional and will enlist the entry into ongoing transaction if there is one. More...
 
bool Replace (TK key, TV oldVal, TV newVal)
 Stores given key-value pair in cache only if only if the previous value is equal to the old value passed as argument. This method is transactional and will enlist the entry into ongoing transaction if there is one. More...
 
Task< bool > ReplaceAsync (TK key, TV oldVal, TV newVal)
 Stores given key-value pair in cache only if only if the previous value is equal to the old value passed as argument. This method is transactional and will enlist the entry into ongoing transaction if there is one. More...
 
void PutAll (IEnumerable< KeyValuePair< TK, TV >> vals)
 Stores given key-value pairs in cache. If write-through is enabled, the stored values will be persisted to store. This method is transactional and will enlist the entry into ongoing transaction if there is one. More...
 
Task PutAllAsync (IEnumerable< KeyValuePair< TK, TV >> vals)
 Stores given key-value pairs in cache. If write-through is enabled, the stored values will be persisted to store. This method is transactional and will enlist the entry into ongoing transaction if there is one. More...
 
void LocalEvict (IEnumerable< TK > keys)
 Attempts to evict all entries associated with keys. Note, that entry will be evicted only if it's not used (not participating in any locks or transactions). More...
 
void Clear ()
 Clears the contents of the cache, without notifying listeners or CacheWriters. More...
 
Task ClearAsync ()
 Clears the contents of the cache, without notifying listeners or CacheWriters. More...
 
void Clear (TK key)
 Clear entry from the cache and swap storage, without notifying listeners or CacheWriters. Entry is cleared only if it is not currently locked, and is not participating in a transaction. More...
 
Task ClearAsync (TK key)
 Clear entry from the cache and swap storage, without notifying listeners or CacheWriters. Entry is cleared only if it is not currently locked, and is not participating in a transaction. More...
 
void ClearAll (IEnumerable< TK > keys)
 Clear entries from the cache and swap storage, without notifying listeners or CacheWriters. Entry is cleared only if it is not currently locked, and is not participating in a transaction. More...
 
Task ClearAllAsync (IEnumerable< TK > keys)
 Clear entries from the cache and swap storage, without notifying listeners or CacheWriters. Entry is cleared only if it is not currently locked, and is not participating in a transaction. More...
 
void LocalClear (TK key)
 Clear entry from the cache and swap storage, without notifying listeners or CacheWriters. Entry is cleared only if it is not currently locked, and is not participating in a transaction. More...
 
void LocalClearAll (IEnumerable< TK > keys)
 Clear entries from the cache and swap storage, without notifying listeners or CacheWriters. Entry is cleared only if it is not currently locked, and is not participating in a transaction. More...
 
bool Remove (TK key)
 Removes given key mapping from cache. If cache previously contained value for the given key, then this value is returned. In case of PARTITIONED or REPLICATED caches, the value will be loaded from the primary node, which in its turn may load the value from the disk-based swap storage, and consecutively, if it's not in swap, from the underlying persistent storage. If the returned value is not needed, method removex() 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 store. This method is transactional and will enlist the entry into ongoing transaction if there is one. More...
 
Task< bool > RemoveAsync (TK key)
 Removes given key mapping from cache. If cache previously contained value for the given key, then this value is returned. In case of PARTITIONED or REPLICATED caches, the value will be loaded from the primary node, which in its turn may load the value from the disk-based swap storage, and consecutively, if it's not in swap, from the underlying persistent storage. If the returned value is not needed, method removex() 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 store. This method is transactional and will enlist the entry into ongoing transaction if there is one. More...
 
bool Remove (TK key, TV val)
 Removes given key mapping from cache if one exists and value is equal to the passed in value. If write-through is enabled, the value will be removed from store. This method is transactional and will enlist the entry into ongoing transaction if there is one. More...
 
Task< bool > RemoveAsync (TK key, TV val)
 Removes given key mapping from cache if one exists and value is equal to the passed in value. If write-through is enabled, the value will be removed from store. This method is transactional and will enlist the entry into ongoing transaction if there is one. More...
 
void RemoveAll (IEnumerable< TK > keys)
 Removes given key mappings from cache. If write-through is enabled, the value will be removed from store. This method is transactional and will enlist the entry into ongoing transaction if there is one. More...
 
Task RemoveAllAsync (IEnumerable< TK > keys)
 Removes given key mappings from cache. If write-through is enabled, the value will be removed from store. This method is transactional and will enlist the entry into ongoing transaction if there is one. More...
 
void RemoveAll ()
 Removes all mappings from cache. If write-through is enabled, the value will be removed from store. This method is not transactional. More...
 
Task RemoveAllAsync ()
 Removes all mappings from cache. If write-through is enabled, the value will be removed from store. This method is not transactional. More...
 
int GetLocalSize (params CachePeekMode[] modes)
 Gets the number of all entries cached on this node. More...
 
int GetSize (params CachePeekMode[] modes)
 Gets the number of all entries cached across all nodes. More...
 
Task< int > GetSizeAsync (params CachePeekMode[] modes)
 Gets the number of all entries cached across all nodes. More...
 
IQueryCursor< ICacheEntry< TK, TV > > Query (QueryBase qry)
 Queries cache. More...
 
IQueryCursor< IList > QueryFields (SqlFieldsQuery qry)
 Queries separate entry fields. More...
 
IContinuousQueryHandle QueryContinuous (ContinuousQuery< TK, TV > qry)
 Start continuous query execution. More...
 
IContinuousQueryHandle< ICacheEntry< TK, TV > > QueryContinuous (ContinuousQuery< TK, TV > qry, QueryBase initialQry)
 Start continuous query execution. More...
 
IEnumerable< ICacheEntry< TK, TV > > GetLocalEntries (params CachePeekMode[] peekModes)
 Get local cache entries. More...
 
TRes Invoke< TArg, TRes > (TK key, ICacheEntryProcessor< TK, TV, TArg, TRes > processor, TArg arg)
 Invokes an ICacheEntryProcessor<K, V, A, R> against the IMutableCacheEntry<K, V> specified by the provided key. If an entry does not exist for the specified key, an attempt is made to load it (if a loader is configured) or a surrogate entry, consisting of the key with a null value is used instead. More...
 
Task< TRes > InvokeAsync< TArg, TRes > (TK key, ICacheEntryProcessor< TK, TV, TArg, TRes > processor, TArg arg)
 Invokes an ICacheEntryProcessor<K, V, A, R> against the IMutableCacheEntry<K, V> specified by the provided key. If an entry does not exist for the specified key, an attempt is made to load it (if a loader is configured) or a surrogate entry, consisting of the key with a null value is used instead. More...
 
ICollection< ICacheEntryProcessorResult< TK, TRes > > InvokeAll< TArg, TRes > (IEnumerable< TK > keys, ICacheEntryProcessor< TK, TV, TArg, TRes > processor, TArg arg)
 Invokes an ICacheEntryProcessor<K, V, A, R> against a set of keys. If an entry does not exist for the specified key, an attempt is made to load it (if a loader is configured) or a surrogate entry, consisting of the key with a null value is used instead. More...
 
Task< ICollection< ICacheEntryProcessorResult< TK, TRes > > > InvokeAllAsync< TArg, TRes > (IEnumerable< TK > keys, ICacheEntryProcessor< TK, TV, TArg, TRes > processor, TArg arg)
 Invokes an ICacheEntryProcessor<K, V, A, R> against a set of keys. If an entry does not exist for the specified key, an attempt is made to load it (if a loader is configured) or a surrogate entry, consisting of the key with a null value is used instead. More...
 
ICacheLock Lock (TK key)
 Creates an ICacheLock instance associated with passed key. This method does not acquire lock immediately, you have to call appropriate method on returned instance. More...
 
ICacheLock LockAll (IEnumerable< TK > keys)
 Creates an ICacheLock instance associated with passed keys. This method does not acquire lock immediately, you have to call appropriate method on returned instance. More...
 
bool IsLocalLocked (TK key, bool byCurrentThread)
 Checks if specified key is locked. More...
 
ICacheMetrics GetMetrics ()
 Gets global (whole cluster) snapshot metrics (statistics) for this cache. More...
 
ICacheMetrics GetMetrics (IClusterGroup clusterGroup)
 Gets global (whole cluster group) snapshot metrics (statistics) for this cache. More...
 
ICacheMetrics GetLocalMetrics ()
 Gets local snapshot metrics (statistics) for this cache. More...
 
Task Rebalance ()
 Rebalances cache partitions. This method is usually used when rebalanceDelay configuration parameter has non-zero value. When many nodes are started or stopped almost concurrently, it is more efficient to delay rebalancing until the node topology is stable to make sure that no redundant re-partitioning happens. More...
 
ICache< TK, TV > WithNoRetries ()
 Get another cache instance with no-retries behavior enabled. More...
 
ICache< TK, TV > WithPartitionRecover ()
 Gets an instance of cache that will be allowed to execute cache operations (read, write) regardless of partition loss policy. More...
 
ICollection< int > GetLostPartitions ()
 Gets lost partitions IDs. More...
 

Properties

string Name [get]
 Name of this cache (null for default cache). More...
 
IIgnite Ignite [get]
 Ignite hosting this cache. More...
 
bool IsKeepBinary [get]
 Gets a value indicating whether to keep values in binary form. More...
 
TV this[TK key] [get, set]
 Gets or sets a cache value with the specified key. Shortcut to Get and Put More...
 

Detailed Description

Cache API supports distributed transactions. All 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 ITransaction documentation for more information about transactions.

Neither 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.

Note that cache is generic and you can only work with provided key and value types. If cache also contains keys or values of other types, any attempt to retrieve them will result in InvalidCastException. Use ICache<Object, Object> in order to work with entries of arbitrary types.

All members are thread-safe and may be used concurrently from multiple threads.

Template Parameters
TKKey type.
TVValue type.

Member Function Documentation

void Apache.Ignite.Core.Cache.ICache< TK, TV >.Clear ( )
void Apache.Ignite.Core.Cache.ICache< TK, TV >.Clear ( TK  key)
Parameters
keyKey to clear.
void Apache.Ignite.Core.Cache.ICache< TK, TV >.ClearAll ( IEnumerable< TK >  keys)
Parameters
keysKeys to clear.
Task Apache.Ignite.Core.Cache.ICache< TK, TV >.ClearAllAsync ( IEnumerable< TK >  keys)
Parameters
keysKeys to clear.
Task Apache.Ignite.Core.Cache.ICache< TK, TV >.ClearAsync ( )
Task Apache.Ignite.Core.Cache.ICache< TK, TV >.ClearAsync ( TK  key)
Parameters
keyKey to clear.
bool Apache.Ignite.Core.Cache.ICache< TK, TV >.ContainsKey ( TK  key)
Parameters
keyKey.
Returns
True if cache contains mapping for this key.
Task<bool> Apache.Ignite.Core.Cache.ICache< TK, TV >.ContainsKeyAsync ( TK  key)
Parameters
keyKey.
Returns
True if cache contains mapping for this key.
bool Apache.Ignite.Core.Cache.ICache< TK, TV >.ContainsKeys ( IEnumerable< TK >  keys)
Parameters
keysKeys.
Returns
True if cache contains mapping for all these keys.
Task<bool> Apache.Ignite.Core.Cache.ICache< TK, TV >.ContainsKeysAsync ( IEnumerable< TK >  keys)
Parameters
keysKeys.
Returns
True if cache contains mapping for all these keys.
TV Apache.Ignite.Core.Cache.ICache< TK, TV >.Get ( TK  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 persistent store. This method is transactional and will enlist the entry into ongoing transaction if there is one. If key is not present in cache, KeyNotFoundException will be thrown.

Parameters
keyKey.
Returns
Value.
ICollection<ICacheEntry<TK, TV> > Apache.Ignite.Core.Cache.ICache< TK, TV >.GetAll ( IEnumerable< TK >  keys)
Parameters
keysKeys.
Returns
Map of key-value pairs.
Task<ICollection<ICacheEntry<TK, TV> > > Apache.Ignite.Core.Cache.ICache< TK, TV >.GetAllAsync ( IEnumerable< TK >  keys)
Parameters
keysKeys.
Returns
Map of key-value pairs.
CacheResult<TV> Apache.Ignite.Core.Cache.ICache< TK, TV >.GetAndPut ( TK  key,
TV  val 
)
Parameters
keyKey with which the specified value is to be associated.
valValue to be associated with the specified key.
Returns
The value associated with the key at the start of the operation.
Task<CacheResult<TV> > Apache.Ignite.Core.Cache.ICache< TK, TV >.GetAndPutAsync ( TK  key,
TV  val 
)
Parameters
keyKey with which the specified value is to be associated.
valValue to be associated with the specified key.
Returns
The value associated with the key at the start of the operation.
CacheResult<TV> Apache.Ignite.Core.Cache.ICache< TK, TV >.GetAndPutIfAbsent ( TK  key,
TV  val 
)
Parameters
keyKey to store in cache.
valValue to be associated with the given key.
Returns
Previously contained value regardless of whether put happened or not.
Task<CacheResult<TV> > Apache.Ignite.Core.Cache.ICache< TK, TV >.GetAndPutIfAbsentAsync ( TK  key,
TV  val 
)
Parameters
keyKey to store in cache.
valValue to be associated with the given key.
Returns
Previously contained value regardless of whether put happened or not.
CacheResult<TV> Apache.Ignite.Core.Cache.ICache< TK, TV >.GetAndRemove ( TK  key)
Parameters
keyKey with which the specified value is associated.
Returns
The value if one existed.
Task<CacheResult<TV> > Apache.Ignite.Core.Cache.ICache< TK, TV >.GetAndRemoveAsync ( TK  key)
Parameters
keyKey with which the specified value is associated.
Returns
The value if one existed.
CacheResult<TV> Apache.Ignite.Core.Cache.ICache< TK, TV >.GetAndReplace ( TK  key,
TV  val 
)
Parameters
keyKey with which the specified value is to be associated.
valValue to be associated with the specified key.
Returns
The previous value associated with the specified key.
Task<CacheResult<TV> > Apache.Ignite.Core.Cache.ICache< TK, TV >.GetAndReplaceAsync ( TK  key,
TV  val 
)
Parameters
keyKey with which the specified value is to be associated.
valValue to be associated with the specified key.
Returns
The previous value associated with the specified key.
Task<TV> Apache.Ignite.Core.Cache.ICache< TK, TV >.GetAsync ( TK  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 persistent store. This method is transactional and will enlist the entry into ongoing transaction if there is one. If key is not present in cache, KeyNotFoundException will be thrown.

Parameters
keyKey.
Returns
Value.
CacheConfiguration Apache.Ignite.Core.Cache.ICache< TK, TV >.GetConfiguration ( )
IEnumerable<ICacheEntry<TK, TV> > Apache.Ignite.Core.Cache.ICache< TK, TV >.GetLocalEntries ( params CachePeekMode[]  peekModes)
Parameters
peekModesPeek modes.
Returns
Enumerable instance.
ICacheMetrics Apache.Ignite.Core.Cache.ICache< TK, TV >.GetLocalMetrics ( )
Returns
Cache metrics.
int Apache.Ignite.Core.Cache.ICache< TK, TV >.GetLocalSize ( params CachePeekMode[]  modes)
Parameters
modesOptional peek modes. If not provided, then total cache size is returned.
Returns
Cache size on this node.
Returns
Cache metrics.
ICacheMetrics Apache.Ignite.Core.Cache.ICache< TK, TV >.GetMetrics ( IClusterGroup  clusterGroup)
Parameters
clusterGroupThe cluster group to get metrics for.
int Apache.Ignite.Core.Cache.ICache< TK, TV >.GetSize ( params CachePeekMode[]  modes)

NOTE: this operation is distributed and will query all participating nodes for their cache sizes.

Parameters
modesOptional peek modes. If not provided, then total cache size is returned.
Returns
Cache size across all nodes.
Task<int> Apache.Ignite.Core.Cache.ICache< TK, TV >.GetSizeAsync ( params CachePeekMode[]  modes)

NOTE: this operation is distributed and will query all participating nodes for their cache sizes.

Parameters
modesOptional peek modes. If not provided, then total cache size is returned.
Returns
Cache size across all nodes.
TRes Apache.Ignite.Core.Cache.ICache< TK, TV >.Invoke< TArg, TRes > ( TK  key,
ICacheEntryProcessor< TK, TV, TArg, TRes >  processor,
TArg  arg 
)
Template Parameters
TArgThe type of the argument.
TResThe type of the result.
Parameters
keyThe key.
processorThe processor.
argThe argument.
Returns
Result of the processing.
Exceptions
CacheEntryProcessorExceptionIf an exception has occured during processing.
ICollection<ICacheEntryProcessorResult<TK, TRes> > Apache.Ignite.Core.Cache.ICache< TK, TV >.InvokeAll< TArg, TRes > ( IEnumerable< TK >  keys,
ICacheEntryProcessor< TK, TV, TArg, TRes >  processor,
TArg  arg 
)

The order that the entries for the keys are processed is undefined. Implementations may choose to process the entries in any order, including concurrently. Furthermore there is no guarantee implementations will use the same processor instance to process each entry, as the case may be in a non-local cache topology.

Template Parameters
TArgThe type of the argument.
TResThe type of the result.
Parameters
keysThe keys.
processorThe processor.
argThe argument.
Returns
Map of ICacheEntryProcessorResult<K, R> of the processing per key, if any, defined by the ICacheEntryProcessor<K,V,A,R> implementation. No mappings will be returned for processors that return a null value for a key.
Exceptions
CacheEntryProcessorExceptionIf an exception has occured during processing.
Task<ICollection<ICacheEntryProcessorResult<TK, TRes> > > Apache.Ignite.Core.Cache.ICache< TK, TV >.InvokeAllAsync< TArg, TRes > ( IEnumerable< TK >  keys,
ICacheEntryProcessor< TK, TV, TArg, TRes >  processor,
TArg  arg 
)

The order that the entries for the keys are processed is undefined. Implementations may choose to process the entries in any order, including concurrently. Furthermore there is no guarantee implementations will use the same processor instance to process each entry, as the case may be in a non-local cache topology.

Template Parameters
TArgThe type of the argument.
TResThe type of the result.
Parameters
keysThe keys.
processorThe processor.
argThe argument.
Returns
Map of ICacheEntryProcessorResult<K, R> of the processing per key, if any, defined by the ICacheEntryProcessor<K,V,A,R> implementation. No mappings will be returned for processors that return a null value for a key.
Exceptions
CacheEntryProcessorExceptionIf an exception has occured during processing.
Task<TRes> Apache.Ignite.Core.Cache.ICache< TK, TV >.InvokeAsync< TArg, TRes > ( TK  key,
ICacheEntryProcessor< TK, TV, TArg, TRes >  processor,
TArg  arg 
)
Template Parameters
TArgThe type of the argument.
TResThe type of the result.
Parameters
keyThe key.
processorThe processor.
argThe argument.
Returns
Result of the processing.
Exceptions
CacheEntryProcessorExceptionIf an exception has occured during processing.
bool Apache.Ignite.Core.Cache.ICache< TK, TV >.IsEmpty ( )

Semantically equals to ICache.Size(CachePeekMode.PRIMARY) == 0.

bool Apache.Ignite.Core.Cache.ICache< TK, TV >.IsLocalLocked ( TK  key,
bool  byCurrentThread 
)

This is a local operation and does not involve any network trips or access to persistent storage in any way.

Parameters
keyKey to check.
byCurrentThreadIf true, checks that current thread owns a lock on this key; otherwise, checks that any thread on any node owns a lock on this key.
Returns
True if specified key is locked; otherwise, false.
void Apache.Ignite.Core.Cache.ICache< TK, TV >.LoadAll ( IEnumerable< TK >  keys,
bool  replaceExistingValues 
)

If an entry for a key already exists in the cache, a value will be loaded if and only if replaceExistingValues is true. If no loader is configured for the cache, no objects will be loaded.

Parameters
keysThe keys to load.
replaceExistingValuesif set to true, existing cache values will be replaced by those loaded from a cache store.
Task Apache.Ignite.Core.Cache.ICache< TK, TV >.LoadAllAsync ( IEnumerable< TK >  keys,
bool  replaceExistingValues 
)

If an entry for a key already exists in the cache, a value will be loaded if and only if replaceExistingValues is true. If no loader is configured for the cache, no objects will be loaded.

Parameters
keysThe keys to load.
replaceExistingValuesif set to true, existing cache values will be replaced by those loaded from a cache store.
void Apache.Ignite.Core.Cache.ICache< TK, TV >.LoadCache ( ICacheEntryFilter< TK, TV >  p,
params object[]  args 
)
Parameters
pOptional predicate. If provided, will be used to filter values to be put into cache.
argsOptional user arguments to be passed into ICacheStore<K, V>.LoadCache.
Task Apache.Ignite.Core.Cache.ICache< TK, TV >.LoadCacheAsync ( ICacheEntryFilter< TK, TV >  p,
params object[]  args 
)
Parameters
pOptional predicate. If provided, will be used to filter values to be put into cache.
argsOptional user arguments to be passed into ICacheStore<K, V>.LoadCache.
void Apache.Ignite.Core.Cache.ICache< TK, TV >.LocalClear ( TK  key)

Note that this operation is local as it merely clears an entry from local cache, it does not remove entries from remote caches.

Parameters
keyKey to clear.
void Apache.Ignite.Core.Cache.ICache< TK, TV >.LocalClearAll ( IEnumerable< TK >  keys)

Note that this operation is local as it merely clears entries from local cache, it does not remove entries from remote caches.

Parameters
keysKeys to clear.
void Apache.Ignite.Core.Cache.ICache< TK, TV >.LocalEvict ( IEnumerable< TK >  keys)
Parameters
keysKeys to evict from cache.
void Apache.Ignite.Core.Cache.ICache< TK, TV >.LocalLoadCache ( ICacheEntryFilter< TK, TV >  p,
params object[]  args 
)
Parameters
pOptional predicate. If provided, will be used to filter values to be put into cache.
argsOptional user arguments to be passed into ICacheStore<K, V>.LoadCache.
Task Apache.Ignite.Core.Cache.ICache< TK, TV >.LocalLoadCacheAsync ( ICacheEntryFilter< TK, TV >  p,
params object[]  args 
)
Parameters
pOptional predicate. If provided, will be used to filter values to be put into cache.
argsOptional user arguments to be passed into ICacheStore<K, V>.LoadCache.
TV Apache.Ignite.Core.Cache.ICache< TK, TV >.LocalPeek ( TK  key,
params CachePeekMode[]  modes 
)
Parameters
keyKey.
modesPeek modes.
Returns
Peeked value.
ICacheLock Apache.Ignite.Core.Cache.ICache< TK, TV >.Lock ( TK  key)
Parameters
keyKey for lock.
Returns
New ICacheLock instance associated with passed key.
ICacheLock Apache.Ignite.Core.Cache.ICache< TK, TV >.LockAll ( IEnumerable< TK >  keys)
Parameters
keysKeys for lock.
Returns
New ICacheLock instance associated with passed keys.
void Apache.Ignite.Core.Cache.ICache< TK, TV >.Put ( TK  key,
TV  val 
)

If the cache previously contained a mapping for the key, the old value is replaced by the specified value.

Parameters
keyKey with which the specified value is to be associated.
valValue to be associated with the specified key.
void Apache.Ignite.Core.Cache.ICache< TK, TV >.PutAll ( IEnumerable< KeyValuePair< TK, TV >>  vals)
Parameters
valsKey-value pairs to store in cache.
Task Apache.Ignite.Core.Cache.ICache< TK, TV >.PutAllAsync ( IEnumerable< KeyValuePair< TK, TV >>  vals)
Parameters
valsKey-value pairs to store in cache.
Task Apache.Ignite.Core.Cache.ICache< TK, TV >.PutAsync ( TK  key,
TV  val 
)

If the cache previously contained a mapping for the key, the old value is replaced by the specified value.

Parameters
keyKey with which the specified value is to be associated.
valValue to be associated with the specified key.
bool Apache.Ignite.Core.Cache.ICache< TK, TV >.PutIfAbsent ( TK  key,
TV  val 
)
Parameters
keyKey with which the specified value is to be associated.
valValue to be associated with the specified key.
Returns
True if a value was set.
Task<bool> Apache.Ignite.Core.Cache.ICache< TK, TV >.PutIfAbsentAsync ( TK  key,
TV  val 
)
Parameters
keyKey with which the specified value is to be associated.
valValue to be associated with the specified key.
Returns
True if a value was set.
Parameters
qryQuery.
Returns
Cursor.
IContinuousQueryHandle Apache.Ignite.Core.Cache.ICache< TK, TV >.QueryContinuous ( ContinuousQuery< TK, TV >  qry)
Parameters
qryContinuous query.
Returns
Handle to stop query execution.
IContinuousQueryHandle<ICacheEntry<TK, TV> > Apache.Ignite.Core.Cache.ICache< TK, TV >.QueryContinuous ( ContinuousQuery< TK, TV >  qry,
QueryBase  initialQry 
)
Parameters
qryContinuous query.
initialQryThe initial query. This query will be executed before continuous listener is registered which allows to iterate through entries which have already existed at the time continuous query is executed.
Returns
Handle to get initial query cursor or stop query execution.
IQueryCursor<IList> Apache.Ignite.Core.Cache.ICache< TK, TV >.QueryFields ( SqlFieldsQuery  qry)
Parameters
qrySQL fields query.
Returns
Cursor.
Task Apache.Ignite.Core.Cache.ICache< TK, TV >.Rebalance ( )

In case of partitioned caches, for better efficiency user should usually make sure that new nodes get placed on the same place of consistent hash ring as the left nodes, and that nodes are restarted before rebalanceDelay expires.

Returns
Task that will be completed when rebalancing is finished.
bool Apache.Ignite.Core.Cache.ICache< TK, TV >.Remove ( TK  key)
Parameters
keyKey whose mapping is to be removed from cache.
Returns
False if there was no matching key.
bool Apache.Ignite.Core.Cache.ICache< TK, TV >.Remove ( TK  key,
TV  val 
)
Parameters
keyKey whose mapping is to be removed from cache.
valValue to match against currently cached value.
Returns
True if entry was removed, false otherwise.
void Apache.Ignite.Core.Cache.ICache< TK, TV >.RemoveAll ( IEnumerable< TK >  keys)
Parameters
keysKeys whose mappings are to be removed from cache.
void Apache.Ignite.Core.Cache.ICache< TK, TV >.RemoveAll ( )
Task Apache.Ignite.Core.Cache.ICache< TK, TV >.RemoveAllAsync ( IEnumerable< TK >  keys)
Parameters
keysKeys whose mappings are to be removed from cache.
Task Apache.Ignite.Core.Cache.ICache< TK, TV >.RemoveAllAsync ( )
Task<bool> Apache.Ignite.Core.Cache.ICache< TK, TV >.RemoveAsync ( TK  key)
Parameters
keyKey whose mapping is to be removed from cache.
Returns
False if there was no matching key.
Task<bool> Apache.Ignite.Core.Cache.ICache< TK, TV >.RemoveAsync ( TK  key,
TV  val 
)
Parameters
keyKey whose mapping is to be removed from cache.
valValue to match against currently cached value.
Returns
True if entry was removed, false otherwise.
bool Apache.Ignite.Core.Cache.ICache< TK, TV >.Replace ( TK  key,
TV  val 
)
Parameters
keyKey to store in cache.
valValue to be associated with the given key.
Returns
True if the value was replaced.
bool Apache.Ignite.Core.Cache.ICache< TK, TV >.Replace ( TK  key,
TV  oldVal,
TV  newVal 
)
Parameters
keyKey to store in cache.
oldValOld value to match.
newValValue to be associated with the given key.
Returns
True if replace happened, false otherwise.
Task<bool> Apache.Ignite.Core.Cache.ICache< TK, TV >.ReplaceAsync ( TK  key,
TV  val 
)
Parameters
keyKey to store in cache.
valValue to be associated with the given key.
Returns
True if the value was replaced.
Task<bool> Apache.Ignite.Core.Cache.ICache< TK, TV >.ReplaceAsync ( TK  key,
TV  oldVal,
TV  newVal 
)
Parameters
keyKey to store in cache.
oldValOld value to match.
newValValue to be associated with the given key.
Returns
True if replace happened, false otherwise.
bool Apache.Ignite.Core.Cache.ICache< TK, TV >.TryGet ( TK  key,
out TV  value 
)
Parameters
keyKey.
valueWhen this method returns, the value associated with the specified key, if the key is found; otherwise, the default value for the type of the value parameter. This parameter is passed uninitialized.
Returns
true if the cache contains an element with the specified key; otherwise, false.
Task<CacheResult<TV> > Apache.Ignite.Core.Cache.ICache< TK, TV >.TryGetAsync ( TK  key)
Parameters
keyKey.
Returns
CacheResult<T> containing a bool success flag and a value.
bool Apache.Ignite.Core.Cache.ICache< TK, TV >.TryLocalPeek ( TK  key,
out TV  value,
params CachePeekMode[]  modes 
)
Parameters
keyKey.
valueWhen this method returns, the value associated with the specified key, if the key is found; otherwise, the default value for the type of the value parameter. This parameter is passed uninitialized.
modesPeek modes.
Returns
true if the cache contains an element with the specified key; otherwise, false.
ICache<TK, TV> Apache.Ignite.Core.Cache.ICache< TK, TV >.WithExpiryPolicy ( IExpiryPolicy  plc)

Expiry durations for each operation are calculated only once and then used as constants. Please consider this when implementing customg expiry policy implementations.

Parameters
plcExpiry policy to use.
Returns
Cache instance with the specified expiry policy set.
ICache<TK1, TV1> Apache.Ignite.Core.Cache.ICache< TK, TV >.WithKeepBinary< TK1, TV1 > ( )
Template Parameters
TK1Key type in binary mode.
TV1Value type in binary mode.
Returns
Cache instance with binary mode enabled.
ICache<TK, TV> Apache.Ignite.Core.Cache.ICache< TK, TV >.WithNoRetries ( )
Returns
Cache with no-retries behavior enabled.
ICache<TK, TV> Apache.Ignite.Core.Cache.ICache< TK, TV >.WithPartitionRecover ( )
Returns
Cache without partition loss protection.
ICache<TK, TV> Apache.Ignite.Core.Cache.ICache< TK, TV >.WithSkipStore ( )
Returns
Cache with read-through and write-through behavior disabled.

Property Documentation

bool Apache.Ignite.Core.Cache.ICache< TK, TV >.IsKeepBinary
get
string Apache.Ignite.Core.Cache.ICache< TK, TV >.Name
get
TV Apache.Ignite.Core.Cache.ICache< TK, TV >.this[TK key]
getset
Parameters
keyKey.
Returns
Cache value with the specified key.