Class GridDhtPartitionDemander.RebalanceFuture
- java.lang.Object
-
- org.apache.ignite.internal.util.future.GridFutureAdapter<Boolean>
-
- org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionDemander.RebalanceFuture
-
- All Implemented Interfaces:
IgniteInternalFuture<Boolean>
- Enclosing class:
- GridDhtPartitionDemander
public static class GridDhtPartitionDemander.RebalanceFuture extends GridFutureAdapter<Boolean>
The future is created for each topology version if some partitions should present by affinity and completed when all partitions are transferred.As soon as a partition was successfully preloaded it's state is switched to OWNING, making it consistent with other copies.
To speed up things WAL can be locally disabled until preloading is finished (causing temporary durability loss for a group) , in such a case partitions are owned after a checkpoint has completed. Applicable only for persistent mode. Possible outcomes are:
Trueif a group was fully rebalanced (but some suppliers possibly have failed to provide data due to unrecoverable error). This triggers completion of sync future.Falseif a group rebalancing was cancelled because topology has changed and new assignment is incompatible with previous, seecompatibleWith(GridDhtPreloaderAssignments).
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancancel()Cancels this future and proceeds to a next in the chain.booleancompatibleWith(GridDhtPreloaderAssignments newAssignments)booleanisInitial()booleanonDone(@Nullable Boolean res, @Nullable Throwable err, boolean cancel)voidownPartitionsAndFinishFuture(AffinityTopologyVersion topVer, long rebalanceId)voidrequestPartitions()Asynchronously sends initial demand messages formed fromassignmentsand initiates supply-demand processes.AffinityTopologyVersiontopologyVersion()StringtoString()-
Methods inherited from class org.apache.ignite.internal.util.future.GridFutureAdapter
chain, chain, chain, chain, chainCompose, chainCompose, error, get, get, get, getUninterruptibly, ignoreInterrupts, isCancelled, isDone, isFailed, listen, listen, logger, onCancelled, onDone, onDone, onDone, onDone, reset, result
-
-
-
-
Method Detail
-
requestPartitions
public void requestPartitions()
Asynchronously sends initial demand messages formed fromassignmentsand initiates supply-demand processes. For each node participating in rebalance process method distributes set of partitions for that node to several stripes (topics). It means that each stripe containing a subset of partitions can be processed in parallel. The number of stripes are controlled byIgniteConfiguration.getRebalanceThreadPoolSize()property. Partitions that can be rebalanced using only WAL are called historical, others are called full. Before sending messages, method awaits partitions clearing for full partitions.
-
ownPartitionsAndFinishFuture
public void ownPartitionsAndFinishFuture(AffinityTopologyVersion topVer, long rebalanceId)
- Parameters:
topVer- Rebalancing topology version.rebalanceId- Rebalance id.
-
topologyVersion
public AffinityTopologyVersion topologyVersion()
- Returns:
- Topology version.
-
isInitial
public boolean isInitial()
- Returns:
- Is initial (created at demander creation).
-
cancel
public boolean cancel()
Cancels this future and proceeds to a next in the chain.- Specified by:
cancelin interfaceIgniteInternalFuture<Boolean>- Overrides:
cancelin classGridFutureAdapter<Boolean>- Returns:
True.
-
onDone
public boolean onDone(@Nullable @Nullable Boolean res, @Nullable @Nullable Throwable err, boolean cancel)- Overrides:
onDonein classGridFutureAdapter<Boolean>- Parameters:
res- Result.err- Error.cancel-Trueif future is being cancelled.- Returns:
Trueif result was set by this call.
-
compatibleWith
public boolean compatibleWith(GridDhtPreloaderAssignments newAssignments)
- Parameters:
newAssignments- New assignments.- Returns:
Truewhen assignments are compatible and future should not be cancelled.
-
toString
public String toString()
- Overrides:
toStringin classGridFutureAdapter<Boolean>
-
-