Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 85E0E200BF5 for ; Sat, 3 Dec 2016 01:06:45 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 84A43160B24; Sat, 3 Dec 2016 00:06:45 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id D0C5C160B27 for ; Sat, 3 Dec 2016 01:06:44 +0100 (CET) Received: (qmail 17220 invoked by uid 500); 3 Dec 2016 00:06:44 -0000 Mailing-List: contact commits-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hbase.apache.org Delivered-To: mailing list commits@hbase.apache.org Received: (qmail 17195 invoked by uid 99); 3 Dec 2016 00:06:43 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 03 Dec 2016 00:06:43 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id CC425E962C; Sat, 3 Dec 2016 00:06:43 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: apurtell@apache.org To: commits@hbase.apache.org Date: Sat, 03 Dec 2016 00:06:45 -0000 Message-Id: In-Reply-To: <47840180725d49deb31af7084b7a1e80@git.apache.org> References: <47840180725d49deb31af7084b7a1e80@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [3/4] hbase git commit: HBASE-16772 Add verbose option to VerifyReplication for logging good rows archived-at: Sat, 03 Dec 2016 00:06:45 -0000 HBASE-16772 Add verbose option to VerifyReplication for logging good rows Conflicts: hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/replication/VerifyReplication.java Amending-Author: Andrew Purtell Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/e2df4b80 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/e2df4b80 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/e2df4b80 Branch: refs/heads/0.98 Commit: e2df4b80589aa42bd8ef77debad29ded1702a956 Parents: dd488c0 Author: Andrew Purtell Authored: Fri Dec 2 16:03:57 2016 -0800 Committer: Andrew Purtell Committed: Fri Dec 2 16:03:57 2016 -0800 ---------------------------------------------------------------------- .../mapreduce/replication/VerifyReplication.java | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hbase/blob/e2df4b80/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/replication/VerifyReplication.java ---------------------------------------------------------------------- diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/replication/VerifyReplication.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/replication/VerifyReplication.java index 5fc3dd5..1ec31a1 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/replication/VerifyReplication.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/replication/VerifyReplication.java @@ -83,6 +83,7 @@ public class VerifyReplication extends Configured implements Tool { static String delimiter = ""; static String peerId = null; static String rowPrefixes = null; + static boolean verbose = false; /** * Map-only comparator for 2 tables @@ -95,6 +96,7 @@ public class VerifyReplication extends Configured implements Tool { private ResultScanner replicatedScanner; private Result currentCompareRowInPeerTable; + private boolean verbose = false; /** * Map method that compares every scanned row with the equivalent from @@ -110,6 +112,7 @@ public class VerifyReplication extends Configured implements Tool { throws IOException { if (replicatedScanner == null) { Configuration conf = context.getConfiguration(); + verbose = conf.getBoolean(NAME +".verbose", false); final Scan scan = new Scan(); scan.setBatch(batch); scan.setCacheBlocks(false); @@ -161,6 +164,9 @@ public class VerifyReplication extends Configured implements Tool { try { Result.compareResults(value, currentCompareRowInPeerTable); context.getCounter(Counters.GOODROWS).increment(1); + if (verbose) { + LOG.info("Good row key: " + delimiter + Bytes.toString(value.getRow()) + delimiter); + } } catch (Exception e) { logFailRowAndIncreaseCounter(context, Counters.CONTENT_DIFFERENT_ROWS, value); LOG.error("Exception while comparing row : " + e); @@ -260,6 +266,7 @@ public class VerifyReplication extends Configured implements Tool { conf.set(NAME+".tableName", tableName); conf.setLong(NAME+".startTime", startTime); conf.setLong(NAME+".endTime", endTime); + conf.setBoolean(NAME +".verbose", verbose); if (families != null) { conf.set(NAME+".families", families); } @@ -395,6 +402,12 @@ public class VerifyReplication extends Configured implements Tool { continue; } + final String verboseKey = "--verbose"; + if (cmd.startsWith(verboseKey)) { + verbose = true; + continue; + } + if (i == args.length-2) { peerId = cmd; } @@ -430,7 +443,8 @@ public class VerifyReplication extends Configured implements Tool { System.err.println("ERROR: " + errorMsg); } System.err.println("Usage: verifyrep [--starttime=X]" + - " [--endtime=Y] [--families=A] [--row-prefixes=B] [--delimiter=] "); + " [--endtime=Y] [--families=A] [--row-prefixes=B] [--delimiter=] [--recomparesleep=] " + + "[--verbose] "); System.err.println(); System.err.println("Options:"); System.err.println(" starttime beginning of the time range"); @@ -440,6 +454,7 @@ public class VerifyReplication extends Configured implements Tool { System.err.println(" families comma-separated list of families to copy"); System.err.println(" row-prefixes comma-separated list of row key prefixes to filter on "); System.err.println(" delimiter the delimiter used in display around rowkey"); + System.err.println(" verbose logs row keys of good rows"); System.err.println(); System.err.println("Args:"); System.err.println(" peerid Id of the peer used for verification, must match the one given for replication");