public class ReplicaDistributionGoal extends ReplicaDistributionAbstractGoal
ReplicaDistributionAbstractGoal.ChangeType
Goal.ClusterModelStatsComparator
_avgReplicasOnAliveBroker, _balanceLowerLimit, _balanceUpperLimit, _brokerIdsAboveBalanceUpperLimit, _brokerIdsUnderBalanceLowerLimit, _fixOfflineReplicasOnly
_balancingConstraint, _finished, _minMonitoredPartitionPercentage, _numWindows, _succeeded
Constructor and Description |
---|
ReplicaDistributionGoal()
Constructor for Replica Distribution Goal.
|
ReplicaDistributionGoal(BalancingConstraint balancingConstraint) |
Modifier and Type | Method and Description |
---|---|
ActionAcceptance |
actionAcceptance(BalancingAction action,
ClusterModel clusterModel)
Check whether the given action is acceptable by this goal.
|
Goal.ClusterModelStatsComparator |
clusterModelStatsComparator()
Get an instance of
Goal.ClusterModelStatsComparator for this goal. |
protected void |
initGoalState(ClusterModel clusterModel,
OptimizationOptions optimizationOptions)
Initiates replica distribution goal.
|
java.lang.String |
name()
Get the name of this goal.
|
protected void |
rebalanceForBroker(Broker broker,
ClusterModel clusterModel,
java.util.Set<Goal> optimizedGoals,
OptimizationOptions optimizationOptions)
Rebalance the given broker without violating the constraints of the current goal and optimized goals.
|
protected void |
updateGoalState(ClusterModel clusterModel,
java.util.Set<java.lang.String> excludedTopics)
Update goal state after one round of self-healing / rebalance.
|
brokersToBalance, clusterModelCompletenessRequirements, finish, isHardGoal, selfSatisfied
configure, maybeApplyBalancingAction, maybeMoveReplicaBetweenDisks, optimize, shouldExclude, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
canChangeReplicationFactor
public ReplicaDistributionGoal()
public ReplicaDistributionGoal(BalancingConstraint balancingConstraint)
public ActionAcceptance actionAcceptance(BalancingAction action, ClusterModel clusterModel)
action
- Action to be checked for acceptance.clusterModel
- The state of the cluster.ActionAcceptance.ACCEPT
if the action is acceptable by this goal,
ActionAcceptance.REPLICA_REJECT
otherwise.public Goal.ClusterModelStatsComparator clusterModelStatsComparator()
Goal
Goal.ClusterModelStatsComparator
for this goal.
The Goal.ClusterModelStatsComparator.compare(ClusterModelStats, ClusterModelStats)
method should give a
preference between two ClusterModelStats
.
Cruise Control will not reuse the returned instance.
The returned value must not be null.public java.lang.String name()
Goal
name
in interface Goal
name
in class AbstractGoal
protected void initGoalState(ClusterModel clusterModel, OptimizationOptions optimizationOptions)
initGoalState
in class ReplicaDistributionAbstractGoal
clusterModel
- The state of the cluster.optimizationOptions
- Options to take into account during optimization.protected void updateGoalState(ClusterModel clusterModel, java.util.Set<java.lang.String> excludedTopics) throws OptimizationFailureException
updateGoalState
in class ReplicaDistributionAbstractGoal
clusterModel
- The state of the cluster.excludedTopics
- The topics that should be excluded from the optimization proposal.OptimizationFailureException
protected void rebalanceForBroker(Broker broker, ClusterModel clusterModel, java.util.Set<Goal> optimizedGoals, OptimizationOptions optimizationOptions)
rebalanceForBroker
in class AbstractGoal
broker
- Broker to be balanced.clusterModel
- The state of the cluster.optimizedGoals
- Optimized goals.optimizationOptions
- Options to take into account during optimization -- e.g. excluded topics.