public class PlanComputationUtils extends Object
Constructor and Description |
---|
PlanComputationUtils(KafkaCruiseControlConfig config,
org.apache.kafka.common.utils.Time time) |
Modifier and Type | Method and Description |
---|---|
OptimizerResult |
generatePlan(PlanComputable computable,
GoalsConfig goalConfig,
KafkaCruiseControlContext context,
String planDescription)
Computes a reassignments plan, failing if are not enough valid metric windows or other exceptions occur.
|
OptimizerResult |
generatePlanWithRetries(PlanComputable computable,
String planDescription)
Computes a reassignments plan, retrying in the case of insufficient metrics
in the hopes of eventually collecting them
|
public PlanComputationUtils(KafkaCruiseControlConfig config, org.apache.kafka.common.utils.Time time)
public OptimizerResult generatePlanWithRetries(PlanComputable computable, String planDescription) throws Exception
computable
- - the interface used to do the actual plan computationplanDescription
- - an operator-friendly string to describe the plan we're computingException
public OptimizerResult generatePlan(PlanComputable computable, GoalsConfig goalConfig, KafkaCruiseControlContext context, String planDescription) throws Exception
computable
- - the interface used to do the actual plan computationgoalConfig
- - for calculating manual retry interval in log stringcontext
- - for calculating manual retry interval in log stringplanDescription
- - information about the plan being generatedorg.apache.kafka.common.errors.InsufficientRebalancePlanMetricsException
- in case of not enough valid windowsKafkaCruiseControlException
- if any other exceptionException