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

## Class CacheDistributedGetFutureAdapter<K,V>

- java.lang.Object
- - java.util.concurrent.locks.AbstractOwnableSynchronizer
  - - java.util.concurrent.locks.AbstractQueuedSynchronizer
    - - org.apache.ignite.internal.util.future.GridFutureAdapter<R>
      - - org.apache.ignite.internal.util.future.GridCompoundFuture<T,T>
        - - org.apache.ignite.internal.util.future.GridCompoundIdentityFuture<Map<K,V>>
          - - org.apache.ignite.internal.processors.cache.distributed.dht.CacheDistributedGetFutureAdapter<K,V>

All Implemented Interfaces:
  Serializable, IgniteInternalFuture<Map<K,V>>, CacheGetFuture, GridCacheFuture<Map<K,V>>, IgniteInClosure<IgniteInternalFuture<Map<K,V>>>

Direct Known Subclasses:
  GridNearGetFuture, GridPartitionedGetFuture

    public abstract class CacheDistributedGetFutureAdapter<K,V>
    extends GridCompoundIdentityFuture<Map<K,V>>
    implements GridCacheFuture<Map<K,V>>, CacheGetFuture

See Also:
  Serialized Form

### Nested Class Summary

### Nested classes/interfaces inherited from class java.util.concurrent.locks.AbstractQueuedSynchronizer

`AbstractQueuedSynchronizer.ConditionObject`

### Field Summary

Fields
`protected boolean` `canRemap` Flag indicating that get should be done on a locked topology version.
`protected GridCacheContext<K,V>` `cctx` Context.
`protected boolean` `deserializeBinary` Whether to deserialize binary objects.
`static int` `DFLT_MAX_REMAP_CNT` Default max remap count value.
`protected IgniteCacheExpiryPolicy` `expiryPlc` Expiry policy.
`protected boolean` `forcePrimary` Force primary flag.
`protected IgniteUuid` `futId` Future ID.
`protected boolean` `keepCacheObjects`
`protected Collection<KeyCacheObject>` `keys` Keys.
`protected static int` `MAX_REMAP_CNT` Maximum number of attempts to remap key to the same primary node.
`protected boolean` `needVer`
`protected boolean` `readThrough` Read through flag.
`protected static AtomicIntegerFieldUpdater<CacheDistributedGetFutureAdapter>` `REMAP_CNT_UPD` Remap count updater.
`protected int` `remapCnt` Remap count.
`protected boolean` `skipVals` Skip values flag.
`protected UUID` `subjId` Subject ID.
`protected String` `taskName` Task name.
`protected boolean` `trackable` Trackable flag.

### Fields inherited from class org.apache.ignite.internal.util.future.GridCompoundFuture

`futs`

### Constructor Summary

Constructors
`protected` `CacheDistributedGetFutureAdapter(GridCacheContext<K,V> cctx, Collection<KeyCacheObject> keys, boolean readThrough, boolean forcePrimary, UUID subjId, String taskName, boolean deserializeBinary, IgniteCacheExpiryPolicy expiryPlc, boolean skipVals, boolean canRemap, boolean needVer, boolean keepCacheObjects)`

### Method Summary

Methods
`protected ClusterNode` `affinityNode(List<ClusterNode> affNodes)` Affinity node to send get request to.
`protected boolean` `partitionOwned(int part)`
`protected ClusterTopologyServerNotFoundException` `serverNotFoundError(AffinityTopologyVersion topVer)`

### Methods inherited from class org.apache.ignite.internal.util.future.GridCompoundIdentityFuture

`toString`

### Methods inherited from class org.apache.ignite.internal.util.future.GridCompoundFuture

`add, apply, cancel, futures, futuresSize, hasPending, ignoreFailure, initialized, markInitialized`

### Methods inherited from class org.apache.ignite.internal.util.future.GridFutureAdapter

`chain, duration, endTime, error, get, get, get, get0, getUninterruptibly, ignoreInterrupts, isCancelled, isDone, isFailed, listen, onCancelled, onDone, onDone, onDone, onDone, result, startTime, tryAcquireShared, tryReleaseShared`

### Methods inherited from class java.util.concurrent.locks.AbstractQueuedSynchronizer

`acquire, acquireInterruptibly, acquireShared, acquireSharedInterruptibly, compareAndSetState, getExclusiveQueuedThreads, getFirstQueuedThread, getQueuedThreads, getQueueLength, getSharedQueuedThreads, getState, getWaitingThreads, getWaitQueueLength, hasContended, hasQueuedPredecessors, hasQueuedThreads, hasWaiters, isHeldExclusively, isQueued, owns, release, releaseShared, setState, tryAcquire, tryAcquireNanos, tryAcquireSharedNanos, tryRelease`

### Methods inherited from class java.util.concurrent.locks.AbstractOwnableSynchronizer

`getExclusiveOwnerThread, setExclusiveOwnerThread`

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

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

### Methods inherited from interface org.apache.ignite.internal.processors.cache.GridCacheFuture

`futureId, markNotTrackable, onNodeLeft, trackable`

### Methods inherited from interface org.apache.ignite.internal.IgniteInternalFuture

`cancel, chain, duration, error, get, get, get, getUninterruptibly, isCancelled, isDone, listen, result, startTime`

### Methods inherited from interface org.apache.ignite.internal.processors.cache.distributed.dht.CacheGetFuture

`onResult`

### Field Detail

#### DFLT_MAX_REMAP_CNT

    public static final int DFLT_MAX_REMAP_CNT

Default max remap count value.

See Also:
  Constant Field Values

#### MAX_REMAP_CNT

    protected static final int MAX_REMAP_CNT

Maximum number of attempts to remap key to the same primary node.

#### REMAP_CNT_UPD

    protected static final AtomicIntegerFieldUpdater<CacheDistributedGetFutureAdapter> REMAP_CNT_UPD

Remap count updater.

#### cctx

    protected final GridCacheContext<K,V> cctx

Context.

#### keys

    protected Collection<KeyCacheObject> keys

Keys.

#### readThrough

    protected boolean readThrough

Read through flag.

#### forcePrimary

    protected boolean forcePrimary

Force primary flag.

#### futId

    protected IgniteUuid futId

Future ID.

#### trackable

    protected boolean trackable

Trackable flag.

#### remapCnt

    protected volatile int remapCnt

Remap count.

#### subjId

    protected UUID subjId

Subject ID.

#### taskName

    protected String taskName

Task name.

#### deserializeBinary

    protected boolean deserializeBinary

Whether to deserialize binary objects.

#### skipVals

    protected boolean skipVals

Skip values flag.

#### expiryPlc

    protected IgniteCacheExpiryPolicy expiryPlc

Expiry policy.

#### canRemap

    protected boolean canRemap

Flag indicating that get should be done on a locked topology version.

#### needVer

    protected final boolean needVer

#### keepCacheObjects

    protected final boolean keepCacheObjects

### Constructor Detail

#### CacheDistributedGetFutureAdapter

    protected CacheDistributedGetFutureAdapter(GridCacheContext<K,V> cctx,
                                    Collection<KeyCacheObject> keys,
                                    boolean readThrough,
                                    boolean forcePrimary,
                                    @Nullable
                                    UUID subjId,
                                    String taskName,
                                    boolean deserializeBinary,
                                    @Nullable
                                    IgniteCacheExpiryPolicy expiryPlc,
                                    boolean skipVals,
                                    boolean canRemap,
                                    boolean needVer,
                                    boolean keepCacheObjects)

Parameters:
  `cctx` - Context.
  `keys` - Keys.
  `readThrough` - Read through flag.
  `forcePrimary` - If `true` then will force network trip to primary node even if called on backup node.
  `subjId` - Subject ID.
  `taskName` - Task name.
  `deserializeBinary` - Deserialize binary flag.
  `expiryPlc` - Expiry policy.
  `skipVals` - Skip values flag.
  `canRemap` - Flag indicating whether future can be remapped on a newer topology version.
  `needVer` - If `true` returns values as tuples containing value and version.
  `keepCacheObjects` - Keep cache objects flag.

### Method Detail

#### affinityNode

    protected final ClusterNode affinityNode(List<ClusterNode> affNodes)

Affinity node to send get request to.

Parameters:
  `affNodes` - All affinity nodes.
Returns:
  Affinity node to get key from.

#### partitionOwned

    protected final boolean partitionOwned(int part)

Parameters:
  `part` - Partition.
Returns:
  `True` if partition is in owned state.

#### serverNotFoundError

    protected final ClusterTopologyServerNotFoundException serverNotFoundError(AffinityTopologyVersion topVer)

Parameters:
  `topVer` - Topology version.
Returns:
  Exception.

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.7.0
Release Date | : August 1 2016