public abstract class ReplicaDistributionAbstractGoal extends AbstractGoal
Modifier and Type | Class and Description |
---|---|
protected static class |
ReplicaDistributionAbstractGoal.ChangeType
Whether bring replica in or out.
|
Modifier and Type | Field and Description |
---|---|
protected double |
avgReplicasOnBrokerToBalance |
protected Set<Integer> |
brokerIdsAboveBalanceUpperLimit |
protected Set<Integer> |
brokerIdsUnderBalanceLowerLimit |
protected boolean |
fixOfflineReplicasOnly |
protected DistributionThresholdUtils.ReplicaThresholds |
replicaThresholds |
balancingConstraint, finished, minMonitoredPartitionPercentage, numWindows, optimizationResultBuilder, proposalStatsBuilder
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,
Optional<OptimizationMetrics> metricsOpt)
Initiates replica distribution abstract goal.
|
boolean |
isHardGoal()
True if this is a hard goal, false otherwise.
|
boolean |
partitionActionSelfSatisfied(ClusterModel clusterModel,
PartitionBalancingAction action)
Check if requirements of this goal are not violated if this partition action is applied
to the given cluster state, false otherwise.
|
boolean |
replicaActionSelfSatisfied(ClusterModel clusterModel,
ReplicaBalancingAction 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, maybeApplyBalancingAction, maybeMoveReplicaBetweenDisks, name, optimize, proposalTrackingOptions, rebalanceForBroker, relocateReplica, selfSatisfied, shouldExclude, shouldExclude, shouldTryLeadershipMovement, toString, tryAcceptProposal, updateReplicationFactor
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
actionAcceptance, canChangeReplicationFactor, clusterModelStatsComparator, optimize
partitionActionAcceptance, replicaActionAcceptance
protected boolean fixOfflineReplicasOnly
protected double avgReplicasOnBrokerToBalance
protected DistributionThresholdUtils.ReplicaThresholds replicaThresholds
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, Optional<OptimizationMetrics> metricsOpt)
initGoalState
in class AbstractGoal
clusterModel
- The state of the cluster.optimizationOptions
- Options to take into account during optimization.metricsOpt
- An optional of OptimizationMetrics
used to capture various metrics throughout this goal's optimization run.public boolean replicaActionSelfSatisfied(ClusterModel clusterModel, ReplicaBalancingAction action)
clusterModel
- The state of the cluster.action
- Action containing information about potential modification to the given cluster model.public boolean partitionActionSelfSatisfied(ClusterModel clusterModel, PartitionBalancingAction action)
GoalBalancingActionAcceptance
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