You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "cuijianwei (JIRA)" <ji...@apache.org> on 2014/12/29 03:08:13 UTC

[jira] [Updated] (HBASE-12760) Return NullAction when region is located in highest locality server

     [ https://issues.apache.org/jira/browse/HBASE-12760?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

cuijianwei updated HBASE-12760:
-------------------------------
    Attachment: HBASE-12760-trunk.patch

> Return NullAction when region is located in highest locality server
> -------------------------------------------------------------------
>
>                 Key: HBASE-12760
>                 URL: https://issues.apache.org/jira/browse/HBASE-12760
>             Project: HBase
>          Issue Type: Improvement
>          Components: Balancer
>    Affects Versions: 0.99.2
>            Reporter: cuijianwei
>            Priority: Minor
>         Attachments: HBASE-12760-trunk.patch
>
>
> StochasticLoadBalancer#LocalityBasedCandidateGenerator will try to move a region to the server with the highest locality. The target server is selected by LocalityBasedCandidateGenerator.pickHighestLocalityServer, as:
> {code}
>     private int pickHighestLocalityServer(Cluster cluster, int thisServer, int thisRegion) {
>       ...
>       for (int loc : regionLocations) {
>         if (loc >= 0 && loc != thisServer) { // find the first suitable server
>           return loc;
>         }
>       }
>       ...
>     }
> {code}
> If the region is just located in the best server, the current logic will choose the server having the second highest locality, generating an action to try to move region to server with lower locality. Is it better to return a NullAction in this situation (as below)? so that there won't be further computing caused by the generated action.
> {code}
>     private int pickHighestLocalityServer(Cluster cluster, int thisServer, int thisRegion) {
>       ...
>       for (int loc : regionLocations) {
>         if (loc == thisServer) {
>           return -1; // return NullAction when the region is just located in the best server
>         }
>         if (loc >= 0) { // find the first suitable server
>           return loc;
>         }
>       }
>       ...
>     }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)