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 java.util.Set<java.lang.Integer> |
_brokerIdsAboveBalanceUpperLimit |
protected java.util.Set<java.lang.Integer> |
_brokerIdsUnderBalanceLowerLimit |
protected boolean |
_fixOfflineReplicasOnly |
_balancingConstraint, _finished, _minMonitoredPartitionPercentage, _numWindows, _succeeded
Constructor and Description |
---|
ReplicaDistributionAbstractGoal()
Constructor for Replica Distribution Abstract Goal.
|
Modifier and Type | Method and Description |
---|---|
protected java.util.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,
java.util.Set<java.lang.String> excludedTopics)
Update goal state after one round of self-healing / rebalance.
|
configure, maybeApplyBalancingAction, maybeMoveReplicaBetweenDisks, name, optimize, rebalanceForBroker, shouldExclude, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
actionAcceptance, canChangeReplicationFactor, clusterModelStatsComparator
protected boolean _fixOfflineReplicasOnly
protected final java.util.Set<java.lang.Integer> _brokerIdsAboveBalanceUpperLimit
protected final java.util.Set<java.lang.Integer> _brokerIdsUnderBalanceLowerLimit
protected double _avgReplicasOnAliveBroker
protected int _balanceUpperLimit
protected int _balanceLowerLimit
public ReplicaDistributionAbstractGoal()
public ModelCompletenessRequirements clusterModelCompletenessRequirements()
Goal
public boolean isHardGoal()
Goal
protected java.util.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, java.util.Set<java.lang.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