public class GoalOptimizer extends Object
Constructor and Description |
---|
GoalOptimizer(KafkaCruiseControlConfig config,
LoadMonitor loadMonitor,
DataBalancerMetricsRegistry metricRegistry)
Constructor for Goal Optimizer takes the goals as input.
|
Modifier and Type | Method and Description |
---|---|
ModelCompletenessRequirements |
defaultModelCompletenessRequirements() |
OptimizerResult |
optimizations(ClusterModel clusterModel,
List<Goal> goalsByPriority,
Set<Integer> excludedBrokersForLeadership,
Set<Integer> excludedBrokersForReplicaMove,
boolean isTriggeredByGoalViolation)
Depending the existence of dead/broken/decommissioned brokers in the given cluster:
(1) Re-balance: Generates proposals to update the state of the cluster to achieve a final balanced state.
|
AnalyzerState |
state(MetadataClient.ClusterAndGeneration clusterAndGeneration)
Get the analyzer state from the goal optimizer.
|
public GoalOptimizer(KafkaCruiseControlConfig config, LoadMonitor loadMonitor, DataBalancerMetricsRegistry metricRegistry)
config
- The Kafka Cruise Control Configuration.public ModelCompletenessRequirements defaultModelCompletenessRequirements()
public AnalyzerState state(MetadataClient.ClusterAndGeneration clusterAndGeneration)
public OptimizerResult optimizations(ClusterModel clusterModel, List<Goal> goalsByPriority, Set<Integer> excludedBrokersForLeadership, Set<Integer> excludedBrokersForReplicaMove, boolean isTriggeredByGoalViolation) throws KafkaCruiseControlException
clusterModel
- The state of the cluster over which the balancing proposal will be applied. Function execution
updates the cluster state with balancing proposals.goalsByPriority
- the goals ordered by priority.excludedBrokersForLeadership
- Brokers excluded from receiving leadership upon proposal generation.excludedBrokersForReplicaMove
- Brokers excluded from receiving replicas upon proposal generation.isTriggeredByGoalViolation
- True if optimization of goals is triggered by goal violation, false otherwise.KafkaCruiseControlException