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-15327 Canary will always invoke admin.balancer() in each sniffing period when writeSniffing is enabled (Jianwei Cui)
Date Wed, 30 Mar 2016 16:01:29 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-1.3 c33330b9d -> 07db39a02


HBASE-15327 Canary will always invoke admin.balancer() in each sniffing period when writeSniffing
is enabled (Jianwei Cui)


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

Branch: refs/heads/branch-1.3
Commit: 07db39a023ddb76db322cc9694d2c585644594ee
Parents: c33330b
Author: tedyu <yuzhihong@gmail.com>
Authored: Wed Mar 30 09:01:08 2016 -0700
Committer: tedyu <yuzhihong@gmail.com>
Committed: Wed Mar 30 09:01:08 2016 -0700

----------------------------------------------------------------------
 .../src/main/java/org/apache/hadoop/hbase/tool/Canary.java   | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/07db39a0/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/Canary.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/Canary.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/Canary.java
index f40fe53..e6c830d 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/Canary.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/Canary.java
@@ -46,6 +46,7 @@ import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.hbase.AuthUtil;
 import org.apache.hadoop.hbase.ChoreService;
+import org.apache.hadoop.hbase.ClusterStatus;
 import org.apache.hadoop.hbase.DoNotRetryIOException;
 import org.apache.hadoop.hbase.HBaseConfiguration;
 import org.apache.hadoop.hbase.HColumnDescriptor;
@@ -924,7 +925,12 @@ public final class Canary implements Tool {
         admin.enableTable(writeTableName);
       }
 
-      int numberOfServers = admin.getClusterStatus().getServers().size();
+      ClusterStatus status = admin.getClusterStatus();
+      int numberOfServers = status.getServersSize();
+      if (status.getServers().contains(status.getMaster())) {
+        numberOfServers -= 1;
+      }
+
       List<HRegionLocation> locations;
       RegionLocator locator = connection.getRegionLocator(writeTableName);
       try {


Mime
View raw message