You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by bu...@apache.org on 2017/09/11 07:42:43 UTC

[16/50] [abbrv] hbase git commit: HBASE-18765 The value of balancerRan is true even though no plans are executed

HBASE-18765 The value of balancerRan is true even though no plans are executed


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

Branch: refs/heads/HBASE-18467
Commit: e69b05d109d4afa4bc6201197407e3f40044c522
Parents: 5847c90
Author: Chia-Ping Tsai <ch...@gmail.com>
Authored: Thu Sep 7 02:11:49 2017 +0800
Committer: Chia-Ping Tsai <ch...@gmail.com>
Committed: Fri Sep 8 13:57:19 2017 +0800

----------------------------------------------------------------------
 .../org/apache/hadoop/hbase/rsgroup/RSGroupAdminServer.java   | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/e69b05d1/hbase-rsgroup/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupAdminServer.java
----------------------------------------------------------------------
diff --git a/hbase-rsgroup/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupAdminServer.java b/hbase-rsgroup/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupAdminServer.java
index 11c2403..e3f5be5 100644
--- a/hbase-rsgroup/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupAdminServer.java
+++ b/hbase-rsgroup/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupAdminServer.java
@@ -492,7 +492,6 @@ public class RSGroupAdminServer implements RSGroupAdmin {
     AssignmentManager assignmentManager = master.getAssignmentManager();
     LoadBalancer balancer = master.getLoadBalancer();
 
-    boolean balancerRan;
     synchronized (balancer) {
       // If balance not true, don't run balancer.
       if (!((HMaster) master).isBalancerOn()) return false;
@@ -530,8 +529,8 @@ public class RSGroupAdminServer implements RSGroupAdmin {
         }
       }
       long startTime = System.currentTimeMillis();
-      balancerRan = plans != null;
-      if (plans != null && !plans.isEmpty()) {
+      boolean balancerRan = !plans.isEmpty();
+      if (balancerRan) {
         LOG.info("RSGroup balance " + groupName + " starting with plan count: " + plans.size());
         for (RegionPlan plan: plans) {
           LOG.info("balance " + plan);
@@ -543,8 +542,8 @@ public class RSGroupAdminServer implements RSGroupAdmin {
       if (master.getMasterCoprocessorHost() != null) {
         master.getMasterCoprocessorHost().postBalanceRSGroup(groupName, balancerRan);
       }
+      return balancerRan;
     }
-    return balancerRan;
   }
 
   @Override