Class GridNearTransactionalCache<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.near.GridNearCacheAdapter<K,V>
-
- org.apache.ignite.internal.processors.cache.distributed.near.GridNearTransactionalCache<K,V>
-
- All Implemented Interfaces:
Externalizable,Serializable,Iterable<javax.cache.Cache.Entry<K,V>>,IgniteInternalCache<K,V>
public class GridNearTransactionalCache<K,V> extends GridNearCacheAdapter<K,V>
Near cache for transactional cache.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
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 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 GridNearTransactionalCache()Empty constructor required forExternalizable.GridNearTransactionalCache(GridCacheContext<K,V> ctx)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearLocks(UUID nodeId, GridDhtUnlockRequest req)GridDhtCache<K,V>dht()voiddht(GridDhtCache<K,V> dht)protected booleanevictNearEntry(GridCacheEntryEx e, GridCacheVersion obsoleteVer, AffinityTopologyVersion topVer)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 booleanisNearLocallyMapped(GridCacheEntryEx e, AffinityTopologyVersion topVer)protected IgniteInternalFuture<Boolean>lockAllAsync(Collection<KeyCacheObject> keys, long timeout, IgniteTxLocalEx tx, boolean isInvalidate, boolean isRead, boolean retval, TransactionIsolation isolation, long createTtl, long accessTtl)voidonDeferredDelete(GridCacheEntryEx entry, GridCacheVersion ver)voidonKernalStart()Kernal start callback.voidremoveLocks(GridCacheVersion ver, Collection<KeyCacheObject> keys)Removes locks regardless of whether they are owned or not for given version and keys.StringtoString()voidunlockAll(Collection<? extends K> keys)Unlocks given keys only if current thread owns the locks.-
Methods inherited from class org.apache.ignite.internal.processors.cache.distributed.near.GridNearCacheAdapter
clearLocally, clearLocallyAll, entryEx, entryExx, entrySet, evict, evictAll, isAllLockedNearOnly, isLocked, isLockedNearOnly, isNear, loadAsync, localLoad, localLoadCache, localLoadCacheAsync, nearEntries, nearSize, offHeapAllocatedSize, offHeapEntriesCount, onReconnected, peekExx, preloader, primarySize, primarySizeLong, processGetResponse, size, sizeLong, splitClearLocally, start
-
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, checkJta, clear, clear, clearAll, clearAllAsync, clearAsync, clearAsync, clearLocally, clearLocally, clusterMetrics, clusterMetrics, configuration, containsKey, containsKeyAsync, containsKeys, containsKeysAsync, context, decrementSize, entries, entryEx, entryEx, entrySet, expiry, expiryPolicy, get, get, getAll, getAll, getAllAsync, getAllOutTx, getAllOutTxAsync, getAndPut, getAndPut, getAndPut0, getAndPutAsync, getAndPutAsync, getAndPutAsync0, getAndPutIfAbsent, getAndPutIfAbsentAsync, getAndRemove, getAndRemove0, getAndRemoveAsync, getAndRemoveAsync0, getAndReplace, getAndReplaceAsync, getAsync, getAsync, getEntries, getEntriesAsync, getEntry, getEntryAsync, getForcePrimary, getForcePrimaryAsync, igniteIterator, igniteIterator, incrementSize, init, invoke, invoke, invokeAll, invokeAll, invokeAllAsync, invokeAllAsync, invokeAsync, isColocated, isDht, isDhtAtomic, isEmpty, isLocal, isLockedByThread, iterator, iterator, keepBinary, keySet, lastAsyncFuture, loadAll, localEntries, localMetrics, localPeek, localPreloadPartition, localSize, lock, lockAll, lockAsync, log, lostPartitions, map, metrics0, name, nextVersion, nextVersion, onKernalStop, onUndeploy, parsePeekModes, peekEx, peekEx, preloadPartition, preloadPartitionAsync, printMemoryStats, put, put, put0, putAll, putAll0, putAllAsync, putAllAsync0, putAllConflict, putAllConflictAsync, putAsync, putAsync, putAsync0, putIfAbsent, putIfAbsentAsync, readExternal, readResolve, rebalance, remove, remove, remove, remove0, removeAll, removeAll0, removeAllAsync, removeAllAsync0, removeAllConflict, removeAllConflictAsync, removeAsync, removeAsync, removeAsync, removeAsync0, 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
-
GridNearTransactionalCache
public GridNearTransactionalCache()
Empty constructor required forExternalizable.
-
GridNearTransactionalCache
public GridNearTransactionalCache(GridCacheContext<K,V> ctx)
- Parameters:
ctx- Context.
-
-
Method Detail
-
onKernalStart
public void onKernalStart() throws IgniteCheckedExceptionKernal start callback.- Overrides:
onKernalStartin classGridCacheAdapter<K,V>- Throws:
IgniteCheckedException- If callback failed.
-
dht
public void dht(GridDhtCache<K,V> dht)
- Parameters:
dht- DHT cache.
-
dht
public GridDhtCache<K,V> dht()
- Specified by:
dhtin classGridNearCacheAdapter<K,V>- Returns:
- DHT cache.
-
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)
- Specified by:
getAllAsyncin classGridCacheAdapter<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)
-
clearLocks
public void clearLocks(UUID nodeId, GridDhtUnlockRequest req)
- Parameters:
nodeId- Node ID.req- Request.
-
lockAllAsync
protected IgniteInternalFuture<Boolean> lockAllAsync(Collection<KeyCacheObject> keys, long timeout, IgniteTxLocalEx tx, boolean isInvalidate, boolean isRead, boolean retval, 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.
-
isNearLocallyMapped
protected boolean isNearLocallyMapped(GridCacheEntryEx e, AffinityTopologyVersion topVer)
- Parameters:
e- Transaction entry.topVer- Topology version.- Returns:
Trueif entry is locally mapped as a primary or back up node.
-
evictNearEntry
protected boolean evictNearEntry(GridCacheEntryEx e, GridCacheVersion obsoleteVer, AffinityTopologyVersion topVer)
- Parameters:
e- Entry to evict if it qualifies for eviction.obsoleteVer- Obsolete version.topVer- Topology version.- Returns:
Trueif attempt was made to evict the entry.
-
unlockAll
public void unlockAll(Collection<? extends K> keys)
Unlocks given keys only if current thread owns the locks. Only the keys that have been locked by calling thread and pass through the filter (if any) will be unlocked. If none of the key locks is owned 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.- Parameters:
keys- Keys to unlock.
-
removeLocks
public void removeLocks(GridCacheVersion ver, Collection<KeyCacheObject> keys)
Removes locks regardless of whether they are owned or not for given version and keys.- Parameters:
ver- Lock version.keys- Keys.
-
onDeferredDelete
public void onDeferredDelete(GridCacheEntryEx entry, GridCacheVersion ver)
- Specified by:
onDeferredDeletein classGridCacheAdapter<K,V>- Parameters:
entry- Entry.ver- Version.
-
toString
public String toString()
- Overrides:
toStringin classGridNearCacheAdapter<K,V>
-
-