public abstract class ReplicaDistributionAbstractGoal extends AbstractGoal
Modifier and Type | Class and Description |
---|---|
protected static class |
ReplicaDistributionAbstractGoal.ChangeType
Whether bring replica in or out.
|
Goal.ClusterModelStatsComparator
Modifier and Type | Field and Description |
---|---|
protected double |
avgReplicasOnAliveBroker |
protected int |
balanceLowerLimit |
protected int |
balanceUpperLimit |
protected Set<Integer> |
brokerIdsAboveBalanceUpperLimit |
protected Set<Integer> |
brokerIdsUnderBalanceLowerLimit |
protected boolean |
fixOfflineReplicasOnly |
balancingConstraint, finished, minMonitoredPartitionPercentage, numWindows, optimizationResultBuilder
Constructor and Description |
---|
ReplicaDistributionAbstractGoal()
Constructor for Replica Distribution Abstract Goal.
|
Modifier and Type | Method and Description |
---|---|
protected SortedSet<Broker> |
brokersToBalance(ClusterModel clusterModel)
Get brokers that the rebalance process will go over to apply balancing actions to replicas they contain.
|
ModelCompletenessRequirements |
clusterModelCompletenessRequirements()
Specify the load requirements for this goal.
|
void |
finish()
Signal for finishing the process for rebalance or self-healing for this goal.
|
protected void |
initGoalState(ClusterModel clusterModel,
OptimizationOptions optimizationOptions)
Initiates replica distribution abstract goal.
|
boolean |
isHardGoal()
True if this is a hard goal, false otherwise.
|
protected boolean |
selfSatisfied(ClusterModel clusterModel,
BalancingAction action)
Check if requirements of this goal are not violated if this proposal is applied to the given cluster state,
false otherwise.
|
protected void |
updateGoalState(ClusterModel clusterModel,
Set<String> excludedTopics)
Update goal state after one round of self-healing / rebalance.
|
changeObservership, configure, maybeApplyBalancingAction, maybeMoveReplicaBetweenDisks, name, optimize, rebalanceForBroker, shouldExclude, toString, updateReplicationFactor
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
actionAcceptance, canChangeReplicationFactor, clusterModelStatsComparator
protected boolean fixOfflineReplicasOnly
protected double avgReplicasOnAliveBroker
protected int balanceUpperLimit
protected int balanceLowerLimit
public ReplicaDistributionAbstractGoal()
public ModelCompletenessRequirements clusterModelCompletenessRequirements()
Goal
public boolean isHardGoal()
Goal
protected SortedSet<Broker> brokersToBalance(ClusterModel clusterModel)
brokersToBalance
in class AbstractGoal
clusterModel
- The state of the cluster.protected void initGoalState(ClusterModel clusterModel, OptimizationOptions optimizationOptions)
initGoalState
in class AbstractGoal
clusterModel
- The state of the cluster.optimizationOptions
- Options to take into account during optimization.protected boolean selfSatisfied(ClusterModel clusterModel, BalancingAction action)
selfSatisfied
in class AbstractGoal
clusterModel
- The state of the cluster.action
- Action containing information about potential modification to the given cluster model.protected void updateGoalState(ClusterModel clusterModel, Set<String> excludedTopics) throws OptimizationFailureException
updateGoalState
in class AbstractGoal
clusterModel
- The state of the cluster.excludedTopics
- The topics that should be excluded from the optimization proposal.OptimizationFailureException
public void finish()
Goal