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:00:31 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-1 1e44dd82e -> e339bec3f


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/e339bec3
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/e339bec3
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/e339bec3

Branch: refs/heads/branch-1
Commit: e339bec3f15707fc4a2d464befeac485c08ad21d
Parents: 1e44dd8
Author: tedyu <yuzhihong@gmail.com>
Authored: Wed Mar 30 09:00:04 2016 -0700
Committer: tedyu <yuzhihong@gmail.com>
Committed: Wed Mar 30 09:00:04 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/e339bec3/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