hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From te...@apache.org
Subject hbase git commit: HBASE-16910 Avoid NPE when starting StochasticLoadBalancer (Guanghao Zhang)
Date Fri, 21 Oct 2016 17:25:49 GMT
Repository: hbase
Updated Branches:
  refs/heads/master 0ae211eb3 -> e22363967


HBASE-16910 Avoid NPE when starting StochasticLoadBalancer (Guanghao Zhang)


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

Branch: refs/heads/master
Commit: e2236396713cfc1cef61150a569e972c2faaca04
Parents: 0ae211e
Author: tedyu <yuzhihong@gmail.com>
Authored: Fri Oct 21 10:25:42 2016 -0700
Committer: tedyu <yuzhihong@gmail.com>
Committed: Fri Oct 21 10:25:42 2016 -0700

----------------------------------------------------------------------
 .../org/apache/hadoop/hbase/rsgroup/RSGroupBasedLoadBalancer.java  | 2 +-
 .../src/main/java/org/apache/hadoop/hbase/master/HMaster.java      | 2 +-
 .../hadoop/hbase/master/balancer/StochasticLoadBalancer.java       | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/e2236396/hbase-rsgroup/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupBasedLoadBalancer.java
----------------------------------------------------------------------
diff --git a/hbase-rsgroup/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupBasedLoadBalancer.java
b/hbase-rsgroup/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupBasedLoadBalancer.java
index b5dd743..c42c46d 100644
--- a/hbase-rsgroup/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupBasedLoadBalancer.java
+++ b/hbase-rsgroup/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupBasedLoadBalancer.java
@@ -391,8 +391,8 @@ public class RSGroupBasedLoadBalancer implements RSGroupableBalancer,
LoadBalanc
         HBASE_GROUP_LOADBALANCER_CLASS,
         StochasticLoadBalancer.class, LoadBalancer.class);
     internalBalancer = ReflectionUtils.newInstance(balancerKlass, config);
-    internalBalancer.setClusterStatus(clusterStatus);
     internalBalancer.setMasterServices(masterServices);
+    internalBalancer.setClusterStatus(clusterStatus);
     internalBalancer.setConf(config);
     internalBalancer.initialize();
   }

http://git-wip-us.apache.org/repos/asf/hbase/blob/e2236396/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
index a8329e3..eac2fa2 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
@@ -742,8 +742,8 @@ public class HMaster extends HRegionServer implements MasterServices {
     }
 
     //initialize load balancer
-    this.balancer.setClusterStatus(getClusterStatus());
     this.balancer.setMasterServices(this);
+    this.balancer.setClusterStatus(getClusterStatus());
     this.balancer.initialize();
 
     // Check if master is shutting down because of some issue

http://git-wip-us.apache.org/repos/asf/hbase/blob/e2236396/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 345fbf3..b02aac1 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
@@ -233,7 +233,7 @@ public class StochasticLoadBalancer extends BaseLoadBalancer {
 
       updateMetricsSize(tablesCount * (functionsCount + 1)); // +1 for overall
     } catch (Exception e) {
-      LOG.error("failed to get the size of all tables, exception = " + e.getMessage());
+      LOG.error("failed to get the size of all tables", e);
     }
   }
 


Mime
View raw message