You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hbase.apache.org by "Duo Zhang (Jira)" <ji...@apache.org> on 2021/03/15 13:51:00 UTC
[jira] [Resolved] (HBASE-24931) Candidate Generator helper
getAction method ignoring 0th index region
[ https://issues.apache.org/jira/browse/HBASE-24931?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Duo Zhang resolved HBASE-24931.
-------------------------------
Resolution: Duplicate
> Candidate Generator helper getAction method ignoring 0th index region
> ---------------------------------------------------------------------
>
> Key: HBASE-24931
> URL: https://issues.apache.org/jira/browse/HBASE-24931
> Project: HBase
> Issue Type: Bug
> Components: Balancer
> Reporter: Mallikarjun
> Assignee: Mallikarjun
> Priority: Minor
>
> Balance Candidate generators such as `LocalityBasedCandidateGenerator`, `RegionReplicaCandidateGenerator`, `RegionReplicaRackCandidateGenerator`, etc uses helper method `getAction` to generate action is ignoring 0th index of `fromRegion` and `toRegion`.
> {code:java}
> protected BaseLoadBalancer.Cluster.Action getAction(int fromServer, int fromRegion,
> int toServer, int toRegion) {
> if (fromServer < 0 || toServer < 0) {
> return BaseLoadBalancer.Cluster.NullAction;
> }
> if (fromRegion > 0 && toRegion > 0) {
> return new BaseLoadBalancer.Cluster.SwapRegionsAction(fromServer, fromRegion,
> toServer, toRegion);
> } else if (fromRegion > 0) {
> return new BaseLoadBalancer.Cluster.MoveRegionAction(fromRegion, fromServer, toServer);
> } else if (toRegion > 0) {
> return new BaseLoadBalancer.Cluster.MoveRegionAction(toRegion, toServer, fromServer);
> } else {
> return BaseLoadBalancer.Cluster.NullAction;
> }
> }
> {code}
> Is this unintentional or there is some particular reason?
--
This message was sent by Atlassian Jira
(v8.3.4#803005)