org.apache.ignite.internal.processors.cache.distributed.dht

## Class GridDhtTransactionalCacheAdapter<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.GridDhtTransactionalCacheAdapter<K,V>

All Implemented Interfaces:
  Externalizable, Serializable, Iterable<javax.cache.Cache.Entry<K,V>>, IgniteInternalCache<K,V>

Direct Known Subclasses:
  GridDhtCache, GridDhtColocatedCache

    public abstract class GridDhtTransactionalCacheAdapter<K,V>
    extends GridDhtCacheAdapter<K,V>

Base class for transactional DHT caches.

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

`GridCacheAdapter.AsyncOp<T>, GridCacheAdapter.CacheExpiryPolicy, GridCacheAdapter.FutureHolder, GridCacheAdapter.InvokeAllTimeStatClosure<T>, GridCacheAdapter.PeekModes, GridCacheAdapter.TopologyVersionAwareJob, GridCacheAdapter.UpdateGetTimeStatClosure<T>, GridCacheAdapter.UpdatePutAndGetTimeStatClosure<T>, GridCacheAdapter.UpdatePutTimeStatClosure<T>, GridCacheAdapter.UpdateRemoveTimeStatClosure<T>, GridCacheAdapter.UpdateTimeStatClosure<T>`

### Field Summary

### Fields inherited from class org.apache.ignite.internal.processors.cache.GridCacheAdapter

`cacheCfg, CLEAR_ALL_SPLIT_THRESHOLD, ctx, DFLT_START_CACHE_SIZE, keyCheck, lastFut, locNodeId, log, map, MAX_RETRIES, metrics, RET2NULL, txLockMsgLog`

### Constructor Summary

Constructors
`protected` `GridDhtTransactionalCacheAdapter()` Empty constructor required for `Externalizable`.
`protected` `GridDhtTransactionalCacheAdapter(GridCacheContext<K,V> ctx)`
`protected` `GridDhtTransactionalCacheAdapter(GridCacheContext<K,V> ctx, GridCacheConcurrentMap map)` Constructor used for near-only cache.

### Method Summary

All Methods Instance Methods Abstract Methods Concrete Methods
`GridDhtTxLocal` `initTxTopologyVersion(UUID nodeId, ClusterNode nearNode, GridCacheVersion nearLockVer, IgniteUuid nearFutId, int nearMiniId, boolean firstClientReq, AffinityTopologyVersion topVer, long nearThreadId, long timeout, UUID txSubjectId, int txTaskNameHash)`
`IgniteInternalFuture<Boolean>` `lockAllAsync(Collection<KeyCacheObject> keys, long timeout, IgniteTxLocalEx txx, boolean isInvalidate, boolean isRead, boolean retval, TransactionIsolation isolation, long createTtl, long accessTtl)`
`IgniteInternalFuture<GridNearLockResponse>` `lockAllAsync(GridCacheContext<?,?> cacheCtx, ClusterNode nearNode, GridNearLockRequest req, CacheEntryPredicate[] filter0)`
`GridDhtFuture<Boolean>` `lockAllAsyncInternal(Collection<KeyCacheObject> keys, long timeout, IgniteTxLocalEx txx, boolean isInvalidate, boolean isRead, boolean retval, TransactionIsolation isolation, long createTtl, long accessTtl, CacheEntryPredicate[] filter, boolean skipStore, boolean keepBinary)` Acquires locks in partitioned cache.
`abstract GridNearTransactionalCache<K,V>` `near()`
`void` `removeLocks(UUID nodeId, GridCacheVersion ver, Iterable<KeyCacheObject> keys, boolean unmap)`
`void` `start()` Starts this cache.

### Methods inherited from class org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtCacheAdapter

`addFuture, beginMultiUpdate, createEntry, dumpDebugInfo, endMultiUpdate, entryEx, entryExx, entryExx, getAllAsync, getDhtAsync, localEntriesIterator, localLoad, localLoadCache, multiUpdateFinishFuture, multiUpdateTopologyFuture, needRemap, onDeferredDelete, onKernalStop, peekExx, preloader, primarySize, primarySizeLong, printMemoryStats, processForceKeyResponse, processForceKeysRequest, processNearGetRequest, processNearGetResponse, processNearSingleGetRequest, processNearSingleGetResponse, removeFuture, sendTtlUpdateRequest, size, sizeLong, splitClearLocally, topology, toString, 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, awaitLastFut, cache, checkJta, clear, clear, clearAll, clearAllAsync, clearAsync, clearAsync, clearLocally, clearLocally, clearLocally, clearLocallyAll, clusterMetrics, clusterMetrics, clusterMxBean, configuration, containsKey, containsKeyAsync, containsKeys, containsKeysAsync, context, decrementSize, entries, entryEx, entryEx, entrySet, entrySet, evict, evictAll, expiry, expiryPolicy, forceKeyCheck, forSubjectId, get, get, get0, getAll, getAll0, getAllAsync, getAllAsync, getAllAsync, getAllAsync0, getAllOutTx, getAllOutTxAsync, getAndPut, getAndPut, getAndPut0, getAndPutAsync, getAndPutAsync, getAndPutAsync0, getAndPutIfAbsent, getAndPutIfAbsentAsync, getAndRemove, getAndRemove0, getAndRemoveAsync, getAndRemoveAsync0, getAndReplace, getAndReplaceAsync, getAsync, getAsync, getAsync, getEntries, getEntriesAsync, getEntry, getEntryAsync, getForcePrimary, getForcePrimaryAsync, igfsDataSpaceUsed, igniteIterator, igniteIterator, incrementSize, init, invoke, invoke, invokeAll, invokeAll, invokeAllAsync, invokeAllAsync, invokeAsync, isColocated, isDht, isDhtAtomic, isEmpty, isIgfsDataCache, isLocal, isLocked, isLockedByThread, isNear, iterator, iterator, keepBinary, keySet, loadAll, localEntries, localLoadCacheAsync, localMetrics, localMxBean, localPeek, localSize, lock, lockAll, lockAsync, log, lostPartitions, map, metrics0, name, nearSize, offHeapAllocatedSize, offHeapEntriesCount, onIgfsDataSizeChanged, onKernalStart, onReconnected, onUndeploy, parsePeekModes, peekEx, peekEx, 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, replace, replace, replaceAsync, replaceAsync, saveFuture, scanIterator, setSkipStore, size, sizeAsync, sizeLong, sizeLong, sizeLongAsync, sizeLongAsync, skipStore, startInfo, stop, stopInfo, tx, txStart, txStart, txStartEx, unlock, validateCacheKey, validateCacheKeys, withAllowAtomicOpsInTx, 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

#### GridDhtTransactionalCacheAdapter

    protected GridDhtTransactionalCacheAdapter()

Empty constructor required for `Externalizable`.

#### GridDhtTransactionalCacheAdapter

    protected GridDhtTransactionalCacheAdapter(GridCacheContext<K,V> ctx)

Parameters:
  `ctx` - Context.

#### GridDhtTransactionalCacheAdapter

    protected GridDhtTransactionalCacheAdapter(GridCacheContext<K,V> ctx,
                                               GridCacheConcurrentMap map)

Constructor used for near-only cache.

Parameters:
  `ctx` - Cache context.
  `map` - Cache map.

### Method Detail

#### start

    public void start()
               throws IgniteCheckedException

Starts this cache. Child classes should override this method to provide custom start-up behavior.

Overrides:
  `start` in class `GridDhtCacheAdapter<K,V>`
Throws:
  `IgniteCheckedException` - If start failed.

#### near

    public abstract GridNearTransactionalCache<K,V> near()

Specified by:
  `near` in class `GridDhtCacheAdapter<K,V>`
Returns:
  Near cache.

#### lockAllAsync

    public IgniteInternalFuture<Boolean> lockAllAsync(@Nullable
                                                      Collection<KeyCacheObject> keys,
                                                      long timeout,
                                                      IgniteTxLocalEx txx,
                                                      boolean isInvalidate,
                                                      boolean isRead,
                                                      boolean retval,
                                                      TransactionIsolation isolation,
                                                      long createTtl,
                                                      long accessTtl)

Specified by:
  `lockAllAsync` in class `GridDistributedCacheAdapter<K,V>`
Parameters:
  `keys` - Keys to lock.
  `timeout` - Timeout.
  `txx` - Transaction
  `isInvalidate` - 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.

#### lockAllAsyncInternal

    public GridDhtFuture<Boolean> lockAllAsyncInternal(@Nullable
                                                       Collection<KeyCacheObject> keys,
                                                       long timeout,
                                                       IgniteTxLocalEx txx,
                                                       boolean isInvalidate,
                                                       boolean isRead,
                                                       boolean retval,
                                                       TransactionIsolation isolation,
                                                       long createTtl,
                                                       long accessTtl,
                                                       CacheEntryPredicate[] filter,
                                                       boolean skipStore,
                                                       boolean keepBinary)

Acquires locks in partitioned cache.

Parameters:
  `keys` - Keys to lock.
  `timeout` - Lock timeout.
  `txx` - Transaction.
  `isInvalidate` - Invalidate flag.
  `isRead` - Read flag.
  `retval` - Return value flag.
  `isolation` - Transaction isolation.
  `createTtl` - TTL for create operation.
  `accessTtl` - TTL for read operation.
  `filter` - Optional filter.
  `skipStore` - Skip store flag.
Returns:
  Lock future.

#### lockAllAsync

    public IgniteInternalFuture<GridNearLockResponse> lockAllAsync(GridCacheContext<?,?> cacheCtx,
                                                                   ClusterNode nearNode,
                                                                   GridNearLockRequest req,
                                                                   @Nullable
                                                                   CacheEntryPredicate[] filter0)

Parameters:
  `cacheCtx` - Cache context.
  `nearNode` - Near node.
  `req` - Request.
  `filter0` - Filter.
Returns:
  Future.

#### removeLocks

    public void removeLocks(UUID nodeId,
                            GridCacheVersion ver,
                            Iterable<KeyCacheObject> keys,
                            boolean unmap)

Parameters:
  `nodeId` - Node ID.
  `ver` - Version.
  `keys` - Keys.
  `unmap` - Flag for un-mapping version.

#### initTxTopologyVersion

    public GridDhtTxLocal initTxTopologyVersion(UUID nodeId,
                                                ClusterNode nearNode,
                                                GridCacheVersion nearLockVer,
                                                IgniteUuid nearFutId,
                                                int nearMiniId,
                                                boolean firstClientReq,
                                                AffinityTopologyVersion topVer,
                                                long nearThreadId,
                                                long timeout,
                                                UUID txSubjectId,
                                                int txTaskNameHash)
                                         throws IgniteException,
                                                IgniteCheckedException

Parameters:
  `nodeId` - Near node id.
  `nearNode` - Near node.
  `nearLockVer` - Near lock version.
  `nearFutId` - Near future id.
  `nearMiniId` - Near mini-future id.
  `firstClientReq` - First client request flag.
  `topVer` - Topology version.
  `nearThreadId` - Near node thread id.
  `timeout` - Timeout.
  `txSubjectId` - Transaction subject id.
  `txTaskNameHash` - Transaction task name hash.
Returns:
  Transaction.
Throws:
  `IgniteException`
  `IgniteCheckedException`

2018 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.7.5
Release Date | : June 4 2019