public class MovementExclusionGoal extends AbstractAcceptanceGoal
MovementExclusionGoal
is a hard blocking goal which forbids replica moves-out from ineligible source broker or move-in to ineligible destination broker.
E.g. demoted brokers, excluded brokers and excluded topics.
For more information on exclusions, see ConfluentAdmin.alterLeadershipPriority(org.apache.kafka.clients.admin.AlterLeadershipPrioritySpec, org.apache.kafka.clients.admin.AlterLeadershipPriorityOptions)
, ConfluentAdmin.alterBrokerReplicaExclusions(Map)
and ConfluentConfigs.BALANCER_EXCLUDE_TOPIC_NAMES_CONFIG
.balancingConstraint, finished, minMonitoredPartitionPercentage, numWindows, optimizationResultBuilder, proposalStatsBuilder
Constructor and Description |
---|
MovementExclusionGoal() |
Modifier and Type | Method and Description |
---|---|
protected void |
initGoalState(ClusterModel clusterModel,
OptimizationOptions optimizationOptions,
Optional<OptimizationMetrics> optimizationMetricsOpt)
Initialize states that this goal requires -- e.g.
|
String |
name()
Get the name of this goal.
|
ActionAcceptance |
partitionActionAcceptance(PartitionBalancingAction action,
ClusterModel clusterModel)
Checks if the action on the partition specified by the
PartitionBalancingAction
is acceptable. |
ActionAcceptance |
replicaActionAcceptance(ReplicaBalancingAction action,
ClusterModel clusterModel)
Checks if the action on the replica specified by the
ReplicaBalancingAction
is acceptable. |
brokersToBalance, clusterModelCompletenessRequirements, finish, isHardGoal, partitionActionSelfSatisfied, rebalanceForBroker, replicaActionSelfSatisfied, updateGoalState
changeObservership, configure, maybeApplyBalancingAction, maybeApplyBalancingAction, maybeMoveReplicaBetweenDisks, optimize, proposalTrackingOptions, relocateReplica, selfSatisfied, shouldExclude, shouldExclude, shouldTryLeadershipMovement, toString, tryAcceptProposal, updateReplicationFactor
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
actionAcceptance, canChangeReplicationFactor, clusterModelStatsComparator, optimize
protected void initGoalState(ClusterModel clusterModel, OptimizationOptions optimizationOptions, Optional<OptimizationMetrics> optimizationMetricsOpt) throws OptimizationFailureException
AbstractAcceptanceGoal
initGoalState
in class AbstractAcceptanceGoal
clusterModel
- The state of the cluster.optimizationOptions
- Options to take into account during optimization -- e.g. excluded topics.optimizationMetricsOpt
- An optional of OptimizationMetrics
used to capture various metrics throughout this goal's optimization run.OptimizationFailureException
public ActionAcceptance replicaActionAcceptance(ReplicaBalancingAction action, ClusterModel clusterModel)
GoalBalancingActionAcceptance
ReplicaBalancingAction
is acceptable.
For performance optimization purposes, it is recommended goals return the wider-level action acceptance first
(e.g ActionAcceptance.BROKER_REJECT
versus ActionAcceptance.REPLICA_REJECT
) as that helps
the proposal-generating logic short-circuit invalid proposal generations.action
- Action to be checked for acceptance.clusterModel
- State of the cluster before application of the action.public ActionAcceptance partitionActionAcceptance(PartitionBalancingAction action, ClusterModel clusterModel)
GoalBalancingActionAcceptance
PartitionBalancingAction
is acceptable.
For performance optimization purposes, it is recommended goals return the wider-level action acceptance first
(e.g ActionAcceptance.BROKER_REJECT
versus ActionAcceptance.REPLICA_REJECT
) as that helps
the proposal-generating logic short-circuit invalid proposal generations.action
- Action to be checked for acceptance.clusterModel
- State of the cluster before application of the action.