Class RegionPlanConditionalCandidateGenerator
java.lang.Object
org.apache.hadoop.hbase.master.balancer.CandidateGenerator
org.apache.hadoop.hbase.master.balancer.RegionPlanConditionalCandidateGenerator
- Direct Known Subclasses:
DistributeReplicasCandidateGenerator
,SlopFixingCandidateGenerator
,TableIsolationCandidateGenerator
@Private
@Evolving
public abstract class RegionPlanConditionalCandidateGenerator
extends CandidateGenerator
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final BalancerConditionals
private long
private double
private static final org.slf4j.Logger
private static final Duration
Fields inherited from class org.apache.hadoop.hbase.master.balancer.CandidateGenerator
MAX_WEIGHT
-
Constructor Summary
ConstructorsConstructorDescriptionRegionPlanConditionalCandidateGenerator
(BalancerConditionals balancerConditionals) -
Method Summary
Modifier and TypeMethodDescription(package private) BalanceAction
batchMovesAndResetClusterState
(BalancerClusterState cluster, List<MoveRegionAction> moves) (package private) void
(package private) BalanceAction
generate
(BalancerClusterState cluster) (package private) abstract BalanceAction
generateCandidate
(BalancerClusterState cluster, boolean isWeighing) Generates a balancing action to appease the conditional.(package private) BalancerConditionals
(package private) double
getWeight
(BalancerClusterState cluster) (package private) void
undoBatchAction
(BalancerClusterState cluster, MoveBatchAction batchAction) (package private) boolean
willBeAccepted
(BalancerClusterState cluster, BalanceAction action) Methods inherited from class org.apache.hadoop.hbase.master.balancer.CandidateGenerator
getAction, pickOtherRandomRack, pickOtherRandomServer, pickRandomRack, pickRandomRegion, pickRandomRegions, pickRandomServer
-
Field Details
-
LOG
-
WEIGHT_CACHE_TTL
-
lastWeighedAt
-
lastWeight
-
balancerConditionals
-
-
Constructor Details
-
RegionPlanConditionalCandidateGenerator
RegionPlanConditionalCandidateGenerator(BalancerConditionals balancerConditionals)
-
-
Method Details
-
getBalancerConditionals
-
generateCandidate
Generates a balancing action to appease the conditional.- Parameters:
cluster
- Current state of the cluster.isWeighing
- Flag indicating if the generator is being used for weighing.- Returns:
- A BalanceAction, or NULL_ACTION if no action is needed.
-
generate
- Specified by:
generate
in classCandidateGenerator
-
batchMovesAndResetClusterState
BalanceAction batchMovesAndResetClusterState(BalancerClusterState cluster, List<MoveRegionAction> moves) -
willBeAccepted
-
undoBatchAction
-
clearWeightCache
void clearWeightCache() -
getWeight
-