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

## Class CacheDistributedGetFutureAdapter<K,V>

- java.lang.Object
- - org.apache.ignite.internal.util.future.GridFutureAdapter<R>
  - - org.apache.ignite.internal.util.future.GridCompoundFuture<T,T>
    - - org.apache.ignite.internal.util.future.GridCompoundIdentityFuture<T>
      - - org.apache.ignite.internal.processors.cache.GridCacheCompoundIdentityFuture<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 GridCacheCompoundIdentityFuture<Map<K,V>>
    implements CacheGetFuture

See Also:
  Serialized Form

### Nested Class Summary

Nested Classes
`protected class` `CacheDistributedGetFutureAdapter.AbstractMiniFuture` Mini-future for get operations.

### 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 IgniteUuid` `deploymentLdrId` Deployment class loader id which will be used for deserialization of entries on a distributed task.
`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 Map<AffinityTopologyVersion,Map<Integer,Set<ClusterNode>>>` `invalidNodes`
`protected boolean` `keepCacheObjects`
`protected Collection<KeyCacheObject>` `keys` Keys.
`protected static IgniteLogger` `log` Logger.
`protected static AtomicReference<IgniteLogger>` `logRef` Logger reference.
`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 boolean` `recovery`
`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.

### Constructor Summary

Constructors
`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 needVer, boolean keepCacheObjects, boolean recovery)`

### Method Summary

All Methods Instance Methods Abstract Methods Concrete Methods
`protected void` `addNodeAsInvalid(ClusterNode node, int part, AffinityTopologyVersion topVer)`
`protected boolean` `checkRetryPermits(KeyCacheObject key, ClusterNode node, Map<ClusterNode,LinkedHashMap<KeyCacheObject,Boolean>> missedNodesToKeysMapping)`
`IgniteUuid` `futureId()`
`protected Set<ClusterNode>` `getInvalidNodes(int part, AffinityTopologyVersion topVer)`
`protected void` `initLogger(Class<?> aclass)`
`protected abstract boolean` `isMini(IgniteInternalFuture<?> f)`
`protected abstract void` `map(Collection<KeyCacheObject> keys, Map<ClusterNode,LinkedHashMap<KeyCacheObject,Boolean>> mapped, AffinityTopologyVersion topVer)`
`void` `markNotTrackable()` Marks this future as non-trackable.
`boolean` `onNodeLeft(UUID nodeId)` Callback for when node left.
`void` `onResult(UUID nodeId, GridNearGetResponse res)`
`protected boolean` `partitionOwned(int part)`
`protected void` `registrateFutureInMvccManager(GridCacheFuture<?> fut)`
`protected ClusterTopologyServerNotFoundException` `serverNotFoundError(int part, AffinityTopologyVersion topVer)`
`String` `toString()`
`boolean` `trackable()`

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

`duration, onDone, startTime`

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

`add, apply, cancel, clear, future, futures, futuresCountNoLock, hasFutures, hasPending, ignoreFailure, initialized, logDebug, logError, markInitialized, processFailure`

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

`chain, chain, error, get, get, get, getUninterruptibly, ignoreInterrupts, isCancelled, isDone, isFailed, listen, logger, onCancelled, onDone, onDone, onDone, onDone, reset, result`

### 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.IgniteInternalFuture

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

### Field Detail

#### logRef

    protected static final AtomicReference<IgniteLogger> logRef

Logger reference.

#### log

    protected static IgniteLogger log

Logger.

#### 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

#### recovery

    protected final boolean recovery

#### deploymentLdrId

    @GridToStringExclude
    protected final IgniteUuid deploymentLdrId

Deployment class loader id which will be used for deserialization of entries on a distributed task.

#### invalidNodes

    protected Map<AffinityTopologyVersion,Map<Integer,Set<ClusterNode>>> invalidNodes

### Constructor Detail

#### CacheDistributedGetFutureAdapter

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

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.
  `needVer` - If `true` returns values as tuples containing value and version.
  `keepCacheObjects` - Keep cache objects flag.

### Method Detail

#### initLogger

    protected void initLogger(Class<?> aclass)

Parameters:
  `aclass` - Class.

#### trackable

    public boolean trackable()

Specified by:
  `trackable` in interface `GridCacheFuture<Map<K,V>>`
Returns:
  `True` if future should be tracked.

#### markNotTrackable

    public void markNotTrackable()

Marks this future as non-trackable.

Specified by:
  `markNotTrackable` in interface `GridCacheFuture<Map<K,V>>`

#### futureId

    public IgniteUuid futureId()

Specified by:
  `futureId` in interface `GridCacheFuture<Map<K,V>>`
Returns:
  Unique identifier for this future.

#### partitionOwned

    protected final boolean partitionOwned(int part)

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

#### registrateFutureInMvccManager

    protected void registrateFutureInMvccManager(GridCacheFuture<?> fut)

Parameters:
  `fut` - Future.

#### addNodeAsInvalid

    protected void addNodeAsInvalid(ClusterNode node,
                                    int part,
                                    AffinityTopologyVersion topVer)

Parameters:
  `node` - Cluster node.
  `part` - Invalid partition.
  `topVer` - Topology version.

#### getInvalidNodes

    protected Set<ClusterNode> getInvalidNodes(int part,
                                               AffinityTopologyVersion topVer)

Parameters:
  `part` - Partition.
  `topVer` - Topology version.
Returns:
  Set of invalid cluster nodes.

#### checkRetryPermits

    protected boolean checkRetryPermits(KeyCacheObject key,
                                        ClusterNode node,
                                        Map<ClusterNode,LinkedHashMap<KeyCacheObject,Boolean>> missedNodesToKeysMapping)

Parameters:
  `key` - Key.
  `node` - Mapped node.
  `missedNodesToKeysMapping` - Full node mapping.

#### onNodeLeft

    public boolean onNodeLeft(UUID nodeId)

Callback for when node left.

Specified by:
  `onNodeLeft` in interface `GridCacheFuture<Map<K,V>>`
Parameters:
  `nodeId` - Left node ID.
Returns:
  `True` if future cared about this node.

#### onResult

    public void onResult(UUID nodeId,
                         GridNearGetResponse res)

Specified by:
  `onResult` in interface `CacheGetFuture`
Parameters:
  `nodeId` - Node ID.
  `res` - Response.

#### serverNotFoundError

    protected final ClusterTopologyServerNotFoundException serverNotFoundError(int part,
                                                                               AffinityTopologyVersion topVer)

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

#### isMini

    protected abstract boolean isMini(IgniteInternalFuture<?> f)

Parameters:
  `f` - Future.
Returns:
  `True` if mini-future.

#### map

    protected abstract void map(Collection<KeyCacheObject> keys,
                                Map<ClusterNode,LinkedHashMap<KeyCacheObject,Boolean>> mapped,
                                AffinityTopologyVersion topVer)

Parameters:
  `keys` - Collection of mapping keys.
  `mapped` - Previous mapping.
  `topVer` - Topology version.

#### toString

    public String toString()

Overrides:
  `toString` in class `GridCompoundIdentityFuture<Map<K,V>>`

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.11.0
Release Date | : September 11 2021