hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bus...@apache.org
Subject [5/6] hbase git commit: Revert "HBASE-18164 Fast locality computation in balancer - addendum handles NaN"
Date Tue, 27 Jun 2017 19:58:37 GMT
Revert "HBASE-18164 Fast locality computation in balancer - addendum handles NaN"

This reverts commit b4c3fe97638a4bcd4d950f6c571315d320ca47f3.

early commit missed some review feedback.


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/0ad8f266
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/0ad8f266
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/0ad8f266

Branch: refs/heads/branch-2
Commit: 0ad8f26662412fd9a7e61fa00e13ab29cb1e203d
Parents: d5e206d
Author: Sean Busbey <busbey@apache.org>
Authored: Tue Jun 27 13:31:40 2017 -0500
Committer: Sean Busbey <busbey@apache.org>
Committed: Tue Jun 27 14:58:03 2017 -0500

----------------------------------------------------------------------
 .../hadoop/hbase/master/balancer/StochasticLoadBalancer.java  | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/0ad8f266/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.java
index ece9153..63ec0b5 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.java
@@ -1286,9 +1286,8 @@ public class StochasticLoadBalancer extends BaseLoadBalancer {
       }
 
       // We normalize locality to be a score between 0 and 1.0 representing how good it
-      // is compared to how good it could be. If bestLocality is 0, assume locality is 100
-      // (and the cost is 0)
-      locality = bestLocality == 0 ? 1 : locality / bestLocality;
+      // is compared to how good it could be
+      locality /= bestLocality;
     }
 
     @Override
@@ -1299,7 +1298,7 @@ public class StochasticLoadBalancer extends BaseLoadBalancer {
         return;
       }
       double localityDelta = getWeightedLocality(region, newEntity) - getWeightedLocality(region,
oldEntity);
-      double normalizedDelta = bestLocality == 0 ? 0.0 : localityDelta / bestLocality;
+      double normalizedDelta = localityDelta / bestLocality;
       locality += normalizedDelta;
     }
 


Mime
View raw message