Class GridDhtAtomicAbstractUpdateFuture
- java.lang.Object
-
- org.apache.ignite.internal.util.future.GridFutureAdapter<R>
-
- org.apache.ignite.internal.processors.cache.GridCacheFutureAdapter<Void>
-
- org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridDhtAtomicAbstractUpdateFuture
-
- All Implemented Interfaces:
IgniteInternalFuture<Void>,GridCacheAtomicFuture<Void>,GridCacheFuture<Void>
public abstract class GridDhtAtomicAbstractUpdateFuture extends GridCacheFutureAdapter<Void> implements GridCacheAtomicFuture<Void>
DHT atomic cache backup update future.
-
-
Field Summary
Fields Modifier and Type Field Description protected GridCacheContextcctxCache context.protected longfutIdFuture version.protected static IgniteLoggerlogLogger.protected Map<UUID,GridDhtAtomicAbstractUpdateRequest>mappingsMappings.protected static IgniteLoggermsgLogLogger.protected GridCacheVersionwriteVerWrite version.
-
Constructor Summary
Constructors Modifier Constructor Description protectedGridDhtAtomicAbstractUpdateFuture(GridCacheContext cctx, GridCacheVersion writeVer, GridNearAtomicAbstractUpdateRequest updateReq)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract voidaddDhtKey(KeyCacheObject key, List<ClusterNode> dhtNodes)protected abstract voidaddNearKey(KeyCacheObject key, GridDhtCacheEntry.ReaderId[] readers)IgniteInternalFuture<Void>completeFuture(AffinityTopologyVersion topVer)Gets future that will be completed when it is safe when update is finished on the given version of topology.protected abstract GridDhtAtomicAbstractUpdateRequestcreateRequest(UUID nodeId, long futId, GridCacheVersion writeVer, CacheWriteSynchronizationMode syncMode, @NotNull AffinityTopologyVersion topVer, long ttl, long conflictExpireTime, @Nullable GridCacheVersion conflictVer, boolean readRepairRecovery)IgniteUuidfutureId()voidmarkNotTrackable()Marks this future as non-trackable.booleanonDone(@Nullable Void res, @Nullable Throwable err)Callback to notify that future is finished.booleanonNodeLeft(UUID nodeId)Callback for when node left.protected abstract booleansendAllToDht()StringtoString()booleantrackable()-
Methods inherited from class org.apache.ignite.internal.processors.cache.GridCacheFutureAdapter
duration, onDone, startTime
-
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, 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.processors.cache.GridCacheFuture
duration, startTime
-
Methods inherited from interface org.apache.ignite.internal.IgniteInternalFuture
cancel, chain, chain, chain, chain, chainCompose, chainCompose, error, get, get, get, getUninterruptibly, isCancelled, isDone, listen, listen, result
-
-
-
-
Field Detail
-
log
protected static IgniteLogger log
Logger.
-
msgLog
protected static IgniteLogger msgLog
Logger.
-
writeVer
protected final GridCacheVersion writeVer
Write version.
-
cctx
protected final GridCacheContext cctx
Cache context.
-
futId
@GridToStringInclude protected final long futId
Future version.
-
mappings
@GridToStringExclude protected Map<UUID,GridDhtAtomicAbstractUpdateRequest> mappings
Mappings.
-
-
Constructor Detail
-
GridDhtAtomicAbstractUpdateFuture
protected GridDhtAtomicAbstractUpdateFuture(GridCacheContext cctx, GridCacheVersion writeVer, GridNearAtomicAbstractUpdateRequest updateReq)
- Parameters:
cctx- Cache context.writeVer- Write version.updateReq- Update request.
-
-
Method Detail
-
sendAllToDht
protected abstract boolean sendAllToDht()
- Returns:
Trueif all updates are sent to DHT.
-
completeFuture
public final IgniteInternalFuture<Void> completeFuture(AffinityTopologyVersion topVer)
Gets future that will be completed when it is safe when update is finished on the given version of topology.- Specified by:
completeFuturein interfaceGridCacheAtomicFuture<Void>- Parameters:
topVer- Topology version to finish.- Returns:
- Future or
nullif no need to wait.
-
addDhtKey
protected abstract void addDhtKey(KeyCacheObject key, List<ClusterNode> dhtNodes)
- Parameters:
key- Key.dhtNodes- DHT nodes.
-
addNearKey
protected abstract void addNearKey(KeyCacheObject key, GridDhtCacheEntry.ReaderId[] readers)
- Parameters:
key- Key.readers- Near cache readers.
-
futureId
public final IgniteUuid futureId()
- Specified by:
futureIdin interfaceGridCacheFuture<Void>- Returns:
- Unique identifier for this future.
-
onNodeLeft
public final boolean onNodeLeft(UUID nodeId)
Callback for when node left.- Specified by:
onNodeLeftin interfaceGridCacheFuture<Void>- Parameters:
nodeId- Left node ID.- Returns:
Trueif future cared about this node.
-
createRequest
protected abstract GridDhtAtomicAbstractUpdateRequest createRequest(UUID nodeId, long futId, GridCacheVersion writeVer, CacheWriteSynchronizationMode syncMode, @NotNull @NotNull AffinityTopologyVersion topVer, long ttl, long conflictExpireTime, @Nullable @Nullable GridCacheVersion conflictVer, boolean readRepairRecovery)
- Parameters:
nodeId- Node ID.futId- Future ID.writeVer- Update version.syncMode- Write synchronization mode.topVer- Topology version.ttl- TTL.conflictExpireTime- Conflict expire time.conflictVer- Conflict version.readRepairRecovery- Recovery on Read Repair.- Returns:
- Request.
-
onDone
public final boolean onDone(@Nullable @Nullable Void res, @Nullable @Nullable Throwable err)Callback to notify that future is finished. Note that if non-nullexception is passed in the result value will be ignored.- Overrides:
onDonein classGridFutureAdapter<Void>- Parameters:
res- Optional result.err- Optional error.- Returns:
Trueif result was set by this call.
-
trackable
public boolean trackable()
- Specified by:
trackablein interfaceGridCacheFuture<Void>- Returns:
Trueif future should be tracked.
-
markNotTrackable
public void markNotTrackable()
Marks this future as non-trackable.- Specified by:
markNotTrackablein interfaceGridCacheFuture<Void>
-
toString
public String toString()
- Overrides:
toStringin classGridFutureAdapter<Void>
-
-