From 2ebf5ab02fda95fde61341db37fede89b0416130 Mon Sep 17 00:00:00 2001 From: David Manning Date: Wed, 29 Aug 2018 12:06:59 -0700 Subject: [PATCH] Backport "HBASE-21126 Add ability for HBase Canary to ignore a configurable number of ZooKeeper down nodes" to branch-2.0 Signed-off-by: Michael Stack --- .../java/org/apache/hadoop/hbase/tool/Canary.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) 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 40f4aa6654f..71af23ec502 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 @@ -599,7 +599,6 @@ public final class Canary implements Tool { * True if we are to run in zookeeper 'mode'. */ private boolean zookeeperMode = false; - private long permittedFailures = 0; private boolean regionServerAllRegions = false; private boolean writeSniffing = false; @@ -892,6 +891,8 @@ public final class Canary implements Tool { "random one."); System.err.println(" -zookeeper set 'zookeeper mode'; grab zookeeper.znode.parent on " + "each ensemble member"); + System.err.println(" -permittedZookeeperFailures Ignore first N failures when attempting to " + + "connect to individual zookeeper nodes in the ensemble"); System.err.println(" -daemon continuous check at defined intervals."); System.err.println(" -interval interval between checks in seconds"); System.err.println(" -e consider table/regionserver argument as regular " + @@ -957,8 +958,7 @@ public final class Canary implements Tool { monitor = new ZookeeperMonitor(connection, monitorTargets, this.useRegExp, getSink(connection.getConfiguration(), ZookeeperStdOutSink.class), - this.executor, this.treatFailureAsError, - this.permittedFailures); + this.executor, this.treatFailureAsError, this.permittedFailures); } else { monitor = new RegionMonitor(connection, monitorTargets, this.useRegExp, @@ -1078,10 +1078,9 @@ public final class Canary implements Tool { public RegionMonitor(Connection connection, String[] monitorTargets, boolean useRegExp, Sink sink, ExecutorService executor, boolean writeSniffing, TableName writeTableName, boolean treatFailureAsError, HashMap configuredReadTableTimeouts, - long configuredWriteTableTimeout, - long allowedFailures) { + long configuredWriteTableTimeout, long allowedFailures) { super(connection, monitorTargets, useRegExp, sink, executor, treatFailureAsError, - allowedFailures); + allowedFailures); Configuration conf = connection.getConfiguration(); this.writeSniffing = writeSniffing; this.writeTableName = writeTableName;