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>>, GridCache<K,V>, CacheProjection<K,V>, GridCacheProjectionEx<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.GridCacheAdapter

`GridCacheAdapter.AsyncOp<T>, GridCacheAdapter.CacheExpiryPolicy, GridCacheAdapter.FutureHolder, 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.distributed.dht.GridDhtCacheAdapter

`preldr`

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

`cacheCfg, CLEAR_ALL_SPLIT_THRESHOLD, ctx, gridCfg, keyCheck, lastFut, locNodeId, log, map, metrics, mxBean`

### Constructor Summary

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

### Method Summary

Methods
`IgniteInternalFuture<Boolean>` `lockAllAsync(Collection<? extends K> keys, long timeout, IgniteTxLocalEx<K,V> txx, boolean isInvalidate, boolean isRead, boolean retval, TransactionIsolation isolation, long accessTtl, IgnitePredicate<javax.cache.Cache.Entry<K,V>>[] filter)`
`IgniteInternalFuture<GridNearLockResponse<K,V>>` `lockAllAsync(GridCacheContext<K,V> cacheCtx, ClusterNode nearNode, GridNearLockRequest<K,V> req, IgnitePredicate<javax.cache.Cache.Entry<K,V>>[] filter0)`
`GridDhtFuture<Boolean>` `lockAllAsyncInternal(Collection<? extends K> keys, long timeout, IgniteTxLocalEx<K,V> txx, boolean isInvalidate, boolean isRead, boolean retval, TransactionIsolation isolation, long accessTtl, IgnitePredicate<javax.cache.Cache.Entry<K,V>>[] filter)` Acquires locks in partitioned cache.
`abstract GridNearTransactionalCache<K,V>` `near()`
`protected void` `processDhtLockRequest(UUID nodeId, GridDhtLockRequest<K,V> req)`
`protected void` `processDhtLockRequest0(UUID nodeId, GridDhtLockRequest<K,V> req)`
`protected void` `processDhtUnlockRequest(UUID nodeId, GridDhtUnlockRequest<K,V> req)`
`void` `removeLocks(UUID nodeId, GridCacheVersion ver, Iterable<? extends K> keys, boolean unmap)`
`void` `start()` Starts this cache.

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

`beginMultiUpdate, dhtPreloader, endMultiUpdate, entry, entryEx, entryEx, entryExx, entryExx, entryExx, entrySet, getAllAsync, getDhtAsync, init, loadCache, localEntriesIterator, localLoad, multiUpdateFinishFuture, multiUpdateTopologyFuture, onDeferredDelete, onKernalStart, onKernalStop, peekExx, preloader, primarySize, printMemoryStats, processNearGetRequest, reload, sendTtlUpdateRequest, splitClearLocally, stop, topology, toString, unlockAll`

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

`lockAllAsync, removeAll, removeAllAsync, removeVersionedEntry, txLockAsync`

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

`affinity, allEntries, asyncOp, asyncOpAcquire, asyncOpRelease, awaitLastFut, cache, checkJta, clear, clear, clearAsync, clearLocally, clearLocally, clearLocally, clearLocally0, clearLocally0, commitTxAsync, compact, compact, compactAll, compactAll, configuration, containsKey, containsKeyAsync, containsKeys, containsKeysAsync, containsValue, context, entries, entryEx, entryExSafe, entrySet, entrySet, entrySet, entrySetx, evict, evict, evictAll, evictAll, evictAll, expiry, expiryPolicy, flags, flagsOff, flagsOn, forAll, forceRepartition, forEach, forSubjectId, get, get, get, getAll, getAll, getAllAsync, getAllAsync, getAllAsync, getAllOutTx, getAllOutTxAsync, getAsync, getAsync, getForcePrimary, getForcePrimaryAsync, globalPrimarySize, globalSize, gridProjection, igfsDataSpaceMax, igfsDataSpaceUsed, igniteIterator, invoke, invokeAll, invokeAll, invokeAllAsync, invokeAllAsync, invokeAsync, isColocated, isDht, isDhtAtomic, isEmpty, isIgfsDataCache, isLocal, isLocked, isLockedByThread, isMongoDataCache, isMongoMetaCache, isNear, iterator, iterator, keepPortable, keepPortable0, keySet, keySet, loadAll, loadCacheAsync, localEntries, localPeek, localSize, lock, lockAll, lockAsync, log, map, metrics, metrics0, mxBean, name, nearSize, offHeapAllocatedSize, offHeapEntriesCount, offHeapIterator, onIgfsDataSizeChanged, onUndeploy, overflowSize, peek, peek, peek, peek0, peek0, peek0, peekAll, peekAll0, peekAll0, peekEx, predicate, primaryEntrySet, primaryEntrySet, primaryEntrySetx, primaryKeySet, primaryKeySet, primaryValues, primaryValues, projection, projection, projection, promote, promote, promoteAll, put, put, putAll, putAllAsync, putAllDr, putAllDrAsync, putAsync, putAsync, putIfAbsent, putIfAbsentAsync, putx, putx, putxAsync, putxAsync, putxIfAbsent, putxIfAbsentAsync, queries, randomEntry, readExternal, readResolve, readThroughAllAsync, reloadAll, reloadAll, reloadAll, reloadAllAsync, reloadAllAsync, reloadAllAsync, reloadAsync, remove, remove, remove, removeAll, removeAllAsync, removeAllAsync, removeAllDr, removeAllDrAsync, removeAsync, removeAsync, removeAsync, removeEntry, removeIfObsolete, removex, removex, removex, removexAsync, removexAsync, removexAsync, replace, replace, replaceAsync, replaceAsync, replacex, replacex, replacexAsync, replacexAsync, saveFuture, size, size, sizeAsync, startInfo, stopInfo, swapIterator, swapKeys, swapSize, toMap, tx, txStart, txStart, txStart, txStartEx, txSynchronizations, txSynchronize, txUnsynchronize, unlock, validateCacheKey, validateCacheKeys, values, values, withExpiryPolicy, writeExternal`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

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

#### processDhtLockRequest

    protected final void processDhtLockRequest(UUID nodeId,
                             GridDhtLockRequest<K,V> req)

Parameters:
  `nodeId` - Node ID.
  `req` - Request.

#### processDhtLockRequest0

    protected final void processDhtLockRequest0(UUID nodeId,
                              GridDhtLockRequest<K,V> req)

Parameters:
  `nodeId` - Node ID.
  `req` - Request.

#### processDhtUnlockRequest

    protected void processDhtUnlockRequest(UUID nodeId,
                               GridDhtUnlockRequest<K,V> req)

#### lockAllAsync

    public IgniteInternalFuture<Boolean> lockAllAsync(@Nullable
                                             Collection<? extends K> keys,
                                             long timeout,
                                             IgniteTxLocalEx<K,V> txx,
                                             boolean isInvalidate,
                                             boolean isRead,
                                             boolean retval,
                                             TransactionIsolation isolation,
                                             long accessTtl,
                                             IgnitePredicate<javax.cache.Cache.Entry<K,V>>[] filter)

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.
  `accessTtl` - TTL for read operation.
  `filter` - Optional filter.
Returns:
  Future for locks.

#### lockAllAsyncInternal

    public GridDhtFuture<Boolean> lockAllAsyncInternal(@Nullable
                                              Collection<? extends K> keys,
                                              long timeout,
                                              IgniteTxLocalEx<K,V> txx,
                                              boolean isInvalidate,
                                              boolean isRead,
                                              boolean retval,
                                              TransactionIsolation isolation,
                                              long accessTtl,
                                              IgnitePredicate<javax.cache.Cache.Entry<K,V>>[] filter)

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.
  `accessTtl` - TTL for read operation.
  `filter` - Optional filter.
Returns:
  Lock future.

#### lockAllAsync

    public IgniteInternalFuture<GridNearLockResponse<K,V>> lockAllAsync(GridCacheContext<K,V> cacheCtx,
                                                               ClusterNode nearNode,
                                                               GridNearLockRequest<K,V> req,
                                                               @Nullable
                                                               IgnitePredicate<javax.cache.Cache.Entry<K,V>>[] filter0)

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

#### removeLocks

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

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

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.0.0-RC1
Release Date | : February 17 2015