[ 
https://issues.apache.org/jira/browse/HBASE-24931?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17182718#comment-17182718
 ] 

Mallikarjun edited comment on HBASE-24931 at 8/23/20, 3:06 PM:
---------------------------------------------------------------

Broke some unit test cases. Fixing them. 


was (Author: rda3mon):
Broke some test cases. Fixing them. 

> 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)

Reply via email to