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 BalancerConditionalsprivate longprivate doubleprivate static final org.slf4j.Loggerprivate static final DurationFields inherited from class org.apache.hadoop.hbase.master.balancer.CandidateGenerator
MAX_WEIGHT -
Constructor Summary
ConstructorsConstructorDescriptionRegionPlanConditionalCandidateGenerator(BalancerConditionals balancerConditionals) -
Method Summary
Modifier and TypeMethodDescription(package private) BalanceActionbatchMovesAndResetClusterState(BalancerClusterState cluster, List<MoveRegionAction> moves) (package private) void(package private) BalanceActiongenerate(BalancerClusterState cluster) (package private) abstract BalanceActiongenerateCandidate(BalancerClusterState cluster, boolean isWeighing) Generates a balancing action to appease the conditional.(package private) BalancerConditionals(package private) doublegetWeight(BalancerClusterState cluster) (package private) voidundoBatchAction(BalancerClusterState cluster, MoveBatchAction batchAction) (package private) booleanwillBeAccepted(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:
generatein classCandidateGenerator
-
batchMovesAndResetClusterState
BalanceAction batchMovesAndResetClusterState(BalancerClusterState cluster, List<MoveRegionAction> moves) -
willBeAccepted
-
undoBatchAction
-
clearWeightCache
void clearWeightCache() -
getWeight
-