Class GridDhtAtomicCache<K,V>
- java.lang.Object
-
- org.apache.ignite.internal.processors.cache.GridCacheAdapter<K,V>
-
- org.apache.ignite.internal.processors.cache.distributed.GridDistributedCacheAdapter<K,V>
-
- org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtCacheAdapter<K,V>
-
- org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridDhtAtomicCache<K,V>
-
- All Implemented Interfaces:
Externalizable,Serializable,Iterable<javax.cache.Cache.Entry<K,V>>,IgniteInternalCache<K,V>
@GridToStringExclude public class GridDhtAtomicCache<K,V> extends GridDhtCacheAdapter<K,V>
Non-transactional partitioned cache.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtCacheAdapter
GridDhtCacheAdapter.MessageHandler<M>
-
Nested classes/interfaces inherited from class org.apache.ignite.internal.processors.cache.distributed.GridDistributedCacheAdapter
GridDistributedCacheAdapter.GlobalRemoveAllJob<K,V>
-
Nested classes/interfaces inherited from class org.apache.ignite.internal.processors.cache.GridCacheAdapter
GridCacheAdapter.AsyncOp<T>, GridCacheAdapter.AtomicReadRepairEntryProcessor<K,V>, GridCacheAdapter.BulkOperation, GridCacheAdapter.CacheExpiryPolicy, GridCacheAdapter.FutureHolder, GridCacheAdapter.InvokeAllTimeStatClosure<T>, GridCacheAdapter.PeekModes, GridCacheAdapter.TopologyVersionAwareJob, GridCacheAdapter.UpdateGetAllTimeStatClosure<T>, GridCacheAdapter.UpdateGetAndRemoveTimeStatClosure<T>, GridCacheAdapter.UpdateGetTimeStatClosure<T>, GridCacheAdapter.UpdatePutAllConflictTimeStatClosure<T>, GridCacheAdapter.UpdatePutAllTimeStatClosure<T>, GridCacheAdapter.UpdatePutAndGetTimeStatClosure<T>, GridCacheAdapter.UpdatePutTimeStatClosure<T>, GridCacheAdapter.UpdateRemoveAllConflictTimeStatClosure<T>, GridCacheAdapter.UpdateRemoveAllTimeStatClosure<T>, GridCacheAdapter.UpdateRemoveTimeStatClosure, GridCacheAdapter.UpdateTimeStatClosure<T>
-
-
Field Summary
Fields Modifier and Type Field Description static intDFLT_ATOMIC_DEFERRED_ACK_BUFFER_SIZEstatic intDFLT_ATOMIC_DEFERRED_ACK_TIMEOUT-
Fields inherited from class org.apache.ignite.internal.processors.cache.GridCacheAdapter
cacheCfg, CLEAR_ALL_SPLIT_THRESHOLD, ctx, DFLT_CACHE_RETRIES_COUNT, DFLT_CACHE_START_SIZE, DFLT_START_CACHE_SIZE, lastFut, locNodeId, log, map, MAX_RETRIES, metrics, NON_TRANSACTIONAL_IGNITE_CACHE_CLEAR_IN_TX_ERROR_MESSAGE, RET2NULL, txLockMsgLog
-
-
Constructor Summary
Constructors Constructor Description GridDhtAtomicCache()Empty constructor required byExternalizable.GridDhtAtomicCache(GridCacheContext<K,V> ctx)GridDhtAtomicCache(GridCacheContext<K,V> ctx, GridCacheConcurrentMap map)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcheckJta()Checks if cache is working in JTA transaction and enlist cache as XAResource if necessary.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, boolean forcePrimary, boolean skipTx, String taskName, boolean deserializeBinary, boolean recovery, ReadRepairStrategy readRepairStrategy, boolean skipVals, boolean needVer)protected VgetAndPut0(K key, V val, @Nullable CacheEntryPredicate filter)IgniteInternalFuture<V>getAndPutAsync0(K key, V val, @Nullable CacheEntryPredicate filter)VgetAndRemove0(K key)IgniteInternalFuture<V>getAndRemoveAsync0(K key)protected IgniteInternalFuture<V>getAsync(K key, boolean forcePrimary, boolean skipTx, String taskName, boolean deserializeBinary, boolean skipVals, boolean needVer)protected voidinit()Post constructor initialization for subclasses.<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)booleanisDhtAtomic()protected IgniteInternalFuture<Boolean>lockAllAsync(Collection<KeyCacheObject> keys, long timeout, @Nullable IgniteTxLocalEx tx, boolean isInvalidate, boolean isRead, boolean retval, @Nullable TransactionIsolation isolation, long createTtl, long accessTtl)GridNearCacheAdapter<K,V>near()voidnear(GridNearAtomicCache<K,V> near)voidonKernalStart()Kernal start callback.protected booleanput0(K key, V val, CacheEntryPredicate filter)protected voidputAll0(Map<? extends K,? extends V> m)IgniteInternalFuture<?>putAllAsync0(Map<? extends K,? extends V> m)voidputAllConflict(Map<KeyCacheObject,GridCacheDrInfo> conflictMap)Store DR data.IgniteInternalFuture<?>putAllConflictAsync(Map<KeyCacheObject,GridCacheDrInfo> conflictMap)Store DR data asynchronously.IgniteInternalFuture<Boolean>putAsync0(K key, V val, @Nullable CacheEntryPredicate filter)protected booleanremove0(K key, CacheEntryPredicate filter)protected voidremoveAll0(Collection<? extends K> keys)IgniteInternalFuture<Object>removeAllAsync0(Collection<? extends K> keys)voidremoveAllConflict(Map<KeyCacheObject,GridCacheVersion> conflictMap)Removes DR data.IgniteInternalFuture<?>removeAllConflictAsync(Map<KeyCacheObject,GridCacheVersion> conflictMap)Removes DR data asynchronously.IgniteInternalFuture<Boolean>removeAsync0(K key, @Nullable CacheEntryPredicate filter)voidstart()Starts this cache.StringtoString()-
Methods inherited from class org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtCacheAdapter
addFuture, createEntry, dumpDebugInfo, entryEx, entryExx, entryExx, getDhtAsync, localEntriesIterator, localLoad, localLoadCache, needRemap, onDeferredDelete, onKernalStop, peekExx, preloader, primarySize, primarySizeLong, printMemoryStats, processForceKeyResponse, processForceKeysRequest, processNearGetRequest, processNearGetResponse, processNearSingleGetRequest, processNearSingleGetResponse, removeFuture, sendTtlUpdateRequest, size, sizeLong, splitClearLocally, topology, unlockAll
-
Methods inherited from class org.apache.ignite.internal.processors.cache.distributed.GridDistributedCacheAdapter
localSizeLong, localSizeLong, lockAllAsync, removeAll, removeAllAsync, removeVersionedEntry, txLockAsync
-
Methods inherited from class org.apache.ignite.internal.processors.cache.GridCacheAdapter
active, active, affinity, allEntries, asyncOp, asyncOpAcquire, asyncOpRelease, cache, clear, clear, clearAll, clearAllAsync, clearAsync, clearAsync, clearLocally, clearLocally, clearLocally, clearLocallyAll, clusterMetrics, clusterMetrics, configuration, containsKey, containsKeyAsync, containsKeys, containsKeysAsync, context, decrementSize, entries, entryEx, entryEx, entrySet, entrySet, evict, evictAll, expiry, expiryPolicy, get, get, getAll, getAllAsync, getAllOutTx, getAllOutTxAsync, getAndPut, getAndPut, getAndPutAsync, getAndPutAsync, getAndPutIfAbsent, getAndPutIfAbsentAsync, getAndRemove, getAndRemoveAsync, getAndReplace, getAndReplaceAsync, getAsync, getEntries, getEntriesAsync, getEntry, getEntryAsync, getForcePrimary, getForcePrimaryAsync, igniteIterator, igniteIterator, incrementSize, invoke, isColocated, isDht, isEmpty, isLocal, isLocked, isLockedByThread, isNear, iterator, iterator, keepBinary, keySet, lastAsyncFuture, loadAll, localEntries, localLoadCacheAsync, localMetrics, localPeek, localPreloadPartition, localSize, lock, lockAll, lockAsync, log, lostPartitions, map, metrics0, name, nearSize, nextVersion, nextVersion, offHeapAllocatedSize, offHeapEntriesCount, onReconnected, onUndeploy, parsePeekModes, peekEx, peekEx, preloadPartition, preloadPartitionAsync, put, put, putAll, putAllAsync, putAsync, putAsync, putIfAbsent, putIfAbsentAsync, readExternal, readResolve, rebalance, remove, remove, remove, removeAll, removeAllAsync, removeAsync, removeAsync, removeAsync, removeEntry, removeIfObsolete, removeMetrics, repairableGet, repairableGetAll, repairableGetAllAsync, repairableGetAsync, replace, replace, replaceAsync, replaceAsync, scanIterator, setSkipStore, size, sizeAsync, sizeLong, sizeLong, sizeLongAsync, sizeLongAsync, skipStore, startInfo, stop, stopInfo, tx, txStart, txStart, txStartEx, unlock, warnIfUnordered, warnIfUnordered, withExpiryPolicy, withNoRetries, writeExternal
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Constructor Detail
-
GridDhtAtomicCache
public GridDhtAtomicCache()
Empty constructor required byExternalizable.
-
GridDhtAtomicCache
public GridDhtAtomicCache(GridCacheContext<K,V> ctx)
- Parameters:
ctx- Cache context.
-
GridDhtAtomicCache
public GridDhtAtomicCache(GridCacheContext<K,V> ctx, GridCacheConcurrentMap map)
- Parameters:
ctx- Cache context.map- Cache concurrent map.
-
-
Method Detail
-
checkJta
protected void checkJta() throws IgniteCheckedExceptionChecks if cache is working in JTA transaction and enlist cache as XAResource if necessary.- Overrides:
checkJtain classGridCacheAdapter<K,V>- Throws:
IgniteCheckedException- In case of error.
-
isDhtAtomic
public boolean isDhtAtomic()
- Overrides:
isDhtAtomicin classGridCacheAdapter<K,V>- Returns:
Trueif cache is DHT Atomic.
-
init
protected void init()
Post constructor initialization for subclasses.- Overrides:
initin classGridCacheAdapter<K,V>
-
onKernalStart
public void onKernalStart() throws IgniteCheckedExceptionKernal start callback.- Overrides:
onKernalStartin classGridDhtCacheAdapter<K,V>- Throws:
IgniteCheckedException- If callback failed.
-
start
public void start() throws IgniteCheckedExceptionStarts this cache. Child classes should override this method to provide custom start-up behavior.- Specified by:
startin classGridCacheAdapter<K,V>- Throws:
IgniteCheckedException- If start failed.
-
near
public void near(GridNearAtomicCache<K,V> near)
- Parameters:
near- Near cache.
-
near
public GridNearCacheAdapter<K,V> near()
- Specified by:
nearin classGridDhtCacheAdapter<K,V>- Returns:
- Near cache.
-
getAsync
protected IgniteInternalFuture<V> getAsync(K key, boolean forcePrimary, boolean skipTx, String taskName, boolean deserializeBinary, boolean skipVals, boolean needVer)
- Overrides:
getAsyncin classGridCacheAdapter<K,V>- 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.
-
getAll
protected Map<K,V> getAll(Collection<? extends K> keys, boolean deserializeBinary, boolean needVer, boolean recovery, ReadRepairStrategy readRepairStrategy) throws IgniteCheckedException
- Overrides:
getAllin classGridCacheAdapter<K,V>- 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.
-
getAllAsync
public 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)
- Overrides:
getAllAsyncin classGridDhtCacheAdapter<K,V>- 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:
GridCacheAdapter.getAllAsync(Collection)
-
getAndPut0
protected V getAndPut0(K key, V val, @Nullable @Nullable CacheEntryPredicate filter) throws IgniteCheckedException
- Overrides:
getAndPut0in classGridCacheAdapter<K,V>- Parameters:
key- Key.val- Value.filter- Optional filter.- Returns:
- Previous value.
- Throws:
IgniteCheckedException- If failed.
-
put0
protected boolean put0(K key, V val, CacheEntryPredicate filter) throws IgniteCheckedException
- Overrides:
put0in classGridCacheAdapter<K,V>- 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.
-
getAndPutAsync0
public IgniteInternalFuture<V> getAndPutAsync0(K key, V val, @Nullable @Nullable CacheEntryPredicate filter)
- Overrides:
getAndPutAsync0in classGridCacheAdapter<K,V>- Parameters:
key- Key.val- Value.filter- Optional filter.- Returns:
- Put operation future.
-
putAsync0
public IgniteInternalFuture<Boolean> putAsync0(K key, V val, @Nullable @Nullable CacheEntryPredicate filter)
- Overrides:
putAsync0in classGridCacheAdapter<K,V>- Parameters:
key- Key.val- Value.filter- Optional filter.- Returns:
- Putx operation future.
-
putAll0
protected void putAll0(Map<? extends K,? extends V> m) throws IgniteCheckedException
- Overrides:
putAll0in classGridCacheAdapter<K,V>- Parameters:
m- Map.- Throws:
IgniteCheckedException- If failed.
-
putAllAsync0
public IgniteInternalFuture<?> putAllAsync0(Map<? extends K,? extends V> m)
- Overrides:
putAllAsync0in classGridCacheAdapter<K,V>- Parameters:
m- Map.- Returns:
- Future.
-
putAllConflict
public void putAllConflict(Map<KeyCacheObject,GridCacheDrInfo> conflictMap) throws IgniteCheckedException
Store DR data.- Specified by:
putAllConflictin interfaceIgniteInternalCache<K,V>- Overrides:
putAllConflictin classGridCacheAdapter<K,V>- Parameters:
conflictMap- DR map.- Throws:
IgniteCheckedException- If put operation failed.
-
putAllConflictAsync
public IgniteInternalFuture<?> putAllConflictAsync(Map<KeyCacheObject,GridCacheDrInfo> conflictMap)
Store DR data asynchronously.- Specified by:
putAllConflictAsyncin interfaceIgniteInternalCache<K,V>- Overrides:
putAllConflictAsyncin classGridCacheAdapter<K,V>- Parameters:
conflictMap- DR map.- Returns:
- Future.
-
getAndRemove0
public V getAndRemove0(K key) throws IgniteCheckedException
- Overrides:
getAndRemove0in classGridCacheAdapter<K,V>- Parameters:
key- Key.- Returns:
- Previous value.
- Throws:
IgniteCheckedException- If failed.
-
getAndRemoveAsync0
public IgniteInternalFuture<V> getAndRemoveAsync0(K key)
- Overrides:
getAndRemoveAsync0in classGridCacheAdapter<K,V>- Parameters:
key- Key.- Returns:
- Future.
-
removeAll0
protected void removeAll0(Collection<? extends K> keys) throws IgniteCheckedException
- Overrides:
removeAll0in classGridCacheAdapter<K,V>- Parameters:
keys- Keys.- Throws:
IgniteCheckedException- If failed.
-
removeAllAsync0
public IgniteInternalFuture<Object> removeAllAsync0(Collection<? extends K> keys)
- Overrides:
removeAllAsync0in classGridCacheAdapter<K,V>- Parameters:
keys- Keys.- Returns:
- Future.
-
remove0
protected boolean remove0(K key, CacheEntryPredicate filter) throws IgniteCheckedException
- Overrides:
remove0in classGridCacheAdapter<K,V>- Parameters:
key- Key.filter- Filter.- Returns:
Trueif entry was removed.- Throws:
IgniteCheckedException- If failed.
-
removeAsync0
public IgniteInternalFuture<Boolean> removeAsync0(K key, @Nullable @Nullable CacheEntryPredicate filter)
- Overrides:
removeAsync0in classGridCacheAdapter<K,V>- Parameters:
key- Key.filter- Filter.- Returns:
- Future.
-
removeAllConflict
public void removeAllConflict(Map<KeyCacheObject,GridCacheVersion> conflictMap) throws IgniteCheckedException
Removes DR data.- Specified by:
removeAllConflictin interfaceIgniteInternalCache<K,V>- Overrides:
removeAllConflictin classGridCacheAdapter<K,V>- Parameters:
conflictMap- DR map.- Throws:
IgniteCheckedException- If remove failed.
-
removeAllConflictAsync
public IgniteInternalFuture<?> removeAllConflictAsync(Map<KeyCacheObject,GridCacheVersion> conflictMap)
Removes DR data asynchronously.- Specified by:
removeAllConflictAsyncin interfaceIgniteInternalCache<K,V>- Overrides:
removeAllConflictAsyncin classGridCacheAdapter<K,V>- Parameters:
conflictMap- DR map.- Returns:
- Future.
-
lockAllAsync
protected IgniteInternalFuture<Boolean> lockAllAsync(Collection<KeyCacheObject> keys, long timeout, @Nullable @Nullable IgniteTxLocalEx tx, boolean isInvalidate, boolean isRead, boolean retval, @Nullable @Nullable TransactionIsolation isolation, long createTtl, long accessTtl)
- Specified by:
lockAllAsyncin classGridDistributedCacheAdapter<K,V>- Parameters:
keys- Keys to lock.timeout- Timeout.tx- TransactionisInvalidate- Invalidation flag.isRead- Indicates whether value is read or written.retval- Flag to return value.isolation- Transaction isolation.createTtl- TTL for create operation.accessTtl- TTL for read operation.- Returns:
- Future for locks.
-
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>- Overrides:
invokein classGridCacheAdapter<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>- Overrides:
invokeAllin classGridCacheAdapter<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)
- Specified by:
invokeAsyncin interfaceIgniteInternalCache<K,V>- Overrides:
invokeAsyncin classGridCacheAdapter<K,V>- Parameters:
key- Key.entryProcessor- Entry processor.args- Arguments.- Returns:
- Future.
-
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>- Overrides:
invokeAllAsyncin classGridCacheAdapter<K,V>- Parameters:
keys- Keys.entryProcessor- Entry processor.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>- Overrides:
invokeAllin classGridCacheAdapter<K,V>- Parameters:
map- Map containing keys and entry processors to be applied to values.args- Arguments.- Returns:
- Invoke results.
- Throws:
IgniteCheckedException- If failed.
-
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>- Overrides:
invokeAllAsyncin classGridCacheAdapter<K,V>- Parameters:
map- Map containing keys and entry processors to be applied to values.args- Arguments.- Returns:
- Future.
-
toString
public String toString()
- Overrides:
toStringin classGridDhtCacheAdapter<K,V>
-
-