Class GridNearReadRepairAbstractFuture
- java.lang.Object
-
- org.apache.ignite.internal.util.future.GridFutureAdapter<Map<KeyCacheObject,EntryGetResult>>
-
- org.apache.ignite.internal.processors.cache.distributed.near.consistency.GridNearReadRepairAbstractFuture
-
- All Implemented Interfaces:
IgniteInternalFuture<Map<KeyCacheObject,EntryGetResult>>
- Direct Known Subclasses:
GridNearReadRepairCheckOnlyFuture,GridNearReadRepairFuture
public abstract class GridNearReadRepairAbstractFuture extends GridFutureAdapter<Map<KeyCacheObject,EntryGetResult>>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classGridNearReadRepairAbstractFuture.ByteArrayWrapperprotected static classGridNearReadRepairAbstractFuture.IgniteConsistencyCheckFailedExceptionprotected static classGridNearReadRepairAbstractFuture.IgniteConsistencyRepairFailedException
-
Field Summary
Fields Modifier and Type Field Description protected GridCacheContext<?,?>ctxContext.protected booleandeserializeBinaryDeserialize binary flag.protected IgniteCacheExpiryPolicyexpiryPlcExpiry policy flag.protected Map<ClusterNode,GridPartitionedGetFuture<KeyCacheObject,EntryGetResult>>futsAffinity node's get futures.protected Collection<KeyCacheObject>keysContext.protected static intMAX_REMAP_CNTMaximum number of attempts to remap key to the same primary node.protected Map<KeyCacheObject,ClusterNode>primariesPrimaries per key.protected booleanreadThroughRead through flag.protected booleanrecoveryRecovery flag.protected intremapCntRemap count.protected ReadRepairStrategystrategyStrategy.protected StringtaskNameTask name.protected IgniteInternalTxtxTx.
-
Constructor Summary
Constructors Modifier Constructor Description protectedGridNearReadRepairAbstractFuture(AffinityTopologyVersion topVer, GridCacheContext<?,?> ctx, Collection<KeyCacheObject> keys, ReadRepairStrategy strategy, boolean readThrough, String taskName, boolean deserializeBinary, boolean recovery, IgniteCacheExpiryPolicy expiryPlc, IgniteInternalTx tx, GridNearReadRepairAbstractFuture remappedFut)Creates a new instance of GridNearReadRepairAbstractFuture.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected Map<KeyCacheObject,EntryGetResult>check()Checks consistency.protected Map<KeyCacheObject,EntryGetResult>correct(Set<KeyCacheObject> keys)Calculates correct values.protected Map<KeyCacheObject,EntryGetResult>correctWithPrimary(Collection<KeyCacheObject> inconsistentKeys)GridNearReadRepairAbstractFutureinit()protected voidonResult(IgniteInternalFuture<Map<KeyCacheObject,EntryGetResult>> finished)Collects results of each 'get' future and prepares an overall result of the operation.protected voidrecordConsistencyViolation(Collection<KeyCacheObject> inconsistentKeys, Map<KeyCacheObject,EntryGetResult> repairedEntries)protected abstract voidreduce()Reduces fut's results.protected voidremap(AffinityTopologyVersion topVer)protected abstract GridNearReadRepairAbstractFutureremapFuture(AffinityTopologyVersion topVer)-
Methods inherited from class org.apache.ignite.internal.util.future.GridFutureAdapter
cancel, chain, chain, chain, chain, chainCompose, chainCompose, error, get, get, get, getUninterruptibly, ignoreInterrupts, isCancelled, isDone, isFailed, listen, listen, logger, onCancelled, onDone, onDone, onDone, onDone, onDone, reset, result, toString
-
-
-
-
Field Detail
-
MAX_REMAP_CNT
protected static final int MAX_REMAP_CNT
Maximum number of attempts to remap key to the same primary node.
-
futs
protected final Map<ClusterNode,GridPartitionedGetFuture<KeyCacheObject,EntryGetResult>> futs
Affinity node's get futures.
-
ctx
protected final GridCacheContext<?,?> ctx
Context.
-
keys
protected final Collection<KeyCacheObject> keys
Context.
-
readThrough
protected final boolean readThrough
Read through flag.
-
taskName
protected final String taskName
Task name.
-
deserializeBinary
protected final boolean deserializeBinary
Deserialize binary flag.
-
recovery
protected final boolean recovery
Recovery flag.
-
expiryPlc
protected final IgniteCacheExpiryPolicy expiryPlc
Expiry policy flag.
-
tx
protected final IgniteInternalTx tx
Tx.
-
primaries
protected final Map<KeyCacheObject,ClusterNode> primaries
Primaries per key.
-
strategy
protected final ReadRepairStrategy strategy
Strategy.
-
remapCnt
protected final int remapCnt
Remap count.
-
-
Constructor Detail
-
GridNearReadRepairAbstractFuture
protected GridNearReadRepairAbstractFuture(AffinityTopologyVersion topVer, GridCacheContext<?,?> ctx, Collection<KeyCacheObject> keys, ReadRepairStrategy strategy, boolean readThrough, String taskName, boolean deserializeBinary, boolean recovery, IgniteCacheExpiryPolicy expiryPlc, IgniteInternalTx tx, GridNearReadRepairAbstractFuture remappedFut)
Creates a new instance of GridNearReadRepairAbstractFuture.- Parameters:
topVer- Topology version.ctx- Cache context.keys- Keys.strategy- Read repair strategy.readThrough- Read-through flag.taskName- Task name.deserializeBinary- Deserialize binary flag.recovery- Partition recovery flag.expiryPlc- Expiry policy.tx- Transaction. Can benullin case of atomic cache.remappedFut- Remapped future.
-
-
Method Detail
-
init
public GridNearReadRepairAbstractFuture init()
-
remap
protected void remap(AffinityTopologyVersion topVer)
- Parameters:
topVer- Topology version.
-
remapFuture
protected abstract GridNearReadRepairAbstractFuture remapFuture(AffinityTopologyVersion topVer)
- Parameters:
topVer- Topology version.
-
onResult
protected final void onResult(IgniteInternalFuture<Map<KeyCacheObject,EntryGetResult>> finished)
Collects results of each 'get' future and prepares an overall result of the operation.- Parameters:
finished- Future represents a result of GET operation.
-
reduce
protected abstract void reduce()
Reduces fut's results.
-
check
protected final Map<KeyCacheObject,EntryGetResult> check() throws IgniteCheckedException
Checks consistency.- Returns:
- Regular `get` result when data is consistent.
- Throws:
IgniteCheckedException
-
correct
protected Map<KeyCacheObject,EntryGetResult> correct(Set<KeyCacheObject> keys) throws IgniteCheckedException
Calculates correct values.- Parameters:
keys- Keys.- Returns:
- Correctet entries.
- Throws:
IgniteCheckedException
-
correctWithPrimary
protected Map<KeyCacheObject,EntryGetResult> correctWithPrimary(Collection<KeyCacheObject> inconsistentKeys)
-
recordConsistencyViolation
protected final void recordConsistencyViolation(Collection<KeyCacheObject> inconsistentKeys, Map<KeyCacheObject,EntryGetResult> repairedEntries)
- Parameters:
repairedEntries- Repaired map.
-
-