public class GridNearAtomicCache<K,V> extends GridNearCacheAdapter<K,V>
GridCacheAdapter.AsyncOp<T>, GridCacheAdapter.CacheExpiryPolicy, GridCacheAdapter.FutureHolder, GridCacheAdapter.PeekModes, GridCacheAdapter.TopologyVersionAwareJob, GridCacheAdapter.UpdateGetTimeStatClosure<T>, GridCacheAdapter.UpdatePutAndGetTimeStatClosure<T>, GridCacheAdapter.UpdatePutTimeStatClosure<T>, GridCacheAdapter.UpdateRemoveTimeStatClosure<T>, GridCacheAdapter.UpdateTimeStatClosure<T>
cacheCfg, CLEAR_ALL_SPLIT_THRESHOLD, ctx, DFLT_START_CACHE_SIZE, keyCheck, lastFut, locNodeId, log, map, MAX_RETRIES, metrics, RET2NULL, txLockMsgLog
Constructor and Description |
---|
GridNearAtomicCache()
Empty constructor required for
Externalizable . |
GridNearAtomicCache(GridCacheContext<K,V> ctx) |
Modifier and Type | Method and Description |
---|---|
GridDhtCacheAdapter<K,V> |
dht() |
void |
dht(GridDhtAtomicCache<K,V> dht) |
protected IgniteInternalFuture<Map<K,V>> |
getAllAsync(Collection<? extends K> keys,
boolean forcePrimary,
boolean skipTx,
UUID subjId,
String taskName,
boolean deserializeBinary,
boolean recovery,
boolean skipVals,
boolean canRemap,
boolean needVer) |
V |
getAndPut(K key,
V val,
CacheEntryPredicate filter) |
IgniteInternalFuture<V> |
getAndPutAsync0(K key,
V val,
CacheEntryPredicate filter) |
V |
getAndRemove(K key)
Removes given key mapping from cache.
|
IgniteInternalFuture<V> |
getAndRemoveAsync(K key)
Asynchronously removes given key mapping from cache.
|
<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) |
protected IgniteInternalFuture<Boolean> |
lockAllAsync(Collection<KeyCacheObject> keys,
long timeout,
IgniteTxLocalEx tx,
boolean isInvalidate,
boolean isRead,
boolean retval,
TransactionIsolation isolation,
long createTtl,
long accessTtl) |
void |
onDeferredDelete(GridCacheEntryEx entry,
GridCacheVersion ver) |
List<KeyCacheObject> |
processDhtAtomicUpdateRequest(UUID nodeId,
GridDhtAtomicAbstractUpdateRequest req,
GridDhtAtomicNearResponse res) |
void |
processNearAtomicUpdateResponse(GridNearAtomicAbstractUpdateRequest req,
GridNearAtomicUpdateResponse res) |
boolean |
put(K key,
V val,
CacheEntryPredicate filter) |
void |
putAll(Map<? extends K,? extends V> m)
Stores given key-value pairs in cache.
|
IgniteInternalFuture<?> |
putAllAsync(Map<? extends K,? extends V> m)
Asynchronously stores given key-value pairs in cache.
|
void |
putAllConflict(Map<KeyCacheObject,GridCacheDrInfo> drMap)
Store DR data.
|
IgniteInternalFuture<?> |
putAllConflictAsync(Map<KeyCacheObject,GridCacheDrInfo> drMap)
Store DR data asynchronously.
|
IgniteInternalFuture<Boolean> |
putAsync0(K key,
V val,
CacheEntryPredicate filter) |
boolean |
remove(K key)
Removes given key mapping from cache.
|
boolean |
remove(K key,
CacheEntryPredicate filter) |
void |
removeAll()
Removes mappings from cache.
|
void |
removeAll(Collection<? extends K> keys)
Removes given key mappings from cache.
|
IgniteInternalFuture<?> |
removeAllAsync() |
IgniteInternalFuture<?> |
removeAllAsync(Collection<? extends K> keys)
Asynchronously removes given key mappings from cache for entries.
|
void |
removeAllConflict(Map<KeyCacheObject,GridCacheVersion> drMap)
Removes DR data.
|
IgniteInternalFuture<?> |
removeAllConflictAsync(Map<KeyCacheObject,GridCacheVersion> drMap)
Removes DR data asynchronously.
|
IgniteInternalFuture<Boolean> |
removeAsync(K key,
CacheEntryPredicate filter) |
void |
start()
Starts this cache.
|
void |
unlockAll(Collection<? extends K> keys)
Unlocks given keys only if current thread owns the locks.
|
clearLocally, clearLocallyAll, entryEx, entryExx, entryFactory, entrySet, entrySet, evict, evictAll, forceKeyCheck, igfsDataSpaceUsed, isAllLockedNearOnly, isIgfsDataCache, isLocked, isLockedNearOnly, isMongoDataCache, isMongoMetaCache, isNear, loadAsync, localLoad, localLoadCache, localLoadCacheAsync, nearEntries, nearKeySet, nearSize, offHeapAllocatedSize, offHeapEntriesCount, onIgfsDataSizeChanged, onReconnected, peekExx, preloader, primarySize, primarySizeLong, processGetResponse, size, sizeLong, splitClearLocally, toString, values
localSizeLong, localSizeLong, lockAllAsync, removeVersionedEntry, txLockAsync
affinity, allEntries, asyncOp, asyncOpAcquire, asyncOpRelease, awaitLastFut, cache, checkJta, clear, clear, clearAll, clearAllAsync, clearAsync, clearAsync, clearLocally, clearLocally, clusterMetrics, clusterMetrics, clusterMxBean, configuration, containsKey, containsKeyAsync, containsKeys, containsKeysAsync, context, decrementSize, entries, entryEx, entryEx, entrySet, entrySetx, expiry, expiryPolicy, forSubjectId, get, get, get0, getAll, getAll0, getAllAsync, getAllAsync, getAllAsync, getAllAsync0, getAllOutTx, getAllOutTxAsync, getAndPut, getAndPut0, getAndPutAsync, getAndPutAsync, getAndPutIfAbsent, getAndPutIfAbsentAsync, getAndRemove0, getAndRemoveAsync0, getAndReplace, getAndReplaceAsync, getAsync, getAsync, getAsync, getEntries, getEntriesAsync, getEntry, getEntryAsync, getForcePrimary, getForcePrimaryAsync, getTopologySafe, igniteIterator, igniteIterator, incrementSize, init, invoke, isColocated, isDht, isDhtAtomic, isEmpty, isLocal, isLockedByThread, iterator, iterator, keepBinary, keySet, keySetx, loadAll, localEntries, localMetrics, localMxBean, localPeek, localSize, lock, lockAll, lockAsync, log, lostPartitions, map, metrics0, name, onKernalStart, onKernalStop, onUndeploy, parsePeekModes, peekEx, peekEx, primaryKeySet, printMemoryStats, put, put0, putAll0, putAllAsync0, putAsync, putAsync, putIfAbsent, putIfAbsentAsync, readExternal, readResolve, rebalance, remove, remove0, removeAll0, removeAllAsync0, removeAsync, removeAsync, removeAsync0, removeEntry, removeIfObsolete, replace, replace, replaceAsync, replaceAsync, saveFuture, scanIterator, setSkipStore, size, sizeAsync, sizeLong, sizeLong, sizeLongAsync, sizeLongAsync, skipStore, startInfo, stop, stopInfo, tx, txStart, txStart, txStartEx, unlock, validateCacheKey, validateCacheKeys, values, withExpiryPolicy, withNoRetries, writeExternal
public GridNearAtomicCache()
Externalizable
.public GridNearAtomicCache(GridCacheContext<K,V> ctx)
ctx
- Context.public void start() throws IgniteCheckedException
start
in class GridCacheAdapter<K,V>
IgniteCheckedException
- If start failed.public void dht(GridDhtAtomicCache<K,V> dht)
dht
- DHT cache.public GridDhtCacheAdapter<K,V> dht()
dht
in class GridNearCacheAdapter<K,V>
public void processNearAtomicUpdateResponse(GridNearAtomicAbstractUpdateRequest req, GridNearAtomicUpdateResponse res)
req
- Update request.res
- Update response.@Nullable public List<KeyCacheObject> processDhtAtomicUpdateRequest(UUID nodeId, GridDhtAtomicAbstractUpdateRequest req, GridDhtAtomicNearResponse res)
nodeId
- Sender node ID.req
- Dht atomic update request.res
- Dht atomic update response.protected IgniteInternalFuture<Map<K,V>> getAllAsync(@Nullable Collection<? extends K> keys, boolean forcePrimary, boolean skipTx, @Nullable UUID subjId, String taskName, boolean deserializeBinary, boolean recovery, boolean skipVals, boolean canRemap, boolean needVer)
getAllAsync
in class GridCacheAdapter<K,V>
keys
- Keys.forcePrimary
- Force primary.skipTx
- Skip tx.subjId
- Subj Id.taskName
- Task name.deserializeBinary
- Deserialize binary.recovery
- Recovery mode flag.skipVals
- Skip values.canRemap
- Can remap flag.needVer
- Need version.GridCacheAdapter.getAllAsync(Collection)
public V getAndPut(K key, V val, @Nullable CacheEntryPredicate filter) throws IgniteCheckedException
getAndPut
in class GridCacheAdapter<K,V>
key
- Key.val
- Value.filter
- Optional filter.IgniteCheckedException
- If failed.public boolean put(K key, V val, CacheEntryPredicate filter) throws IgniteCheckedException
put
in class GridCacheAdapter<K,V>
key
- Key.val
- Value.filter
- Filter.True
if optional filter passed and value was stored in cache,
false
otherwise. Note that this method will return true
if filter is not
specified.IgniteCheckedException
- If put operation failed.public IgniteInternalFuture<V> getAndPutAsync0(K key, V val, @Nullable CacheEntryPredicate filter)
getAndPutAsync0
in class GridCacheAdapter<K,V>
key
- Key.val
- Value.filter
- Optional filter.public IgniteInternalFuture<Boolean> putAsync0(K key, V val, @Nullable CacheEntryPredicate filter)
putAsync0
in class GridCacheAdapter<K,V>
key
- Key.val
- Value.filter
- Optional filter.public void putAll(Map<? extends K,? extends V> m) throws IgniteCheckedException
If write-through is enabled, the stored values will be persisted to CacheStore
via CacheStore#putAll(Transaction, Map)
method.
putAll
in interface IgniteInternalCache<K,V>
putAll
in class GridCacheAdapter<K,V>
m
- Key-value pairs to store in cache.IgniteCheckedException
- If put operation failed.public IgniteInternalFuture<?> putAllAsync(Map<? extends K,? extends V> m)
If write-through is enabled, the stored values will be persisted to CacheStore
via CacheStore#putAll(Transaction, Map)
method.
putAllAsync
in interface IgniteInternalCache<K,V>
putAllAsync
in class GridCacheAdapter<K,V>
m
- Key-value pairs to store in cache.public void putAllConflict(Map<KeyCacheObject,GridCacheDrInfo> drMap) throws IgniteCheckedException
putAllConflict
in interface IgniteInternalCache<K,V>
putAllConflict
in class GridCacheAdapter<K,V>
drMap
- DR map.IgniteCheckedException
- If put operation failed.public IgniteInternalFuture<?> putAllConflictAsync(Map<KeyCacheObject,GridCacheDrInfo> drMap) throws IgniteCheckedException
putAllConflictAsync
in interface IgniteInternalCache<K,V>
putAllConflictAsync
in class GridCacheAdapter<K,V>
drMap
- DR map.IgniteCheckedException
- If put operation failed.public <T> javax.cache.processor.EntryProcessorResult<T> invoke(K key, javax.cache.processor.EntryProcessor<K,V,T> entryProcessor, Object... args) throws IgniteCheckedException
invoke
in interface IgniteInternalCache<K,V>
invoke
in class GridCacheAdapter<K,V>
key
- Key.entryProcessor
- Entry processor.args
- Arguments.IgniteCheckedException
- If failed.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
invokeAll
in interface IgniteInternalCache<K,V>
invokeAll
in class GridCacheAdapter<K,V>
keys
- Keys.entryProcessor
- Entry processor.args
- Arguments.IgniteCheckedException
- If failed.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)
invokeAllAsync
in interface IgniteInternalCache<K,V>
invokeAllAsync
in class GridCacheAdapter<K,V>
map
- Map containing keys and entry processors to be applied to values.args
- Arguments.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
invokeAsync
in interface IgniteInternalCache<K,V>
invokeAsync
in class GridCacheAdapter<K,V>
key
- Key.entryProcessor
- Entry processor.args
- Arguments.javax.cache.processor.EntryProcessorException
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
invokeAll
in interface IgniteInternalCache<K,V>
invokeAll
in class GridCacheAdapter<K,V>
map
- Map containing keys and entry processors to be applied to values.args
- Arguments.IgniteCheckedException
- If failed.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)
invokeAllAsync
in interface IgniteInternalCache<K,V>
invokeAllAsync
in class GridCacheAdapter<K,V>
keys
- Keys.entryProcessor
- Entry processor.args
- Arguments.public boolean remove(K key, @Nullable CacheEntryPredicate filter) throws IgniteCheckedException
remove
in class GridCacheAdapter<K,V>
key
- Key.filter
- Filter.True
if entry was removed.IgniteCheckedException
- If failed.public V getAndRemove(K key) throws IgniteCheckedException
CacheMode.PARTITIONED
or CacheMode.REPLICATED
caches, the value will be loaded from the primary node, which in its turn may load the value
from the disk-based swap storage, and consecutively, if it's not in swap,
from the underlying persistent storage. If value has to be loaded from persistent
storage, 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 CacheStore
via CacheStore#remove(Transaction, Object)
method.
getAndRemove
in interface IgniteInternalCache<K,V>
getAndRemove
in class GridCacheAdapter<K,V>
key
- Key whose mapping is to be removed from cache.null
if there was no value for this key.IgniteCheckedException
- If remove operation failed.public IgniteInternalFuture<V> getAndRemoveAsync(K key)
CacheMode.PARTITIONED
or CacheMode.REPLICATED
caches, the value will be loaded from the primary node, which in its turn may load the value
from the swap storage, and consecutively, if it's not in swap,
from the underlying persistent storage. If value has to be loaded from persistent
storage, 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 CacheStore
via CacheStore#remove(Transaction, Object)
method.
getAndRemoveAsync
in interface IgniteInternalCache<K,V>
getAndRemoveAsync
in class GridCacheAdapter<K,V>
key
- Key whose mapping is to be removed from cache.public void removeAll(Collection<? extends K> keys) throws IgniteCheckedException
If write-through is enabled, the values will be removed from CacheStore
via IgniteDataStreamer
.
removeAll
in interface IgniteInternalCache<K,V>
removeAll
in class GridCacheAdapter<K,V>
keys
- Keys whose mappings are to be removed from cache.IgniteCheckedException
- If remove failed.public IgniteInternalFuture<?> removeAllAsync(Collection<? extends K> keys)
If write-through is enabled, the values will be removed from CacheStore
via IgniteDataStreamer
.
removeAllAsync
in interface IgniteInternalCache<K,V>
removeAllAsync
in class GridCacheAdapter<K,V>
keys
- Keys whose mappings are to be removed from cache.public boolean remove(K key) throws IgniteCheckedException
This method will return true
if remove did occur, which means that all optionally
provided filters have passed and there was something to remove, false
otherwise.
If write-through is enabled, the value will be removed from CacheStore
via CacheStore#remove(Transaction, Object)
method.
remove
in interface IgniteInternalCache<K,V>
remove
in class GridCacheAdapter<K,V>
key
- Key whose mapping is to be removed from cache.True
if filter passed validation and entry was removed, false
otherwise.
Note that if filter is not specified, this method will return true
.IgniteCheckedException
- If remove failed.public IgniteInternalFuture<Boolean> removeAsync(K key, @Nullable CacheEntryPredicate filter)
removeAsync
in class GridCacheAdapter<K,V>
key
- Key to remove.filter
- Optional filter.public void removeAll() throws IgniteCheckedException
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 CacheStore
via IgniteDataStreamer
.
removeAll
in interface IgniteInternalCache<K,V>
removeAll
in class GridDistributedCacheAdapter<K,V>
IgniteCheckedException
- If remove failed.public IgniteInternalFuture<?> removeAllAsync()
removeAllAsync
in interface IgniteInternalCache<K,V>
removeAllAsync
in class GridDistributedCacheAdapter<K,V>
public void removeAllConflict(Map<KeyCacheObject,GridCacheVersion> drMap) throws IgniteCheckedException
removeAllConflict
in interface IgniteInternalCache<K,V>
removeAllConflict
in class GridCacheAdapter<K,V>
drMap
- DR map.IgniteCheckedException
- If remove failed.public IgniteInternalFuture<?> removeAllConflictAsync(Map<KeyCacheObject,GridCacheVersion> drMap) throws IgniteCheckedException
removeAllConflictAsync
in interface IgniteInternalCache<K,V>
removeAllConflictAsync
in class GridCacheAdapter<K,V>
drMap
- DR map.IgniteCheckedException
- If remove failed.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)
lockAllAsync
in class GridDistributedCacheAdapter<K,V>
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.public void unlockAll(@Nullable Collection<? extends K> keys) throws IgniteCheckedException
TransactionConcurrency.PESSIMISTIC
concurrency control for transaction
which will acquire explicit locks for relevant cache operations.keys
- Keys to unlock.IgniteCheckedException
- If unlock execution resulted in error.public void onDeferredDelete(GridCacheEntryEx entry, GridCacheVersion ver)
onDeferredDelete
in class GridCacheAdapter<K,V>
entry
- Entry.ver
- Version.
Follow @ApacheIgnite
Ignite Fabric : ver. 2.0.0 Release Date : April 30 2017