Class GridCacheAdapter<K,V>
- java.lang.Object
-
- org.apache.ignite.internal.processors.cache.GridCacheAdapter<K,V>
-
- All Implemented Interfaces:
Externalizable,Serializable,Iterable<javax.cache.Cache.Entry<K,V>>,IgniteInternalCache<K,V>
- Direct Known Subclasses:
GridDistributedCacheAdapter
public abstract class GridCacheAdapter<K,V> extends Object implements IgniteInternalCache<K,V>, Externalizable
Adapter for different cache implementations.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Field Summary
Fields Modifier and Type Field Description protected CacheConfigurationcacheCfgCache configuration.static intCLEAR_ALL_SPLIT_THRESHOLDclearLocally() split threshold.protected GridCacheContext<K,V>ctxCache configuration.static intDFLT_CACHE_RETRIES_COUNTstatic intDFLT_CACHE_START_SIZEstatic intDFLT_START_CACHE_SIZEDefault cache start size.protected ThreadLocal<GridCacheAdapter.FutureHolder>lastFutLast asynchronous future.protected UUIDlocNodeIdLocal node ID.protected IgniteLoggerlogLogger.protected GridCacheConcurrentMapmapLocal map.static intMAX_RETRIESMaximum number of retries when topology changes.protected CacheMetricsImplmetricsCache metrics.static StringNON_TRANSACTIONAL_IGNITE_CACHE_CLEAR_IN_TX_ERROR_MESSAGEException thrown when a non-transactional IgniteCache clear operation is invoked within a transaction.protected static IgniteClosureRET2NULLGridCacheReturn-to-null conversion.protected IgniteLoggertxLockMsgLogLogger.
-
Constructor Summary
Constructors Modifier Constructor Description protectedGridCacheAdapter()Empty constructor required byExternalizable.protectedGridCacheAdapter(GridCacheContext<K,V> ctx)protectedGridCacheAdapter(GridCacheContext<K,V> ctx, @Nullable GridCacheConcurrentMap map)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleanactive()voidactive(boolean active)Affinity<K>affinity()Gets affinity service to provide information about data partitioning and distribution.Iterable<? extends GridCacheEntryEx>allEntries()protected <T> IgniteInternalFuture<T>asyncOp(GridNearTxLocal tx, GridCacheAdapter.AsyncOp<T> op, CacheOperationContext opCtx, boolean retry)protected <T> @Nullable IgniteInternalFuture<T>asyncOpAcquire(boolean retry)Tries to acquire asynchronous operations permit, if limited.protected voidasyncOpRelease(boolean retry)Releases asynchronous operations permit, if limited.<K1,V1>
IgniteInternalCache<K1,V1>cache()Gets base cache for this projection.protected voidcheckJta()Checks if cache is working in JTA transaction and enlist cache as XAResource if necessary.voidclear()Clears cache on all nodes that store it's data.voidclear(K key)Clears key on all nodes that store it's data.voidclearAll(Set<? extends K> keys)Clears keys on all nodes that store it's data.IgniteInternalFuture<?>clearAllAsync(Set<? extends K> keys)IgniteInternalFuture<?>clearAsync()IgniteInternalFuture<?>clearAsync(K key)voidclearLocally(boolean srv, boolean near, boolean readers)Clears all entries from this cache only if the entry is not currently locked or participating in a transaction.voidclearLocally(Collection<KeyCacheObject> keys, boolean readers)booleanclearLocally(K key)Clears an entry from this cache and swap storage only if the entry is not currently locked, and is not participating in a transaction.voidclearLocallyAll(Set<? extends K> keys, boolean srv, boolean near, boolean readers)Clears entries from this cache and swap storage only if the entry is not currently locked, and is not participating in a transaction.CacheMetricsclusterMetrics()Gets whole cluster metrics (statistics) for this cache.CacheMetricsclusterMetrics(ClusterGroup grp)Gets cluster group metrics (statistics) for this cache.CacheConfigurationconfiguration()Gets configuration bean for this cache.booleancontainsKey(K key)IgniteInternalFuture<Boolean>containsKeyAsync(K key)booleancontainsKeys(Collection<? extends K> keys)IgniteInternalFuture<Boolean>containsKeysAsync(Collection<? extends K> keys)GridCacheContext<K,V>context()voiddecrementSize(GridCacheMapEntry e)Decrements map public size.Iterable<? extends GridCacheEntryEx>entries()GridCacheEntryExentryEx(Object key)GridCacheEntryExentryEx(KeyCacheObject key)GridCacheEntryExentryEx(KeyCacheObject key, AffinityTopologyVersion topVer)Set<javax.cache.Cache.Entry<K,V>>entrySet()Gets set of all entries cached on this node.Set<javax.cache.Cache.Entry<K,V>>entrySet(@Nullable CacheEntryPredicate... filter)booleanevict(K key)Evicts entry associated with given key from cache.voidevictAll(Collection<? extends K> keys)Attempts to evict all entries associated with keys.@Nullable javax.cache.expiry.ExpiryPolicyexpiry()@Nullable IgniteCacheExpiryPolicyexpiryPolicy(@Nullable javax.cache.expiry.ExpiryPolicy plc)Vget(K key)Retrieves value mapped to the specified key from cache.protected Vget(K key, String taskName, boolean deserializeBinary, boolean needVer)Map<K,V>getAll(@Nullable Collection<? extends K> keys)Retrieves values mapped to the specified keys from cache.protected Map<K,V>getAll(Collection<? extends K> keys, boolean deserializeBinary, boolean needVer, boolean recovery, ReadRepairStrategy readRepairStrategy)IgniteInternalFuture<Map<K,V>>getAllAsync(@Nullable Collection<? extends K> keys)Asynchronously retrieves values mapped to the specified keys from cache.protected abstract IgniteInternalFuture<Map<K,V>>getAllAsync(@Nullable Collection<? extends K> keys, boolean forcePrimary, boolean skipTx, String taskName, boolean deserializeBinary, boolean recovery, ReadRepairStrategy readRepairStrategy, boolean skipVals, boolean needVer)@Nullable Map<K,V>getAllOutTx(Set<? extends K> keys)Gets values from cache.IgniteInternalFuture<Map<K,V>>getAllOutTxAsync(Set<? extends K> keys)Gets values from cache.VgetAndPut(K key, V val)Stores given key-value pair in cache.VgetAndPut(K key, V val, @Nullable CacheEntryPredicate filter)protected VgetAndPut0(K key, V val, @Nullable CacheEntryPredicate filter)IgniteInternalFuture<V>getAndPutAsync(K key, V val)Asynchronously stores given key-value pair in cache.protected IgniteInternalFuture<V>getAndPutAsync(K key, V val, @Nullable CacheEntryPredicate filter)IgniteInternalFuture<V>getAndPutAsync0(K key, V val, @Nullable CacheEntryPredicate filter)VgetAndPutIfAbsent(K key, V val)Stores given key-value pair in cache only if cache had no previous mapping for it.IgniteInternalFuture<V>getAndPutIfAbsentAsync(K key, V val)Asynchronously stores given key-value pair in cache only if cache had no previous mapping for it.VgetAndRemove(K key)Removes given key mapping from cache.protected VgetAndRemove0(K key)IgniteInternalFuture<V>getAndRemoveAsync(K key)Asynchronously removes given key mapping from cache.protected IgniteInternalFuture<V>getAndRemoveAsync0(K key)VgetAndReplace(K key, V val)Stores given key-value pair in cache only if there is a previous mapping for it.IgniteInternalFuture<V>getAndReplaceAsync(K key, V val)Asynchronously stores given key-value pair in cache only if there is a previous mapping for it.IgniteInternalFuture<V>getAsync(K key)Asynchronously retrieves value mapped to the specified key from cache.protected IgniteInternalFuture<V>getAsync(K key, boolean forcePrimary, boolean skipTx, String taskName, boolean deserializeBinary, boolean skipVals, boolean needVer)Collection<CacheEntry<K,V>>getEntries(@Nullable Collection<? extends K> keys)Retrieves values mapped to the specified keys from cache.IgniteInternalFuture<Collection<CacheEntry<K,V>>>getEntriesAsync(@Nullable Collection<? extends K> keys)Asynchronously retrieves values mapped to the specified keys from cache.@Nullable CacheEntry<K,V>getEntry(K key)Retrieves value mapped to the specified key from cache.IgniteInternalFuture<CacheEntry<K,V>>getEntryAsync(K key)Asynchronously retrieves value mapped to the specified key from cache.VgetForcePrimary(K key)Gets value from cache.IgniteInternalFuture<V>getForcePrimaryAsync(K key)Asynchronously gets value from cache.Iterator<javax.cache.Cache.Entry<K,V>>igniteIterator()Iterator<javax.cache.Cache.Entry<K,V>>igniteIterator(boolean keepBinary)voidincrementSize(GridCacheMapEntry e)Increments map public size.protected voidinit()Post constructor initialization for subclasses.<T> @Nullable javax.cache.processor.EntryProcessorResult<T>invoke(@Nullable AffinityTopologyVersion topVer, K key, javax.cache.processor.EntryProcessor<K,V,T> entryProcessor, Object... args)<T> javax.cache.processor.EntryProcessorResult<T>invoke(K key, javax.cache.processor.EntryProcessor<K,V,T> entryProcessor, Object... args)<T> Map<K,javax.cache.processor.EntryProcessorResult<T>>invokeAll(Map<? extends K,? extends javax.cache.processor.EntryProcessor<K,V,T>> map, Object... args)<T> Map<K,javax.cache.processor.EntryProcessorResult<T>>invokeAll(Set<? extends K> keys, javax.cache.processor.EntryProcessor<K,V,T> entryProcessor, Object... args)<T> IgniteInternalFuture<Map<K,javax.cache.processor.EntryProcessorResult<T>>>invokeAllAsync(Map<? extends K,? extends javax.cache.processor.EntryProcessor<K,V,T>> map, Object... args)<T> IgniteInternalFuture<Map<K,javax.cache.processor.EntryProcessorResult<T>>>invokeAllAsync(Set<? extends K> keys, javax.cache.processor.EntryProcessor<K,V,T> entryProcessor, Object... args)<T> IgniteInternalFuture<javax.cache.processor.EntryProcessorResult<T>>invokeAsync(K key, javax.cache.processor.EntryProcessor<K,V,T> entryProcessor, Object... args)booleanisColocated()booleanisDht()booleanisDhtAtomic()booleanisEmpty()Returnstrueif this map contains no key-value mappings.booleanisLocal()booleanisLocked(K key)Checks if any node owns a lock for this key.booleanisLockedByThread(K key)Checks if current thread owns a lock on this key.booleanisNear()Iterator<javax.cache.Cache.Entry<K,V>>iterator()protected Iterator<javax.cache.Cache.Entry<K,V>>iterator(Iterator<? extends GridCacheEntryEx> it, boolean deserializeBinary)<K1,V1>
GridCacheProxyImpl<K1,V1>keepBinary()Creates projection that will operate with binary objects.Set<K>keySet()Set of keys cached on this node.GridCacheAdapter.FutureHolderlastAsyncFuture()Last async operation future for implicit transactions.IgniteInternalFuture<?>loadAll(Set<? extends K> keys, boolean replaceExisting)Iterable<javax.cache.Cache.Entry<K,V>>localEntries(CachePeekMode[] peekModes)voidlocalLoad(Collection<? extends K> keys, @Nullable javax.cache.expiry.ExpiryPolicy plc, boolean keepBinary)voidlocalLoadCache(IgniteBiPredicate<K,V> p, Object[] args)Delegates toCacheStore.loadCache(IgniteBiInClosure, Object...)method to load state from the underlying persistent storage.IgniteInternalFuture<?>localLoadCacheAsync(IgniteBiPredicate<K,V> p, Object[] args)Asynchronously delegates toCacheStore.loadCache(IgniteBiInClosure, Object...)method to reload state from the underlying persistent storage.CacheMetricslocalMetrics()Gets local metrics (statistics) for this cache.VlocalPeek(K key, CachePeekMode[] peekModes)booleanlocalPreloadPartition(int part)Preloads cache partition if it exists on local node.intlocalSize(CachePeekMode[] peekModes)booleanlock(K key, long timeout)Synchronously acquires lock on a cached object with given key only if the passed in filter (if any) passes.booleanlockAll(@Nullable Collection<? extends K> keys, long timeout)All or nothing synchronous lock for passed in keys.IgniteInternalFuture<Boolean>lockAsync(K key, long timeout)Asynchronously acquires lock on a cached object with given key only if the passed in filter (if any) passes.protected IgniteLoggerlog()Collection<Integer>lostPartitions()GridCacheConcurrentMapmap()CacheMetricsImplmetrics0()Stringname()Gets name of this cache (nullfor default cache).intnearSize()Gets size of near cache key set.GridCacheVersionnextVersion()Gets next grid cache version.GridCacheVersionnextVersion(byte dataCenterId)Gets next grid cache version.longoffHeapAllocatedSize()Gets memory size allocated in off-heap.longoffHeapEntriesCount()Gets number of cache entries stored in off-heap memory.abstract voidonDeferredDelete(GridCacheEntryEx entry, GridCacheVersion ver)voidonKernalStart()Kernal start callback.voidonKernalStop()Kernal stop callback.voidonReconnected()voidonUndeploy(ClassLoader ldr)Undeploys and removes all entries for class loader.protected static GridCacheAdapter.PeekModesparsePeekModes(CachePeekMode[] peekModes, boolean primary)@Nullable GridCacheEntryExpeekEx(Object key)@Nullable GridCacheEntryExpeekEx(KeyCacheObject key)abstract GridCachePreloaderpreloader()voidpreloadPartition(int part)Preload cache partition.IgniteInternalFuture<?>preloadPartitionAsync(int part)Preload cache partition.intprimarySize()Gets the number of all primary entries cached on this node.longprimarySizeLong()Gets the number of all primary entries cached on this node as a long value.voidprintMemoryStats()Prints memory stats.booleanput(K key, V val)Stores given key-value pair in cache.booleanput(K key, V val, CacheEntryPredicate filter)protected booleanput0(K key, V val, CacheEntryPredicate filter)voidputAll(@Nullable Map<? extends K,? extends V> m)Stores given key-value pairs in cache.protected voidputAll0(Map<? extends K,? extends V> m)IgniteInternalFuture<?>putAllAsync(Map<? extends K,? extends V> m)Asynchronously stores given key-value pairs in cache.protected IgniteInternalFuture<?>putAllAsync0(Map<? extends K,? extends V> m)voidputAllConflict(Map<KeyCacheObject,GridCacheDrInfo> drMap)Store DR data.IgniteInternalFuture<?>putAllConflictAsync(Map<KeyCacheObject,GridCacheDrInfo> drMap)Store DR data asynchronously.IgniteInternalFuture<Boolean>putAsync(K key, V val)Stores given key-value pair in cache.IgniteInternalFuture<Boolean>putAsync(K key, V val, @Nullable CacheEntryPredicate filter)IgniteInternalFuture<Boolean>putAsync0(K key, V val, @Nullable CacheEntryPredicate filter)booleanputIfAbsent(K key, V val)Stores given key-value pair in cache only if cache had no previous mapping for it.IgniteInternalFuture<Boolean>putIfAbsentAsync(K key, V val)Asynchronously stores given key-value pair in cache only if cache had no previous mapping for it.voidreadExternal(ObjectInput in)protected ObjectreadResolve()Reconstructs object on unmarshalling.IgniteInternalFuture<?>rebalance()Forces this cache node to re-balance its partitions.booleanremove(K key)Removes given key mapping from cache.booleanremove(K key, @Nullable CacheEntryPredicate filter)booleanremove(K key, V val)Removes given key mapping from cache if one exists and value is equal to the passed in value.protected booleanremove0(K key, CacheEntryPredicate filter)voidremoveAll()Removes mappings from cache.voidremoveAll(Collection<? extends K> keys)Removes given key mappings from cache.protected voidremoveAll0(Collection<? extends K> keys)IgniteInternalFuture<?>removeAllAsync(@Nullable Collection<? extends K> keys)Asynchronously removes given key mappings from cache for entries.protected IgniteInternalFuture<Object>removeAllAsync0(Collection<? extends K> keys)voidremoveAllConflict(Map<KeyCacheObject,GridCacheVersion> drMap)Removes DR data.IgniteInternalFuture<?>removeAllConflictAsync(Map<KeyCacheObject,GridCacheVersion> drMap)Removes DR data asynchronously.IgniteInternalFuture<Boolean>removeAsync(K key)Asynchronously removes given key mapping from cache.IgniteInternalFuture<Boolean>removeAsync(K key, @Nullable CacheEntryPredicate filter)IgniteInternalFuture<Boolean>removeAsync(K key, V val)Asynchronously removes given key mapping from cache if one exists and value is equal to the passed in value.protected IgniteInternalFuture<Boolean>removeAsync0(K key, @Nullable CacheEntryPredicate filter)voidremoveEntry(GridCacheEntryEx entry)voidremoveIfObsolete(KeyCacheObject key)voidremoveMetrics(boolean destroy)Remove cache metrics.VrepairableGet(K key, boolean deserializeBinary, boolean needVer)protected Map<K,V>repairableGetAll(Collection<? extends K> keys, boolean deserializeBinary, boolean needVer, boolean recovery, ReadRepairStrategy readRepairStrategy)IgniteInternalFuture<Map<K,V>>repairableGetAllAsync(@Nullable Collection<? extends K> keys, boolean forcePrimary, boolean skipTx, String taskName, boolean deserializeBinary, boolean recovery, ReadRepairStrategy readRepairStrategy, boolean skipVals, boolean needVer)IgniteInternalFuture<V>repairableGetAsync(K key, boolean deserializeBinary, boolean needVer, ReadRepairStrategy readRepairStrategy)booleanreplace(K key, V val)Stores given key-value pair in cache only if only if there is a previous mapping for it.booleanreplace(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.IgniteInternalFuture<Boolean>replaceAsync(K key, V val)Asynchronously stores given key-value pair in cache only if only if there is a previous mapping for it.IgniteInternalFuture<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.Iterator<javax.cache.Cache.Entry<K,V>>scanIterator(boolean keepBinary, @Nullable IgniteBiPredicate<Object,Object> p)GridCacheProxyImpl<K,V>setSkipStore(boolean skipStore)intsize()Gets the number of all entries cached on this node.intsize(CachePeekMode[] peekModes)IgniteInternalFuture<Integer>sizeAsync(CachePeekMode[] peekModes)longsizeLong()Gets the number of all entries cached on this node as a long value.longsizeLong(int partition, CachePeekMode[] peekModes)longsizeLong(CachePeekMode[] peekModes)IgniteInternalFuture<Long>sizeLongAsync(int part, CachePeekMode[] peekModes)IgniteInternalFuture<Long>sizeLongAsync(CachePeekMode[] peekModes)booleanskipStore()List<GridCacheClearAllRunnable<K,V>>splitClearLocally(boolean srv, boolean near, boolean readers)Split clearLocally all task into multiple runnables.abstract voidstart()Starts this cache.protected StringstartInfo()Startup info.voidstop()Stops this cache.protected StringstopInfo()Stop info.StringtoString()@Nullable GridNearTxLocaltx()Gets transaction started by this thread ornullif this thread does not have a transaction.abstract IgniteInternalFuture<Boolean>txLockAsync(Collection<KeyCacheObject> keys, long timeout, IgniteTxLocalEx tx, boolean isRead, boolean retval, TransactionIsolation isolation, boolean invalidate, long createTtl, long accessTtl)TransactiontxStart(TransactionConcurrency concurrency, TransactionIsolation isolation)Starts new transaction with the specified concurrency and isolation.TransactiontxStart(TransactionConcurrency concurrency, TransactionIsolation isolation, long timeout, int txSize)Starts transaction with specified isolation, concurrency, timeout, invalidation flag, and number of participating entries.GridNearTxLocaltxStartEx(TransactionConcurrency concurrency, TransactionIsolation isolation)voidunlock(K key)Unlocks given key only if current thread owns the lock.protected voidwarnIfUnordered(Collection<?> coll, GridCacheAdapter.BulkOperation op)Checks that given collection is sorted set, or processed inside deadlock-detecting transaction.protected voidwarnIfUnordered(Map<?,?> m, GridCacheAdapter.BulkOperation op)Checks that given map is sorted or otherwise constant order, or processed inside deadlock-detecting transaction.GridCacheProxyImpl<K,V>withExpiryPolicy(javax.cache.expiry.ExpiryPolicy plc)IgniteInternalCache<K,V>withNoRetries()voidwriteExternal(ObjectOutput out)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.ignite.internal.processors.cache.IgniteInternalCache
localSizeLong, localSizeLong, lockAllAsync, removeAllAsync, unlockAll
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Field Detail
-
CLEAR_ALL_SPLIT_THRESHOLD
public static final int CLEAR_ALL_SPLIT_THRESHOLD
clearLocally() split threshold.- See Also:
- Constant Field Values
-
DFLT_CACHE_START_SIZE
public static final int DFLT_CACHE_START_SIZE
-
DFLT_START_CACHE_SIZE
public static final int DFLT_START_CACHE_SIZE
Default cache start size.
-
DFLT_CACHE_RETRIES_COUNT
public static final int DFLT_CACHE_RETRIES_COUNT
-
MAX_RETRIES
public static final int MAX_RETRIES
Maximum number of retries when topology changes.
-
NON_TRANSACTIONAL_IGNITE_CACHE_CLEAR_IN_TX_ERROR_MESSAGE
public static final String NON_TRANSACTIONAL_IGNITE_CACHE_CLEAR_IN_TX_ERROR_MESSAGE
Exception thrown when a non-transactional IgniteCache clear operation is invoked within a transaction.- See Also:
- Constant Field Values
-
RET2NULL
protected static final IgniteClosure RET2NULL
GridCacheReturn-to-null conversion.
-
lastFut
protected ThreadLocal<GridCacheAdapter.FutureHolder> lastFut
Last asynchronous future.
-
ctx
@GridToStringExclude protected GridCacheContext<K,V> ctx
Cache configuration.
-
map
@GridToStringExclude protected GridCacheConcurrentMap map
Local map.
-
locNodeId
@GridToStringExclude protected UUID locNodeId
Local node ID.
-
cacheCfg
@GridToStringExclude protected CacheConfiguration cacheCfg
Cache configuration.
-
metrics
protected CacheMetricsImpl metrics
Cache metrics.
-
log
protected IgniteLogger log
Logger.
-
txLockMsgLog
protected IgniteLogger txLockMsgLog
Logger.
-
-
Constructor Detail
-
GridCacheAdapter
protected GridCacheAdapter()
Empty constructor required byExternalizable.
-
GridCacheAdapter
protected GridCacheAdapter(GridCacheContext<K,V> ctx)
- Parameters:
ctx- Cache context.
-
GridCacheAdapter
protected GridCacheAdapter(GridCacheContext<K,V> ctx, @Nullable @Nullable GridCacheConcurrentMap map)
- Parameters:
ctx- Cache context.map- Concurrent map.
-
-
Method Detail
-
name
public String name()
Gets name of this cache (nullfor default cache).- Specified by:
namein interfaceIgniteInternalCache<K,V>- Returns:
- Cache name.
-
printMemoryStats
public void printMemoryStats()
Prints memory stats.
-
map
public GridCacheConcurrentMap map()
- Returns:
- Base map.
-
incrementSize
public void incrementSize(GridCacheMapEntry e)
Increments map public size.- Parameters:
e- Map entry.
-
decrementSize
public void decrementSize(GridCacheMapEntry e)
Decrements map public size.- Parameters:
e- Map entry.
-
context
public GridCacheContext<K,V> context()
- Specified by:
contextin interfaceIgniteInternalCache<K,V>- Returns:
- Context.
-
log
protected IgniteLogger log()
- Returns:
- Logger.
-
isNear
public boolean isNear()
- Returns:
Trueif this is near cache.
-
isLocal
public boolean isLocal()
- Returns:
Trueif cache is local.
-
isColocated
public boolean isColocated()
- Returns:
Trueif cache is colocated.
-
isDhtAtomic
public boolean isDhtAtomic()
- Returns:
Trueif cache is DHT Atomic.
-
isDht
public boolean isDht()
- Returns:
Trueif cache is DHT.
-
active
public boolean active()
-
active
public void active(boolean active)
- Parameters:
active- Active.
-
preloader
public abstract GridCachePreloader preloader()
- Returns:
- Preloader.
-
affinity
public final Affinity<K> affinity()
Gets affinity service to provide information about data partitioning and distribution.- Specified by:
affinityin interfaceIgniteInternalCache<K,V>- Returns:
- Cache data affinity service.
-
cache
public final <K1,V1> IgniteInternalCache<K1,V1> cache()
Gets base cache for this projection.- Specified by:
cachein interfaceIgniteInternalCache<K,V>- Type Parameters:
K1- Cache key type.V1- Cache value type.- Returns:
- Base cache for this projection.
-
skipStore
public final boolean skipStore()
- Specified by:
skipStorein interfaceIgniteInternalCache<K,V>- Returns:
- Skip store.
-
setSkipStore
public final GridCacheProxyImpl<K,V> setSkipStore(boolean skipStore)
- Specified by:
setSkipStorein interfaceIgniteInternalCache<K,V>- Parameters:
skipStore- Skip store flag.- Returns:
- New internal cache instance based on this one, but with skip store flag enabled.
-
keepBinary
public final <K1,V1> GridCacheProxyImpl<K1,V1> keepBinary()
Creates projection that will operate with binary objects.Projection returned by this method will force cache not to deserialize binary objects, so keys and values will be returned from cache API methods without changes. Therefore, signature of the projection can contain only following types:
org.gridgain.grid.binary.BinaryObjectfor binary classes- All primitives (byte, int, ...) and there boxed versions (Byte, Integer, ...)
- Arrays of primitives (byte[], int[], ...)
Stringand array ofStringsUUIDand array ofUUIDsDateand array ofDatesTimestampand array ofTimestamps- Enums and array of enums
- Maps, collections and array of objects (but objects inside them will still be converted if they are binary)
For example, if you use
Integeras a key andValueclass as a value (which will be stored in binary format), you should acquire following projection to avoid deserialization:IgniteInternalCache
prj = cache.keepBinary(); // Value is not deserialized and returned in binary format. GridBinaryObject po = prj.get(1); Note that this method makes sense only if cache is working in binary mode (
org.apache.ignite.configuration.CacheConfiguration#isBinaryEnabled()returnstrue. If not, this method is no-op and will return current projection.- Specified by:
keepBinaryin interfaceIgniteInternalCache<K,V>- Returns:
- New internal cache instance for binary objects.
-
expiry
@Nullable public final @Nullable javax.cache.expiry.ExpiryPolicy expiry()
- Specified by:
expiryin interfaceIgniteInternalCache<K,V>- Returns:
ExpiryPolicyassociated with this projection.
-
withExpiryPolicy
public final GridCacheProxyImpl<K,V> withExpiryPolicy(javax.cache.expiry.ExpiryPolicy plc)
- Specified by:
withExpiryPolicyin interfaceIgniteInternalCache<K,V>- Parameters:
plc-ExpiryPolicyto associate with this projection.- Returns:
- New projection based on this one, but with the specified expiry policy.
-
withNoRetries
public final IgniteInternalCache<K,V> withNoRetries()
- Specified by:
withNoRetriesin interfaceIgniteInternalCache<K,V>- Returns:
- Cache with no-retries behavior enabled.
-
configuration
public final CacheConfiguration configuration()
Gets configuration bean for this cache.- Specified by:
configurationin interfaceIgniteInternalCache<K,V>- Returns:
- Configuration bean for this cache.
-
txLockAsync
public abstract IgniteInternalFuture<Boolean> txLockAsync(Collection<KeyCacheObject> keys, long timeout, IgniteTxLocalEx tx, boolean isRead, boolean retval, TransactionIsolation isolation, boolean invalidate, long createTtl, long accessTtl)
- Parameters:
keys- Keys to lock.timeout- Lock timeout.tx- Transaction.isRead-Truefor read operations.retval- Flag to return value.isolation- Transaction isolation.invalidate- Invalidate flag.createTtl- TTL for create operation.accessTtl- TTL for read operation.- Returns:
- Locks future.
-
init
protected void init()
Post constructor initialization for subclasses.
-
start
public abstract void start() throws IgniteCheckedExceptionStarts this cache. Child classes should override this method to provide custom start-up behavior.- Throws:
IgniteCheckedException- If start failed.
-
startInfo
protected final String startInfo()
Startup info.- Returns:
- Startup info.
-
stop
public void stop()
Stops this cache. Child classes should override this method to provide custom stop behavior.
-
removeMetrics
public void removeMetrics(boolean destroy)
Remove cache metrics.- Parameters:
destroy- Group destroy flag.
-
stopInfo
protected final String stopInfo()
Stop info.- Returns:
- Stop info.
-
onKernalStart
public void onKernalStart() throws IgniteCheckedExceptionKernal start callback.- Throws:
IgniteCheckedException- If callback failed.
-
onKernalStop
public void onKernalStop()
Kernal stop callback.
-
isEmpty
public final boolean isEmpty()
Returnstrueif this map contains no key-value mappings.- Specified by:
isEmptyin interfaceIgniteInternalCache<K,V>- Returns:
trueif this map contains no key-value mappings.
-
containsKey
public final boolean containsKey(K key)
- Specified by:
containsKeyin interfaceIgniteInternalCache<K,V>- Parameters:
key- Key.- Returns:
Trueif cache contains mapping for a given key.
-
containsKeyAsync
public final IgniteInternalFuture<Boolean> containsKeyAsync(K key)
- Specified by:
containsKeyAsyncin interfaceIgniteInternalCache<K,V>- Parameters:
key- Key.- Returns:
- Future.
-
containsKeys
public final boolean containsKeys(Collection<? extends K> keys)
- Specified by:
containsKeysin interfaceIgniteInternalCache<K,V>- Parameters:
keys- Keys,- Returns:
Trueif cache contains all keys.
-
containsKeysAsync
public final IgniteInternalFuture<Boolean> containsKeysAsync(Collection<? extends K> keys)
- Specified by:
containsKeysAsyncin interfaceIgniteInternalCache<K,V>- Parameters:
keys- Keys to check.- Returns:
- Future.
-
localEntries
public final Iterable<javax.cache.Cache.Entry<K,V>> localEntries(CachePeekMode[] peekModes) throws IgniteCheckedException
- Specified by:
localEntriesin interfaceIgniteInternalCache<K,V>- Parameters:
peekModes- Peek modes.- Returns:
- Entries iterable.
- Throws:
IgniteCheckedException- If failed.
-
localPeek
public final V localPeek(K key, CachePeekMode[] peekModes) throws IgniteCheckedException
- Specified by:
localPeekin interfaceIgniteInternalCache<K,V>- Parameters:
key- Key.peekModes- Peek modes.- Returns:
- Value.
- Throws:
IgniteCheckedException- If failed.
-
onUndeploy
public final void onUndeploy(ClassLoader ldr)
Undeploys and removes all entries for class loader.- Parameters:
ldr- Class loader to undeploy.
-
peekEx
@Nullable public final @Nullable GridCacheEntryEx peekEx(KeyCacheObject key)
- Parameters:
key- Entry key.- Returns:
- Entry or null.
-
peekEx
@Nullable public final @Nullable GridCacheEntryEx peekEx(Object key)
- Parameters:
key- Entry key.- Returns:
- Entry or null.
-
entryEx
public final GridCacheEntryEx entryEx(Object key)
- Parameters:
key- Entry key.- Returns:
- Entry (never
null).
-
entryEx
public final GridCacheEntryEx entryEx(KeyCacheObject key)
- Parameters:
key- Entry key.- Returns:
- Entry (never
null).
-
entryEx
public GridCacheEntryEx entryEx(KeyCacheObject key, AffinityTopologyVersion topVer)
- Parameters:
topVer- Topology version.key- Entry key.- Returns:
- Entry (never
null).
-
entries
public final Iterable<? extends GridCacheEntryEx> entries()
- Returns:
- Set of internal cached entry representations.
-
allEntries
public final Iterable<? extends GridCacheEntryEx> allEntries()
- Returns:
- Set of internal cached entry representations.
-
entrySet
public final Set<javax.cache.Cache.Entry<K,V>> entrySet()
Gets set of all entries cached on this node. 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.NOTE: this operation is not distributed and returns only the entries cached on this node.
- Specified by:
entrySetin interfaceIgniteInternalCache<K,V>- Returns:
- Entries that pass through key filter.
-
keySet
public final Set<K> keySet()
Set of keys cached on this node. 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.
NOTE: this operation is not distributed and returns only the keys cached on this node.
- Specified by:
keySetin interfaceIgniteInternalCache<K,V>- Returns:
- Key set for this cache projection.
-
removeIfObsolete
public final void removeIfObsolete(KeyCacheObject key)
- Parameters:
key- Entry key.
-
splitClearLocally
public List<GridCacheClearAllRunnable<K,V>> splitClearLocally(boolean srv, boolean near, boolean readers)
Split clearLocally all task into multiple runnables.- Parameters:
srv- Whether to clear server cache.near- Whether to clear near cache.readers- Whether to clear readers.- Returns:
- Split runnables.
-
clearLocally
public boolean clearLocally(K key)
Clears an entry from this cache and swap storage only if the entry is not currently locked, and is not participating in a transaction.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.
- Specified by:
clearLocallyin interfaceIgniteInternalCache<K,V>- Parameters:
key- Key to clearLocally.- Returns:
Trueif entry was successfully cleared from cache,falseif entry was in use at the time of this method invocation and could not be cleared.
-
clearLocallyAll
public void clearLocallyAll(Set<? extends K> keys, boolean srv, boolean near, boolean readers)
Clears entries from this cache and swap storage only if the entry is not currently locked, and is not participating in a transaction.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.
- Specified by:
clearLocallyAllin interfaceIgniteInternalCache<K,V>- Parameters:
keys- Keys to clearLocally.srv- Whether to clear server cache.near- Whether to clear near cache.readers- Whether to clear readers.
-
clearLocally
public void clearLocally(boolean srv, boolean near, boolean readers)Clears all entries from this cache only if the entry is not currently locked or participating in a transaction.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.
- Specified by:
clearLocallyin interfaceIgniteInternalCache<K,V>- Parameters:
srv- Whether to clear server cache.near- Whether to clear near cache.readers- Whether to clear readers.
-
clear
public void clear() throws IgniteCheckedExceptionClears cache on all nodes that store it's data. That is, caches are cleared on remote nodes and local node, as opposed toIgniteInternalCache.clearLocally(boolean, boolean, boolean)method which only clears local node's cache.Ignite will make the best attempt to clear caches on all nodes. If some caches could not be cleared, then exception will be thrown.
- Specified by:
clearin interfaceIgniteInternalCache<K,V>- Throws:
IgniteCheckedException- In case of cache could not be cleared on any of the nodes.
-
clear
public void clear(K key) throws IgniteCheckedException
Clears key on all nodes that store it's data. That is, caches are cleared on remote nodes and local node, as opposed toIgniteInternalCache.clearLocally(Object)method which only clears local node's cache.Ignite will make the best attempt to clear caches on all nodes. If some caches could not be cleared, then exception will be thrown.
- Specified by:
clearin interfaceIgniteInternalCache<K,V>- Parameters:
key- Key to clear.- Throws:
IgniteCheckedException- In case of cache could not be cleared on any of the nodes.
-
clearAll
public void clearAll(Set<? extends K> keys) throws IgniteCheckedException
Clears keys on all nodes that store it's data. That is, caches are cleared on remote nodes and local node, as opposed toIgniteInternalCache.clearLocallyAll(Set, boolean, boolean, boolean)method which only clears local node's cache.Ignite will make the best attempt to clear caches on all nodes. If some caches could not be cleared, then exception will be thrown.
- Specified by:
clearAllin interfaceIgniteInternalCache<K,V>- Parameters:
keys- Keys to clear.- Throws:
IgniteCheckedException- In case of cache could not be cleared on any of the nodes.
-
clearAsync
public IgniteInternalFuture<?> clearAsync()
- Specified by:
clearAsyncin interfaceIgniteInternalCache<K,V>- Returns:
- Clear future.
-
clearAsync
public IgniteInternalFuture<?> clearAsync(K key)
- Specified by:
clearAsyncin interfaceIgniteInternalCache<K,V>- Parameters:
key- Key to clear.- Returns:
- Clear future.
-
clearAllAsync
public IgniteInternalFuture<?> clearAllAsync(Set<? extends K> keys)
- Specified by:
clearAllAsyncin interfaceIgniteInternalCache<K,V>- Parameters:
keys- Keys to clear.- Returns:
- Clear future.
-
clearLocally
public void clearLocally(Collection<KeyCacheObject> keys, boolean readers)
- Parameters:
keys- Keys.readers- Readers flag.
-
removeEntry
public final void removeEntry(GridCacheEntryEx entry)
- Parameters:
entry- Removes entry from cache if currently mapped value is the same as passed.
-
lostPartitions
public Collection<Integer> lostPartitions()
- Specified by:
lostPartitionsin interfaceIgniteInternalCache<K,V>- Returns:
- A collection of lost partitions if a cache is in recovery state.
-
getForcePrimary
public final V getForcePrimary(K key) throws IgniteCheckedException
Gets value from cache. Will go to primary node even if this is a backup.- Specified by:
getForcePrimaryin interfaceIgniteInternalCache<K,V>- Parameters:
key- Key to get value for.- Returns:
- Value.
- Throws:
IgniteCheckedException- If failed.
-
getForcePrimaryAsync
public final IgniteInternalFuture<V> getForcePrimaryAsync(K key)
Asynchronously gets value from cache. Will go to primary node even if this is a backup.- Specified by:
getForcePrimaryAsyncin interfaceIgniteInternalCache<K,V>- Parameters:
key- Key to get value for.- Returns:
- Future with result.
-
getAllOutTx
@Nullable public final @Nullable Map<K,V> getAllOutTx(Set<? extends K> keys) throws IgniteCheckedException
Gets values from cache. Will bypass started transaction, if any, i.e. will not enlist entries and will not lock any keys if pessimistic transaction is started by thread.- Specified by:
getAllOutTxin interfaceIgniteInternalCache<K,V>- Parameters:
keys- Keys to get values for.- Returns:
- Value.
- Throws:
IgniteCheckedException- If failed.
-
getAllOutTxAsync
public final IgniteInternalFuture<Map<K,V>> getAllOutTxAsync(Set<? extends K> keys)
Gets values from cache. Will bypass started transaction, if any, i.e. will not enlist entries and will not lock any keys if pessimistic transaction is started by thread.- Specified by:
getAllOutTxAsyncin interfaceIgniteInternalCache<K,V>- Parameters:
keys- Keys to get values for.- Returns:
- Future for getAllOutTx operation.
-
get
@Nullable public V get(K key) throws IgniteCheckedException
Retrieves value mapped to the specified key from cache. Value will only be returned if its entry passed the optional filter provided. Filter check is atomic, and therefore the returned value is guaranteed to be consistent with the filter. The return value ofnullmeans 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
CacheStorepersistent storage viaCacheStore#load(Transaction, Object)method.Transactions
This method is transactional and will enlist the entry into ongoing transaction if there is one.- Specified by:
getin interfaceIgniteInternalCache<K,V>- Parameters:
key- Key to retrieve the value for.- Returns:
- Value for the given key.
- Throws:
IgniteCheckedException- If get operation failed.
-
getEntry
@Nullable public @Nullable CacheEntry<K,V> getEntry(K key) throws IgniteCheckedException
Retrieves value mapped to the specified key from cache. Value will only be returned if its entry passed the optional filter provided. Filter check is atomic, and therefore the returned value is guaranteed to be consistent with the filter. The return value ofnullmeans 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
CacheStorepersistent storage viaCacheStore#load(Transaction, Object)method.Transactions
This method is transactional and will enlist the entry into ongoing transaction if there is one.- Specified by:
getEntryin interfaceIgniteInternalCache<K,V>- Parameters:
key- Key to retrieve the value for.- Returns:
- Value for the given key.
- Throws:
IgniteCheckedException- If get operation failed.
-
getAsync
public IgniteInternalFuture<V> getAsync(K key)
Asynchronously retrieves value mapped to the specified key from cache. Value will only be returned if its entry passed the optional filter provided. Filter check is atomic, and therefore the returned value is guaranteed to be consistent with the filter. The return value ofnullmeans 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
CacheStorepersistent storage viaCacheStore#load(Transaction, Object)method.Transactions
This method is transactional and will enlist the entry into ongoing transaction if there is one.- Specified by:
getAsyncin interfaceIgniteInternalCache<K,V>- Parameters:
key- Key for the value to get.- Returns:
- Future for the get operation.
-
getEntryAsync
public IgniteInternalFuture<CacheEntry<K,V>> getEntryAsync(K key)
Asynchronously retrieves value mapped to the specified key from cache. Value will only be returned if its entry passed the optional filter provided. Filter check is atomic, and therefore the returned value is guaranteed to be consistent with the filter. The return value ofnullmeans 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
CacheStorepersistent storage viaCacheStore#load(Transaction, Object)method.Transactions
This method is transactional and will enlist the entry into ongoing transaction if there is one.- Specified by:
getEntryAsyncin interfaceIgniteInternalCache<K,V>- Parameters:
key- Key for the value to get.- Returns:
- Future for the get operation.
-
getAll
public final Map<K,V> getAll(@Nullable @Nullable Collection<? extends K> keys) throws IgniteCheckedException
Retrieves values mapped to the specified keys from cache. Value will only be returned if its entry passed the optional filter provided. Filter check is atomic, and therefore the returned value is guaranteed to be consistent with the filter. If requested key-value pair is not present in the returned map, then it means that its entry did not pass the provided filter or cache has no mapping for the key.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
CacheStorepersistent storage viaCacheStore#loadAll(Transaction, Collection, org.apache.ignite.lang.IgniteBiInClosure)method.Transactions
This method is transactional and will enlist the entry into ongoing transaction if there is one.- Specified by:
getAllin interfaceIgniteInternalCache<K,V>- Parameters:
keys- Keys to get.- Returns:
- Map of key-value pairs.
- Throws:
IgniteCheckedException- If get operation failed.
-
getEntries
public Collection<CacheEntry<K,V>> getEntries(@Nullable @Nullable Collection<? extends K> keys) throws IgniteCheckedException
Retrieves values mapped to the specified keys from cache. Value will only be returned if its entry passed the optional filter provided. Filter check is atomic, and therefore the returned value is guaranteed to be consistent with the filter. If requested key-value pair is not present in the returned map, then it means that its entry did not pass the provided filter or cache has no mapping for the key.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
CacheStorepersistent storage viaCacheStore#loadAll(Transaction, Collection, org.apache.ignite.lang.IgniteBiInClosure)method.Transactions
This method is transactional and will enlist the entry into ongoing transaction if there is one.- Specified by:
getEntriesin interfaceIgniteInternalCache<K,V>- Parameters:
keys- Keys to get.- Returns:
- Map of key-value pairs.
- Throws:
IgniteCheckedException- If get operation failed.
-
getAllAsync
public IgniteInternalFuture<Map<K,V>> getAllAsync(@Nullable @Nullable Collection<? extends K> keys)
Asynchronously retrieves values mapped to the specified keys from cache. Value will only be returned if its entry passed the optional filter provided. Filter check is atomic, and therefore the returned value is guaranteed to be consistent with the filter. If requested key-value pair is not present in the returned map, then it means that its entry did not pass the provided filter or cache has no mapping for the key.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
CacheStorepersistent storage viaCacheStore#loadAll(Transaction, Collection, org.apache.ignite.lang.IgniteBiInClosure)method.Transactions
This method is transactional and will enlist the entry into ongoing transaction if there is one.- Specified by:
getAllAsyncin interfaceIgniteInternalCache<K,V>- Parameters:
keys- Key for the value to get.- Returns:
- Future for the get operation.
-
getEntriesAsync
public IgniteInternalFuture<Collection<CacheEntry<K,V>>> getEntriesAsync(@Nullable @Nullable Collection<? extends K> keys)
Asynchronously retrieves values mapped to the specified keys from cache. Value will only be returned if its entry passed the optional filter provided. Filter check is atomic, and therefore the returned value is guaranteed to be consistent with the filter. If requested key-value pair is not present in the returned map, then it means that its entry did not pass the provided filter or cache has no mapping for the key.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
CacheStorepersistent storage viaCacheStore#loadAll(Transaction, Collection, org.apache.ignite.lang.IgniteBiInClosure)method.Transactions
This method is transactional and will enlist the entry into ongoing transaction if there is one.- Specified by:
getEntriesAsyncin interfaceIgniteInternalCache<K,V>- Parameters:
keys- Key for the value to get.- Returns:
- Future for the get operation.
-
getAsync
protected IgniteInternalFuture<V> getAsync(K key, boolean forcePrimary, boolean skipTx, String taskName, boolean deserializeBinary, boolean skipVals, boolean needVer)
- Parameters:
key- Key.forcePrimary- Force primary.skipTx- Skip tx.taskName- Task name.deserializeBinary- Deserialize binary.skipVals- Skip values.needVer- Need version.- Returns:
- Future for the get operation.
-
getAllAsync
protected abstract IgniteInternalFuture<Map<K,V>> getAllAsync(@Nullable @Nullable Collection<? extends K> keys, boolean forcePrimary, boolean skipTx, String taskName, boolean deserializeBinary, boolean recovery, ReadRepairStrategy readRepairStrategy, boolean skipVals, boolean needVer)
- Parameters:
keys- Keys.forcePrimary- Force primary.skipTx- Skip tx.taskName- Task name.deserializeBinary- Deserialize binary.recovery- Recovery mode flag.skipVals- Skip values.needVer- Need version.- Returns:
- Future for the get operation.
- See Also:
getAllAsync(Collection)
-
getAndPut
public final V getAndPut(K key, V val) throws IgniteCheckedException
Stores given key-value pair in cache. If filters are provided, then entries will be stored in cache only if they pass the filter. Note that filter check is atomic, so value stored in cache is guaranteed to be consistent with the filters. If cache previously contained value for the given key, then this value is returned. In case ofCacheMode.PARTITIONEDorCacheMode.REPLICATEDcaches, the value will be loaded from the primary node, which in its turn may load the value from the swap storage, and consecutively, if it's not in swap, from the underlying persistent storage. If value has to be loaded from persistent storage,CacheStore#load(Transaction, Object)method will be used.If the returned value is not needed, method
#putx(Object, Object, org.apache.ignite.lang.IgnitePredicate[])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
CacheStoreviaCacheStore#put(Transaction, Object, Object)method.Transactions
This method is transactional and will enlist the entry into ongoing transaction if there is one.- Specified by:
getAndPutin interfaceIgniteInternalCache<K,V>- Parameters:
key- Key to store in cache.val- Value to be associated with the given key.- Returns:
- Previous value associated with specified key, or
nullif entry did not pass the filter, or if there was no mapping for the key in swap or in persistent storage. - Throws:
IgniteCheckedException- If put operation failed.
-
getAndPut
@Nullable public V getAndPut(K key, V val, @Nullable @Nullable CacheEntryPredicate filter) throws IgniteCheckedException
- Parameters:
key- Key.val- Value.filter- Optional filter.- Returns:
- Previous value.
- Throws:
IgniteCheckedException- If failed.
-
getAndPut0
protected V getAndPut0(K key, V val, @Nullable @Nullable CacheEntryPredicate filter) throws IgniteCheckedException
- Parameters:
key- Key.val- Value.filter- Optional filter.- Returns:
- Previous value.
- Throws:
IgniteCheckedException- If failed.
-
getAndPutAsync
public final IgniteInternalFuture<V> getAndPutAsync(K key, V val)
Asynchronously stores given key-value pair in cache. If filters are provided, then entries will be stored in cache only if they pass the filter. Note that filter check is atomic, so value stored in cache is guaranteed to be consistent with the filters. If cache previously contained value for the given key, then this value is returned. Otherwise, in case ofCacheMode.REPLICATEDcaches, the value will be loaded from swap and, if it's not there, and read-through is allowed, from the underlyingCacheStorestorage. In case ofCacheMode.PARTITIONEDcaches, 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,CacheStore#load(Transaction, Object)method will be used.If the returned value is not needed, method
#putx(Object, Object, org.apache.ignite.lang.IgnitePredicate[])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
CacheStoreviaCacheStore#put(Transaction, Object, Object)method.Transactions
This method is transactional and will enlist the entry into ongoing transaction if there is one.- Specified by:
getAndPutAsyncin interfaceIgniteInternalCache<K,V>- Parameters:
key- Key to store in cache.val- Value to be associated with the given key.- Returns:
- Future for the put operation.
-
getAndPutAsync
protected final IgniteInternalFuture<V> getAndPutAsync(K key, V val, @Nullable @Nullable CacheEntryPredicate filter)
- Parameters:
key- Key.val- Value.filter- Filter.- Returns:
- Put operation future.
-
getAndPutAsync0
public IgniteInternalFuture<V> getAndPutAsync0(K key, V val, @Nullable @Nullable CacheEntryPredicate filter)
- Parameters:
key- Key.val- Value.filter- Optional filter.- Returns:
- Put operation future.
-
put
public final boolean put(K key, V val) throws IgniteCheckedException
Stores given key-value pair in cache. If filters are provided, then entries will be stored in cache only if they pass the filter. Note that filter check is atomic, so value stored in cache is guaranteed to be consistent with the filters.This method will return
trueif value is stored in cache andfalseotherwise. Unlike#put(Object, Object, org.apache.ignite.lang.IgnitePredicate[])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
CacheStoreviaCacheStore#put(Transaction, Object, Object)method.Transactions
This method is transactional and will enlist the entry into ongoing transaction if there is one.- Specified by:
putin interfaceIgniteInternalCache<K,V>- Parameters:
key- Key to store in cache.val- Value to be associated with the given key.- Returns:
Trueif optional filter passed and value was stored in cache,falseotherwise. Note that this method will returntrueif filter is not specified.- Throws:
IgniteCheckedException- If put operation failed.
-
put
public boolean put(K key, V val, CacheEntryPredicate filter) throws IgniteCheckedException
- Parameters:
key- Key.val- Value.filter- Filter.- Returns:
Trueif optional filter passed and value was stored in cache,falseotherwise. Note that this method will returntrueif filter is not specified.- Throws:
IgniteCheckedException- If put operation failed.
-
put0
protected boolean put0(K key, V val, CacheEntryPredicate filter) throws IgniteCheckedException
- Parameters:
key- Key.val- Value.filter- Filter.- Returns:
Trueif optional filter passed and value was stored in cache,falseotherwise. Note that this method will returntrueif filter is not specified.- Throws:
IgniteCheckedException- If put operation failed.
-
putAllConflict
public void putAllConflict(Map<KeyCacheObject,GridCacheDrInfo> drMap) throws IgniteCheckedException
Store DR data.- Specified by:
putAllConflictin interfaceIgniteInternalCache<K,V>- Parameters:
drMap- DR map.- Throws:
IgniteCheckedException- If put operation failed.
-
putAllConflictAsync
public IgniteInternalFuture<?> putAllConflictAsync(Map<KeyCacheObject,GridCacheDrInfo> drMap) throws IgniteCheckedException
Store DR data asynchronously.- Specified by:
putAllConflictAsyncin interfaceIgniteInternalCache<K,V>- Parameters:
drMap- DR map.- Returns:
- Future.
- Throws:
IgniteCheckedException- If put operation failed.
-
invoke
@Nullable public final <T> @Nullable javax.cache.processor.EntryProcessorResult<T> invoke(@Nullable @Nullable AffinityTopologyVersion topVer, K key, javax.cache.processor.EntryProcessor<K,V,T> entryProcessor, Object... args) throws IgniteCheckedException- Specified by:
invokein interfaceIgniteInternalCache<K,V>- Parameters:
topVer- Locked topology version.key- Key.entryProcessor- Entry processor.args- Arguments.- Returns:
- Invoke result.
- Throws:
IgniteCheckedException- If failed.
-
invoke
public <T> javax.cache.processor.EntryProcessorResult<T> invoke(K key, javax.cache.processor.EntryProcessor<K,V,T> entryProcessor, Object... args) throws IgniteCheckedException
- Specified by:
invokein interfaceIgniteInternalCache<K,V>- Parameters:
key- Key.entryProcessor- Entry processor.args- Arguments.- Returns:
- Invoke result.
- Throws:
IgniteCheckedException- If failed.
-
invokeAll
public <T> Map<K,javax.cache.processor.EntryProcessorResult<T>> invokeAll(Set<? extends K> keys, javax.cache.processor.EntryProcessor<K,V,T> entryProcessor, Object... args) throws IgniteCheckedException
- Specified by:
invokeAllin interfaceIgniteInternalCache<K,V>- Parameters:
keys- Keys.entryProcessor- Entry processor.args- Arguments.- Returns:
- Invoke results.
- Throws:
IgniteCheckedException- If failed.
-
invokeAsync
public <T> IgniteInternalFuture<javax.cache.processor.EntryProcessorResult<T>> invokeAsync(K key, javax.cache.processor.EntryProcessor<K,V,T> entryProcessor, Object... args) throws javax.cache.processor.EntryProcessorException
- Specified by:
invokeAsyncin interfaceIgniteInternalCache<K,V>- Parameters:
key- Key.entryProcessor- Entry processor.args- Arguments.- Returns:
- Future.
- Throws:
javax.cache.processor.EntryProcessorException
-
invokeAllAsync
public <T> IgniteInternalFuture<Map<K,javax.cache.processor.EntryProcessorResult<T>>> invokeAllAsync(Set<? extends K> keys, javax.cache.processor.EntryProcessor<K,V,T> entryProcessor, Object... args)
- Specified by:
invokeAllAsyncin interfaceIgniteInternalCache<K,V>- Parameters:
keys- Keys.entryProcessor- Entry processor.args- Arguments.- Returns:
- Future.
-
invokeAllAsync
public <T> IgniteInternalFuture<Map<K,javax.cache.processor.EntryProcessorResult<T>>> invokeAllAsync(Map<? extends K,? extends javax.cache.processor.EntryProcessor<K,V,T>> map, Object... args)
- Specified by:
invokeAllAsyncin interfaceIgniteInternalCache<K,V>- Parameters:
map- Map containing keys and entry processors to be applied to values.args- Arguments.- Returns:
- Future.
-
invokeAll
public <T> Map<K,javax.cache.processor.EntryProcessorResult<T>> invokeAll(Map<? extends K,? extends javax.cache.processor.EntryProcessor<K,V,T>> map, Object... args) throws IgniteCheckedException
- Specified by:
invokeAllin interfaceIgniteInternalCache<K,V>- Parameters:
map- Map containing keys and entry processors to be applied to values.args- Arguments.- Returns:
- Invoke results.
- Throws:
IgniteCheckedException- If failed.
-
putAsync
public final IgniteInternalFuture<Boolean> putAsync(K key, V val)
Stores given key-value pair in cache. If filters are provided, then entries will be stored in cache only if they pass the filter. Note that filter check is atomic, so value stored in cache is guaranteed to be consistent with the filters.This method will return
trueif value is stored in cache andfalseotherwise. Unlike#put(Object, Object, org.apache.ignite.lang.IgnitePredicate[])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
CacheStoreviaCacheStore#put(Transaction, Object, Object)method.Transactions
This method is transactional and will enlist the entry into ongoing transaction if there is one.- Specified by:
putAsyncin interfaceIgniteInternalCache<K,V>- Parameters:
key- Key to store in cache.val- Value to be associated with the given key.- Returns:
- Future for the put operation. Future will return
trueif optional filter passed and value was stored in cache,falseotherwise. Note that future will returntrueif filter is not specified.
-
putAsync
public final IgniteInternalFuture<Boolean> putAsync(K key, V val, @Nullable @Nullable CacheEntryPredicate filter)
- Parameters:
key- Key.val- Value.filter- Filter.- Returns:
- Put future.
-
putAsync0
public IgniteInternalFuture<Boolean> putAsync0(K key, V val, @Nullable @Nullable CacheEntryPredicate filter)
- Parameters:
key- Key.val- Value.filter- Optional filter.- Returns:
- Putx operation future.
-
getAndPutIfAbsent
@Nullable public final V getAndPutIfAbsent(K key, V val) throws IgniteCheckedException
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 ofCacheMode.PARTITIONEDorCacheMode.REPLICATEDcaches, the value will be loaded from the primary node, which in its turn may load the value from the swap storage, and consecutively, if it's not in swap, from the underlying persistent storage. If value has to be loaded from persistent storage,CacheStore#load(Transaction, Object)method will be used.If the returned value is not needed, method
IgniteInternalCache.putIfAbsent(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
CacheStoreviaCacheStore#put(Transaction, Object, Object)method.Transactions
This method is transactional and will enlist the entry into ongoing transaction if there is one.- Specified by:
getAndPutIfAbsentin interfaceIgniteInternalCache<K,V>- Parameters:
key- Key to store in cache.val- Value to be associated with the given key.- Returns:
- Previously contained value regardless of whether put happened or not.
- Throws:
IgniteCheckedException- If put operation failed.
-
getAndPutIfAbsentAsync
public final IgniteInternalFuture<V> getAndPutIfAbsentAsync(K key, V val)
Asynchronously 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 ofCacheMode.PARTITIONEDorCacheMode.REPLICATEDcaches, the value will be loaded from the primary node, which in its turn may load the value from the swap storage, and consecutively, if it's not in swap, from the underlying persistent storage. If value has to be loaded from persistent storage,CacheStore#load(Transaction, Object)method will be used.If the returned value is not needed, method
IgniteInternalCache.putIfAbsentAsync(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
CacheStoreviaCacheStore#put(Transaction, Object, Object)method.Transactions
This method is transactional and will enlist the entry into ongoing transaction if there is one.- Specified by:
getAndPutIfAbsentAsyncin interfaceIgniteInternalCache<K,V>- Parameters:
key- Key to store in cache.val- Value to be associated with the given key.- Returns:
- Future of put operation which will provide previously contained value regardless of whether put happened or not.
-
putIfAbsent
public final boolean putIfAbsent(K key, V val) throws IgniteCheckedException
Stores given key-value pair in cache only if cache had no previous mapping for it.This method will return
trueif value is stored in cache andfalseotherwise. UnlikeIgniteInternalCache.getAndPutIfAbsent(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
CacheStoreviaCacheStore#put(Transaction, Object, Object)method.Transactions
This method is transactional and will enlist the entry into ongoing transaction if there is one.- Specified by:
putIfAbsentin interfaceIgniteInternalCache<K,V>- Parameters:
key- Key to store in cache.val- Value to be associated with the given key.- Returns:
trueif value is stored in cache andfalseotherwise.- Throws:
IgniteCheckedException- If put operation failed.
-
putIfAbsentAsync
public final IgniteInternalFuture<Boolean> putIfAbsentAsync(K key, V val)
Asynchronously stores given key-value pair in cache only if cache had no previous mapping for it.This method will return
trueif value is stored in cache andfalseotherwise. UnlikeIgniteInternalCache.getAndPutIfAbsent(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
CacheStoreviaCacheStore#put(Transaction, Object, Object)method.Transactions
This method is transactional and will enlist the entry into ongoing transaction if there is one.- Specified by:
putIfAbsentAsyncin interfaceIgniteInternalCache<K,V>- Parameters:
key- Key to store in cache.val- Value to be associated with the given key.- Returns:
- Future for this put operation.
-
getAndReplace
@Nullable public final V getAndReplace(K key, V val) throws IgniteCheckedException
Stores given key-value pair in cache only if there is a previous mapping for it. In case ofCacheMode.PARTITIONEDorCacheMode.REPLICATEDcaches, the value will be loaded from the primary node, which in its turn may load the value from the swap storage, and consecutively, if it's not in swap, from the underlying persistent storage. If value has to be loaded from persistent storage,CacheStore#load(Transaction, Object)method will be used.If the returned value is not needed, method
IgniteInternalCache.replace(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
CacheStoreviaCacheStore#put(Transaction, Object, Object)method.Transactions
This method is transactional and will enlist the entry into ongoing transaction if there is one.- Specified by:
getAndReplacein interfaceIgniteInternalCache<K,V>- Parameters:
key- Key to store in cache.val- Value to be associated with the given key.- Returns:
- Previously contained value regardless of whether replace happened or not.
- Throws:
IgniteCheckedException- If replace operation failed.
-
getAndReplaceAsync
public final IgniteInternalFuture<V> getAndReplaceAsync(K key, V val)
Asynchronously 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 ofCacheMode.PARTITIONEDcaches, the value will be loaded from the primary node, which in its turn may load the value from the swap storage, and consecutively, if it's not in swap, from the underlying persistent storage. If value has to be loaded from persistent storage,CacheStore#load(Transaction, Object)method will be used.If the returned value is not needed, method
IgniteInternalCache.replace(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
CacheStoreviaCacheStore#put(Transaction, Object, Object)method.Transactions
This method is transactional and will enlist the entry into ongoing transaction if there is one.- Specified by:
getAndReplaceAsyncin interfaceIgniteInternalCache<K,V>- Parameters:
key- Key to store in cache.val- Value to be associated with the given key.- Returns:
- Future for replace operation.
-
replace
public final boolean replace(K key, V val) throws IgniteCheckedException
Stores given key-value pair in cache only if only if there is a previous mapping for it.This method will return
trueif value is stored in cache andfalseotherwise. UnlikeIgniteInternalCache.getAndReplace(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
CacheStoreviaCacheStore#put(Transaction, Object, Object)method.Transactions
This method is transactional and will enlist the entry into ongoing transaction if there is one.- Specified by:
replacein interfaceIgniteInternalCache<K,V>- Parameters:
key- Key to store in cache.val- Value to be associated with the given key.- Returns:
Trueif replace happened,falseotherwise.- Throws:
IgniteCheckedException- If replace operation failed.
-
replaceAsync
public final IgniteInternalFuture<Boolean> replaceAsync(K key, V val)
Asynchronously stores given key-value pair in cache only if only if there is a previous mapping for it.This method will return
trueif value is stored in cache andfalseotherwise. UnlikeIgniteInternalCache.getAndReplaceAsync(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
CacheStoreviaCacheStore#put(Transaction, Object, Object)method.Transactions
This method is transactional and will enlist the entry into ongoing transaction if there is one.- Specified by:
replaceAsyncin interfaceIgniteInternalCache<K,V>- Parameters:
key- Key to store in cache.val- Value to be associated with the given key.- Returns:
- Future for the replace operation.
-
replace
public final boolean replace(K key, V oldVal, V newVal) throws IgniteCheckedException
Stores given key-value pair in cache only if only if the previous value is equal to the'oldVal'passed in.This method will return
trueif value is stored in cache andfalseotherwise.If write-through is enabled, the stored value will be persisted to
CacheStoreviaCacheStore#put(Transaction, Object, Object)method.Transactions
This method is transactional and will enlist the entry into ongoing transaction if there is one.- Specified by:
replacein interfaceIgniteInternalCache<K,V>- Parameters:
key- Key to store in cache.oldVal- Old value to match.newVal- Value to be associated with the given key.- Returns:
Trueif replace happened,falseotherwise.- Throws:
IgniteCheckedException- If replace operation failed.
-
replaceAsync
public IgniteInternalFuture<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.This method will return
trueif value is stored in cache andfalseotherwise.If write-through is enabled, the stored value will be persisted to
CacheStoreviaCacheStore#put(Transaction, Object, Object)method.Transactions
This method is transactional and will enlist the entry into ongoing transaction if there is one.- Specified by:
replaceAsyncin interfaceIgniteInternalCache<K,V>- Parameters:
key- Key to store in cache.oldVal- Old value to match.newVal- Value to be associated with the given key.- Returns:
- Future for the replace operation.
-
putAll
public void putAll(@Nullable @Nullable Map<? extends K,? extends V> m) throws IgniteCheckedExceptionStores given key-value pairs in cache. If filters are provided, then entries will be stored in cache only if they pass the filter. Note that filter check is atomic, so value stored in cache is guaranteed to be consistent with the filters.If write-through is enabled, the stored values will be persisted to
CacheStoreviaCacheStore#putAll(Transaction, Map)method.Transactions
This method is transactional and will enlist the entry into ongoing transaction if there is one.- Specified by:
putAllin interfaceIgniteInternalCache<K,V>- Parameters:
m- Key-value pairs to store in cache.- Throws:
IgniteCheckedException- If put operation failed.
-
putAll0
protected void putAll0(Map<? extends K,? extends V> m) throws IgniteCheckedException
- Parameters:
m- Map.- Throws:
IgniteCheckedException- If failed.
-
putAllAsync
public IgniteInternalFuture<?> putAllAsync(Map<? extends K,? extends V> m)
Asynchronously stores given key-value pairs in cache. If filters are provided, then entries will be stored in cache only if they pass the filter. Note that filter check is atomic, so value stored in cache is guaranteed to be consistent with the filters.If write-through is enabled, the stored values will be persisted to
CacheStoreviaCacheStore#putAll(Transaction, Map)method.Transactions
This method is transactional and will enlist the entry into ongoing transaction if there is one.- Specified by:
putAllAsyncin interfaceIgniteInternalCache<K,V>- Parameters:
m- Key-value pairs to store in cache.- Returns:
- Future for putAll operation.
-
putAllAsync0
protected IgniteInternalFuture<?> putAllAsync0(Map<? extends K,? extends V> m)
- Parameters:
m- Map.- Returns:
- Future.
-
getAndRemove
@Nullable public V getAndRemove(K key) throws IgniteCheckedException
Removes given key mapping from cache. If cache previously contained value for the given key, then this value is returned. In case ofCacheMode.PARTITIONEDorCacheMode.REPLICATEDcaches, the value will be loaded from the primary node, which in its turn may load the value from the disk-based swap storage, and consecutively, if it's not in swap, from the underlying persistent storage. If value has to be loaded from persistent storage,CacheStore#load(Transaction, Object)method will be used.If the returned value is not needed, method
#removex(Object, org.apache.ignite.lang.IgnitePredicate[])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
CacheStoreviaCacheStore#remove(Transaction, Object)method.Transactions
This method is transactional and will enlist the entry into ongoing transaction if there is one.- Specified by:
getAndRemovein interfaceIgniteInternalCache<K,V>- Parameters:
key- Key whose mapping is to be removed from cache.- Returns:
- Previous value associated with specified key, or
nullif there was no value for this key. - Throws:
IgniteCheckedException- If remove operation failed.
-
getAndRemove0
protected V getAndRemove0(K key) throws IgniteCheckedException
- Parameters:
key- Key.- Returns:
- Previous value.
- Throws:
IgniteCheckedException- If failed.
-
getAndRemoveAsync
public IgniteInternalFuture<V> getAndRemoveAsync(K key)
Asynchronously removes given key mapping from cache. If cache previously contained value for the given key, then this value is returned. In case ofCacheMode.PARTITIONEDorCacheMode.REPLICATEDcaches, the value will be loaded from the primary node, which in its turn may load the value from the swap storage, and consecutively, if it's not in swap, from the underlying persistent storage. If value has to be loaded from persistent storage,CacheStore#load(Transaction, Object)method will be used.If the returned value is not needed, method
#removex(Object, org.apache.ignite.lang.IgnitePredicate[])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
CacheStoreviaCacheStore#remove(Transaction, Object)method.Transactions
This method is transactional and will enlist the entry into ongoing transaction if there is one.- Specified by:
getAndRemoveAsyncin interfaceIgniteInternalCache<K,V>- Parameters:
key- Key whose mapping is to be removed from cache.- Returns:
- Future for the remove operation.
-
getAndRemoveAsync0
protected IgniteInternalFuture<V> getAndRemoveAsync0(K key)
- Parameters:
key- Key.- Returns:
- Future.
-
removeAll
public void removeAll() throws IgniteCheckedExceptionRemoves mappings from cache.USE WITH CARE - if your cache has many entries then transaction will quickly become very heavy and slow.
If write-through is enabled, the values will be removed from
CacheStoreviaIgniteDataStreamer.Transactions
This method is not transactional.- Specified by:
removeAllin interfaceIgniteInternalCache<K,V>- Throws:
IgniteCheckedException- If remove failed.
-
removeAll
public void removeAll(Collection<? extends K> keys) throws IgniteCheckedException
Removes given key mappings from cache.If write-through is enabled, the values will be removed from
CacheStoreviaIgniteDataStreamer.Transactions
This method is transactional and will enlist the entry into ongoing transaction if there is one.- Specified by:
removeAllin interfaceIgniteInternalCache<K,V>- Parameters:
keys- Keys whose mappings are to be removed from cache.- Throws:
IgniteCheckedException- If remove failed.
-
removeAll0
protected void removeAll0(Collection<? extends K> keys) throws IgniteCheckedException
- Parameters:
keys- Keys.- Throws:
IgniteCheckedException- If failed.
-
removeAllAsync
public IgniteInternalFuture<?> removeAllAsync(@Nullable @Nullable Collection<? extends K> keys)
Asynchronously removes given key mappings from cache for entries.If write-through is enabled, the values will be removed from
CacheStoreviaIgniteDataStreamer.Transactions
This method is transactional and will enlist the entry into ongoing transaction if there is one.- Specified by:
removeAllAsyncin interfaceIgniteInternalCache<K,V>- Parameters:
keys- Keys whose mappings are to be removed from cache.- Returns:
- Future for the remove operation. The future will complete whenever remove operation completes.
-
removeAllAsync0
protected IgniteInternalFuture<Object> removeAllAsync0(Collection<? extends K> keys)
- Parameters:
keys- Keys.- Returns:
- Future.
-
remove
public boolean remove(K key) throws IgniteCheckedException
Removes given key mapping from cache.This method will return
trueif remove did occur, which means that all optionally provided filters have passed and there was something to remove,falseotherwise.If write-through is enabled, the value will be removed from
CacheStoreviaCacheStore#remove(Transaction, Object)method.Transactions
This method is transactional and will enlist the entry into ongoing transaction if there is one.- Specified by:
removein interfaceIgniteInternalCache<K,V>- Parameters:
key- Key whose mapping is to be removed from cache.- Returns:
Trueif filter passed validation and entry was removed,falseotherwise. Note that if filter is not specified, this method will returntrue.- Throws:
IgniteCheckedException- If remove failed.
-
remove
public boolean remove(K key, @Nullable @Nullable CacheEntryPredicate filter) throws IgniteCheckedException
- Parameters:
key- Key.filter- Filter.- Returns:
Trueif entry was removed.- Throws:
IgniteCheckedException- If failed.
-
remove0
protected boolean remove0(K key, CacheEntryPredicate filter) throws IgniteCheckedException
- Parameters:
key- Key.filter- Filter.- Returns:
Trueif entry was removed.- Throws:
IgniteCheckedException- If failed.
-
removeAsync
public IgniteInternalFuture<Boolean> removeAsync(K key)
Asynchronously removes given key mapping from cache.This method will return
trueif remove did occur, which means that all optionally provided filters have passed and there was something to remove,falseotherwise.If write-through is enabled, the value will be removed from
CacheStoreviaCacheStore#remove(Transaction, Object)method.Transactions
This method is transactional and will enlist the entry into ongoing transaction if there is one.- Specified by:
removeAsyncin interfaceIgniteInternalCache<K,V>- Parameters:
key- Key whose mapping is to be removed from cache.- Returns:
- Future for the remove operation. The future will return
trueif optional filters passed validation and remove did occur,falseotherwise. Note that if filter is not specified, this method will returntrue.
-
removeAsync
public IgniteInternalFuture<Boolean> removeAsync(K key, @Nullable @Nullable CacheEntryPredicate filter)
- Parameters:
key- Key to remove.filter- Optional filter.- Returns:
- Putx operation future.
-
removeAsync0
protected IgniteInternalFuture<Boolean> removeAsync0(K key, @Nullable @Nullable CacheEntryPredicate filter)
- Parameters:
key- Key.filter- Filter.- Returns:
- Future.
-
removeAllConflict
public void removeAllConflict(Map<KeyCacheObject,GridCacheVersion> drMap) throws IgniteCheckedException
Removes DR data.- Specified by:
removeAllConflictin interfaceIgniteInternalCache<K,V>- Parameters:
drMap- DR map.- Throws:
IgniteCheckedException- If remove failed.
-
removeAllConflictAsync
public IgniteInternalFuture<?> removeAllConflictAsync(Map<KeyCacheObject,GridCacheVersion> drMap) throws IgniteCheckedException
Removes DR data asynchronously.- Specified by:
removeAllConflictAsyncin interfaceIgniteInternalCache<K,V>- Parameters:
drMap- DR map.- Returns:
- Future.
- Throws:
IgniteCheckedException- If remove failed.
-
remove
public final boolean remove(K key, V val) throws IgniteCheckedException
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
CacheStoreviaCacheStore#remove(Transaction, Object)method.Transactions
This method is transactional and will enlist the entry into ongoing transaction if there is one.- Specified by:
removein interfaceIgniteInternalCache<K,V>- Parameters:
key- Key whose mapping is to be removed from cache.val- Value to match against currently cached value.- Returns:
Trueif entry was removed and passed in value matched the cached one,falseotherwise.- Throws:
IgniteCheckedException- If remove failed.
-
removeAsync
public final IgniteInternalFuture<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.This method will return
trueif remove did occur, which means that all optionally provided filters have passed and there was something to remove,falseotherwise.If write-through is enabled, the value will be removed from
CacheStoreviaCacheStore#remove(Transaction, Object)method.Transactions
This method is transactional and will enlist the entry into ongoing transaction if there is one.- Specified by:
removeAsyncin interfaceIgniteInternalCache<K,V>- Parameters:
key- Key whose mapping is to be removed from cache.val- Value to match against currently cached value.- Returns:
- Future for the remove operation. The future will return
trueif currently cached value will match the passed in one.
-
clusterMetrics
public final CacheMetrics clusterMetrics()
Gets whole cluster metrics (statistics) for this cache.- Specified by:
clusterMetricsin interfaceIgniteInternalCache<K,V>- Returns:
- Cache metrics.
-
clusterMetrics
public CacheMetrics clusterMetrics(ClusterGroup grp)
Gets cluster group metrics (statistics) for this cache.- Specified by:
clusterMetricsin interfaceIgniteInternalCache<K,V>- Parameters:
grp- Cluster group.- Returns:
- Cache metrics.
-
localMetrics
public CacheMetrics localMetrics()
Gets local metrics (statistics) for this cache.- Specified by:
localMetricsin interfaceIgniteInternalCache<K,V>- Returns:
- Cache metrics.
-
metrics0
public CacheMetricsImpl metrics0()
- Returns:
- Metrics.
-
tx
@Nullable public @Nullable GridNearTxLocal tx()
Gets transaction started by this thread ornullif this thread does not have a transaction.- Specified by:
txin interfaceIgniteInternalCache<K,V>- Returns:
- Transaction started by this thread or
nullif this thread does not have a transaction.
-
lock
public boolean lock(K key, long timeout) throws IgniteCheckedException
Synchronously acquires lock on a cached object with given key only if the passed in filter (if any) passes. This method together with filter check will be executed as one atomic operation.Transactions
Locks are not transactional and should not be used from within transactions. If you do need explicit locking within transaction, then you should useTransactionConcurrency.PESSIMISTICconcurrency control for transaction which will acquire explicit locks for relevant cache operations.- Specified by:
lockin interfaceIgniteInternalCache<K,V>- Parameters:
key- Key to lock.timeout- Timeout in milliseconds to wait for lock to be acquired ('0'for no expiration),-1for immediate failure if lock cannot be acquired immediately).- Returns:
Trueif all filters passed and lock was acquired,falseotherwise.- Throws:
IgniteCheckedException- If lock acquisition resulted in error.
-
lockAll
public boolean lockAll(@Nullable @Nullable Collection<? extends K> keys, long timeout) throws IgniteCheckedExceptionAll or nothing synchronous lock for passed in keys. This method together with filter check will be executed as one atomic operation. If at least one filter validation failed, no locks will be acquired.Transactions
Locks are not transactional and should not be used from within transactions. If you do need explicit locking within transaction, then you should useTransactionConcurrency.PESSIMISTICconcurrency control for transaction which will acquire explicit locks for relevant cache operations.- Specified by:
lockAllin interfaceIgniteInternalCache<K,V>- Parameters:
keys- Keys to lock.timeout- Timeout in milliseconds to wait for lock to be acquired ('0'for no expiration).- Returns:
Trueif all filters passed and locks were acquired before timeout has expired,falseotherwise.- Throws:
IgniteCheckedException- If lock acquisition resulted in error.
-
lockAsync
public IgniteInternalFuture<Boolean> lockAsync(K key, long timeout)
Asynchronously acquires lock on a cached object with given key only if the passed in filter (if any) passes. This method together with filter check will be executed as one atomic operation.Transactions
Locks are not transactional and should not be used from within transactions. If you do need explicit locking within transaction, then you should useTransactionConcurrency.PESSIMISTICconcurrency control for transaction which will acquire explicit locks for relevant cache operations.- Specified by:
lockAsyncin interfaceIgniteInternalCache<K,V>- Parameters:
key- Key to lock.timeout- Timeout in milliseconds to wait for lock to be acquired ('0'for no expiration,-1for immediate failure if lock cannot be acquired immediately).- Returns:
- Future for the lock operation. The future will return
truewhenever all filters pass and locks are acquired before timeout is expired,falseotherwise.
-
unlock
public void unlock(K key) throws IgniteCheckedException
Unlocks given key only if current thread owns the lock. If optional filter will not pass, then unlock will not happen. If the key being unlocked was never locked by current thread, then this method will do nothing.Transactions
Locks are not transactional and should not be used from within transactions. If you do need explicit locking within transaction, then you should useTransactionConcurrency.PESSIMISTICconcurrency control for transaction which will acquire explicit locks for relevant cache operations.- Specified by:
unlockin interfaceIgniteInternalCache<K,V>- Parameters:
key- Key to unlock.- Throws:
IgniteCheckedException- If unlock execution resulted in error.
-
isLocked
public boolean isLocked(K key)
Checks if any node owns a lock for this key.This is a local in-VM operation and does not involve any network trips or access to persistent storage in any way.
- Specified by:
isLockedin interfaceIgniteInternalCache<K,V>- Parameters:
key- Key to check.- Returns:
Trueif lock is owned by some node.
-
isLockedByThread
public boolean isLockedByThread(K key)
Checks if current thread owns a lock on this key.This is a local in-VM operation and does not involve any network trips or access to persistent storage in any way.
- Specified by:
isLockedByThreadin interfaceIgniteInternalCache<K,V>- Parameters:
key- Key to check.- Returns:
Trueif key is locked by current thread.
-
txStart
public Transaction txStart(TransactionConcurrency concurrency, TransactionIsolation isolation)
Starts new transaction with the specified concurrency and isolation.- Specified by:
txStartin interfaceIgniteInternalCache<K,V>- Parameters:
concurrency- Concurrency.isolation- Isolation.- Returns:
- New transaction.
-
txStartEx
public GridNearTxLocal txStartEx(TransactionConcurrency concurrency, TransactionIsolation isolation)
- Specified by:
txStartExin interfaceIgniteInternalCache<K,V>- Parameters:
concurrency- Concurrency.isolation- Isolation.- Returns:
- New transaction.
-
txStart
public Transaction txStart(TransactionConcurrency concurrency, TransactionIsolation isolation, long timeout, int txSize) throws IllegalStateException
Starts transaction with specified isolation, concurrency, timeout, invalidation flag, and number of participating entries.- Specified by:
txStartin interfaceIgniteInternalCache<K,V>- Parameters:
concurrency- Concurrency.isolation- Isolation.timeout- Timeout.txSize- Number of entries participating in transaction (may be approximate).- Returns:
- New transaction.
- Throws:
IllegalStateException- If transaction is already started by this thread.
-
checkJta
protected void checkJta() throws IgniteCheckedExceptionChecks if cache is working in JTA transaction and enlist cache as XAResource if necessary.- Throws:
IgniteCheckedException- In case of error.
-
localLoadCache
public void localLoadCache(IgniteBiPredicate<K,V> p, Object[] args) throws IgniteCheckedException
Delegates toCacheStore.loadCache(IgniteBiInClosure, Object...)method to load state from the underlying persistent storage. The loaded values will then be given to the optionally passed in predicate, and, if the predicate returnstrue, will be stored in cache. If predicate isnull, then all loaded values will be stored in cache.Note that this method does not receive keys as a parameter, so it is up to
CacheStoreimplementation to provide all the data to be loaded.This method is not transactional and may end up loading a stale value into cache if another thread has updated the value immediately after it has been loaded. It is mostly useful when pre-loading the cache from underlying data store before start, or for read-only caches.
- Specified by:
localLoadCachein interfaceIgniteInternalCache<K,V>- Parameters:
p- Optional predicate (may benull). If provided, will be used to filter values to be put into cache.args- Optional user arguments to be passed intoCacheStore.loadCache(IgniteBiInClosure, Object...)method.- Throws:
IgniteCheckedException- If loading failed.
-
localLoadCacheAsync
public IgniteInternalFuture<?> localLoadCacheAsync(IgniteBiPredicate<K,V> p, Object[] args)
Asynchronously delegates toCacheStore.loadCache(IgniteBiInClosure, Object...)method to reload state from the underlying persistent storage. The reloaded values will then be given to the optionally passed in predicate, and if the predicate returnstrue, will be stored in cache. If predicate isnull, then all reloaded values will be stored in cache.Note that this method does not receive keys as a parameter, so it is up to
CacheStoreimplementation to provide all the data to be loaded.This method is not transactional and may end up loading a stale value into cache if another thread has updated the value immediately after it has been loaded. It is mostly useful when pre-loading the cache from underlying data store before start, or for read-only caches.
- Specified by:
localLoadCacheAsyncin interfaceIgniteInternalCache<K,V>- Parameters:
p- Optional predicate (may benull). If provided, will be used to filter values to be put into cache.args- Optional user arguments to be passed intoCacheStore.loadCache(IgniteBiInClosure, Object...)method.- Returns:
- Future to be completed whenever loading completes.
-
loadAll
public IgniteInternalFuture<?> loadAll(Set<? extends K> keys, boolean replaceExisting)
- Parameters:
keys- Keys.replaceExisting- Replace existing values flag.- Returns:
- Load future.
-
localLoad
public void localLoad(Collection<? extends K> keys, @Nullable @Nullable javax.cache.expiry.ExpiryPolicy plc, boolean keepBinary) throws IgniteCheckedException
- Parameters:
keys- Keys to load.plc- Optional expiry policy.- Throws:
IgniteCheckedException- If failed.
-
size
public int size(CachePeekMode[] peekModes) throws IgniteCheckedException
- Specified by:
sizein interfaceIgniteInternalCache<K,V>- Parameters:
peekModes- Peek modes.- Returns:
- Global cache size.
- Throws:
IgniteCheckedException- If failed.
-
sizeLong
public long sizeLong(CachePeekMode[] peekModes) throws IgniteCheckedException
- Specified by:
sizeLongin interfaceIgniteInternalCache<K,V>- Parameters:
peekModes- Peek modes.- Returns:
- Global cache size as a long value.
- Throws:
IgniteCheckedException- If failed.
-
sizeLong
public long sizeLong(int partition, CachePeekMode[] peekModes) throws IgniteCheckedException- Specified by:
sizeLongin interfaceIgniteInternalCache<K,V>- Parameters:
partition- partitionpeekModes- Peek modes.- Returns:
- Global cache size as a long value.
- Throws:
IgniteCheckedException- If failed.
-
sizeAsync
public IgniteInternalFuture<Integer> sizeAsync(CachePeekMode[] peekModes)
- Specified by:
sizeAsyncin interfaceIgniteInternalCache<K,V>- Parameters:
peekModes- Peek modes.- Returns:
- Future.
-
sizeLongAsync
public IgniteInternalFuture<Long> sizeLongAsync(CachePeekMode[] peekModes)
- Specified by:
sizeLongAsyncin interfaceIgniteInternalCache<K,V>- Parameters:
peekModes- Peek modes.- Returns:
- Future.
-
sizeLongAsync
public IgniteInternalFuture<Long> sizeLongAsync(int part, CachePeekMode[] peekModes)
- Specified by:
sizeLongAsyncin interfaceIgniteInternalCache<K,V>- Parameters:
part- partitonpeekModes- Peek modes.- Returns:
- Future.
-
localSize
public int localSize(CachePeekMode[] peekModes) throws IgniteCheckedException
- Specified by:
localSizein interfaceIgniteInternalCache<K,V>- Parameters:
peekModes- Peek modes.- Returns:
- Local cache size.
- Throws:
IgniteCheckedException- If failed.
-
size
public int size()
Gets the number of all entries cached on this node. This method will return the count of all cache entries and has O(1) complexity on baseIgniteInternalCache. It is essentially the size of cache key set and is semantically identical to {Cache.keySet().size().NOTE: this operation is not distributed and returns only the number of entries cached on this node.
- Specified by:
sizein interfaceIgniteInternalCache<K,V>- Returns:
- Size of cache on this node.
-
sizeLong
public long sizeLong()
Gets the number of all entries cached on this node as a long value. This method will return the count of all cache entries and has O(1) complexity on baseIgniteInternalCache. It is essentially the size of cache key set and is semantically identical to {Cache.keySet().size().NOTE: this operation is not distributed and returns only the number of entries cached on this node.
- Specified by:
sizeLongin interfaceIgniteInternalCache<K,V>- Returns:
- Size of cache on this node.
-
nearSize
public int nearSize()
Gets size of near cache key set. This method will return count of all entries in near cache and has O(1) complexity on base cache projection.Note that for
LOCALnon-distributed caches this method will always return0- Specified by:
nearSizein interfaceIgniteInternalCache<K,V>- Returns:
- Size of near cache key set or
0if cache is notCacheMode.PARTITIONED.
-
primarySize
public int primarySize()
Gets the number of all primary entries cached on this node.For
CacheMode.PARTITIONEDandCacheMode.REPLICATEDmodes, this method will return number of primary entries cached on this node (excluding any backups). The complexity of this method is O(P), where P is the total number of partitions.NOTE: this operation is not distributed and returns only the number of primary entries cached on this node.
- Specified by:
primarySizein interfaceIgniteInternalCache<K,V>- Returns:
- Number of primary entries in cache.
-
primarySizeLong
public long primarySizeLong()
Gets the number of all primary entries cached on this node as a long value.For
CacheMode.PARTITIONEDandCacheMode.REPLICATEDmodes, this method will return number of primary entries cached on this node (excluding any backups). The complexity of this method is O(P), where P is the total number of partitions.NOTE: this operation is not distributed and returns only the number of primary entries cached on this node.
- Specified by:
primarySizeLongin interfaceIgniteInternalCache<K,V>- Returns:
- Number of primary entries in cache.
-
scanIterator
public Iterator<javax.cache.Cache.Entry<K,V>> scanIterator(boolean keepBinary, @Nullable @Nullable IgniteBiPredicate<Object,Object> p) throws IgniteCheckedException
- Specified by:
scanIteratorin interfaceIgniteInternalCache<K,V>- Parameters:
keepBinary- Keep binary flag.p- Optional key/value predicate.- Returns:
- Scan query iterator.
- Throws:
IgniteCheckedException- If failed.
-
igniteIterator
public Iterator<javax.cache.Cache.Entry<K,V>> igniteIterator() throws IgniteCheckedException
- Returns:
- Distributed ignite cache iterator.
- Throws:
IgniteCheckedException- If failed.
-
igniteIterator
public Iterator<javax.cache.Cache.Entry<K,V>> igniteIterator(boolean keepBinary) throws IgniteCheckedException
- Parameters:
keepBinary- Keep binary flag.- Returns:
- Distributed ignite cache iterator.
- Throws:
IgniteCheckedException- If failed.
-
nextVersion
public GridCacheVersion nextVersion()
Gets next grid cache version.- Returns:
- Next version based on given topology version.
-
nextVersion
public GridCacheVersion nextVersion(byte dataCenterId)
Gets next grid cache version.- Parameters:
dataCenterId- Data center id.- Returns:
- Next version based on given topology version.
-
offHeapEntriesCount
public long offHeapEntriesCount()
Gets number of cache entries stored in off-heap memory.- Specified by:
offHeapEntriesCountin interfaceIgniteInternalCache<K,V>- Returns:
- Number of cache entries stored in off-heap memory.
-
offHeapAllocatedSize
public long offHeapAllocatedSize()
Gets memory size allocated in off-heap.- Specified by:
offHeapAllocatedSizein interfaceIgniteInternalCache<K,V>- Returns:
- Allocated memory size.
-
lastAsyncFuture
public GridCacheAdapter.FutureHolder lastAsyncFuture()
Last async operation future for implicit transactions. For explicit transactions future is bound to the transaction and stored inside the transaction. These futures are required to linearize async operations made by the same thread.
-
asyncOp
protected <T> IgniteInternalFuture<T> asyncOp(GridNearTxLocal tx, GridCacheAdapter.AsyncOp<T> op, CacheOperationContext opCtx, boolean retry)
- Type Parameters:
T- Return type.- Parameters:
tx- Transaction.op- Cache operation.opCtx- Cache operation context.- Returns:
- Future.
-
asyncOpAcquire
@Nullable protected <T> @Nullable IgniteInternalFuture<T> asyncOpAcquire(boolean retry)
Tries to acquire asynchronous operations permit, if limited.- Parameters:
retry- Retry flag.- Returns:
- Failed future if waiting was interrupted.
-
asyncOpRelease
protected final void asyncOpRelease(boolean retry)
Releases asynchronous operations permit, if limited.- Parameters:
retry- Retry flag.
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
readExternal
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOExceptionClassNotFoundException
-
readResolve
protected Object readResolve() throws ObjectStreamException
Reconstructs object on unmarshalling.- Returns:
- Reconstructed object.
- Throws:
ObjectStreamException- Thrown in case of unmarshalling error.
-
rebalance
public IgniteInternalFuture<?> rebalance()
Forces this cache node to re-balance its partitions. This method is usually used whenCacheConfiguration.getRebalanceDelay()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.In case of
CacheMode.PARTITIONEDcaches, 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 beforerebalanceDelayexpires. To place nodes on the same place in consistent hash ring, useIgniteConfiguration.setConsistentId(Serializable)to make sure that a node maps to the same hash ID if re-started.See
CacheConfiguration.getRebalanceDelay()for more information on how to configure rebalance re-partition delay.- Specified by:
rebalancein interfaceIgniteInternalCache<K,V>- Returns:
- Future that will be completed when rebalancing is finished.
-
evict
public boolean evict(K key)
Evicts entry associated with given key from cache. Note, that entry will be evicted only if it's not used (not participating in any locks or transactions).- Specified by:
evictin interfaceIgniteInternalCache<K,V>- Parameters:
key- Key to evict from cache.- Returns:
Trueif entry could be evicted,falseotherwise.
-
evictAll
public void evictAll(Collection<? extends K> 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).- Specified by:
evictAllin interfaceIgniteInternalCache<K,V>- Parameters:
keys- Keys to evict.
-
entrySet
public Set<javax.cache.Cache.Entry<K,V>> entrySet(@Nullable @Nullable CacheEntryPredicate... filter)
- Parameters:
filter- Filters to evaluate.- Returns:
- Entry set.
-
repairableGet
@Nullable public final V repairableGet(K key, boolean deserializeBinary, boolean needVer) throws IgniteCheckedException
- Parameters:
key- Key.deserializeBinary- Deserialize binary flag.needVer- Need version.- Returns:
- Cached value.
- Throws:
IgniteCheckedException- If failed.
-
get
protected V get(K key, String taskName, boolean deserializeBinary, boolean needVer) throws IgniteCheckedException
- Parameters:
key- Key.taskName- Task name.deserializeBinary- Deserialize binary flag.needVer- Need version.- Returns:
- Cached value.
- Throws:
IgniteCheckedException- If failed.
-
repairableGetAsync
public final IgniteInternalFuture<V> repairableGetAsync(K key, boolean deserializeBinary, boolean needVer, ReadRepairStrategy readRepairStrategy)
- Parameters:
key- Key.deserializeBinary- Deserialize binary flag.needVer- Need version.- Returns:
- Read operation future.
-
repairableGetAll
protected Map<K,V> repairableGetAll(Collection<? extends K> keys, boolean deserializeBinary, boolean needVer, boolean recovery, ReadRepairStrategy readRepairStrategy) throws IgniteCheckedException
- Parameters:
keys- Keys.deserializeBinary- Deserialize binary flag.needVer- Need version.- Returns:
- Map of cached values.
- Throws:
IgniteCheckedException- If read failed.
-
getAll
protected Map<K,V> getAll(Collection<? extends K> keys, boolean deserializeBinary, boolean needVer, boolean recovery, ReadRepairStrategy readRepairStrategy) throws IgniteCheckedException
- Parameters:
keys- Keys.deserializeBinary- Deserialize binary flag.needVer- Need version.recovery- Recovery flag.readRepairStrategy- Read repair strategy.- Returns:
- Map of cached values.
- Throws:
IgniteCheckedException- If read failed.
-
repairableGetAllAsync
public IgniteInternalFuture<Map<K,V>> repairableGetAllAsync(@Nullable @Nullable Collection<? extends K> keys, boolean forcePrimary, boolean skipTx, String taskName, boolean deserializeBinary, boolean recovery, ReadRepairStrategy readRepairStrategy, boolean skipVals, boolean needVer)
- Parameters:
keys- Keys.forcePrimary- Force primary.skipTx- Skip tx.taskName- Task name.deserializeBinary- Deserialize binary.recovery- Recovery mode flag.skipVals- Skip values.needVer- Need version.- Returns:
- Future for the get operation.
- See Also:
getAllAsync(Collection)
-
onDeferredDelete
public abstract void onDeferredDelete(GridCacheEntryEx entry, GridCacheVersion ver)
- Parameters:
entry- Entry.ver- Version.
-
onReconnected
public void onReconnected()
-
warnIfUnordered
protected void warnIfUnordered(Map<?,?> m, GridCacheAdapter.BulkOperation op)
Checks that given map is sorted or otherwise constant order, or processed inside deadlock-detecting transaction. Issues developer warning otherwise.- Parameters:
m- Map to examine.
-
warnIfUnordered
protected void warnIfUnordered(Collection<?> coll, GridCacheAdapter.BulkOperation op)
Checks that given collection is sorted set, or processed inside deadlock-detecting transaction. Issues developer warning otherwise.- Parameters:
coll- Collection to examine.
-
iterator
protected final Iterator<javax.cache.Cache.Entry<K,V>> iterator(Iterator<? extends GridCacheEntryEx> it, boolean deserializeBinary)
- Parameters:
it- Internal entry iterator.deserializeBinary- Deserialize binary flag.- Returns:
- Public API iterator.
-
preloadPartition
public void preloadPartition(int part) throws IgniteCheckedExceptionPreload cache partition.- Specified by:
preloadPartitionin interfaceIgniteInternalCache<K,V>- Parameters:
part- Partition.- Throws:
IgniteCheckedException- If failed.
-
preloadPartitionAsync
public IgniteInternalFuture<?> preloadPartitionAsync(int part) throws IgniteCheckedException
Preload cache partition.- Specified by:
preloadPartitionAsyncin interfaceIgniteInternalCache<K,V>- Parameters:
part- Partition.- Returns:
- Future to be completed whenever preloading completes.
- Throws:
IgniteCheckedException- If failed.
-
localPreloadPartition
public boolean localPreloadPartition(int part) throws IgniteCheckedExceptionPreloads cache partition if it exists on local node.- Specified by:
localPreloadPartitionin interfaceIgniteInternalCache<K,V>- Parameters:
part- Partition.- Returns:
Trueif partition was preloaded,falseif it doesn't belong to local node.- Throws:
IgniteCheckedException- If failed.
-
parsePeekModes
protected static GridCacheAdapter.PeekModes parsePeekModes(CachePeekMode[] peekModes, boolean primary)
- Parameters:
peekModes- Cache peek modes array.primary- Defines the default behavior if affinity flags are not specified.- Returns:
- Peek modes flags.
-
expiryPolicy
@Nullable public final @Nullable IgniteCacheExpiryPolicy expiryPolicy(@Nullable @Nullable javax.cache.expiry.ExpiryPolicy plc)
- Parameters:
plc- Explicitly specified expiry policy for cache operation.- Returns:
- Expiry policy wrapper.
-
-