Repository: hbase Updated Branches: refs/heads/branch-1 9f343b587 -> 5fdddae55
HBASE-16771 VerifyReplication should increase GOODROWS counter if re-comparison passes Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/364a57a9 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/364a57a9 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/364a57a9 Branch: refs/heads/branch-1 Commit: 364a57a9500b942163932e2c644c05bff3e55090 Parents: 4b75614 Author: tedyu <[email protected]> Authored: Sun Oct 9 20:51:23 2016 -0700 Committer: tedyu <[email protected]> Committed: Sun Oct 9 20:51:23 2016 -0700 ---------------------------------------------------------------------- .../hbase/mapreduce/replication/VerifyReplication.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hbase/blob/364a57a9/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 8bb1592..bf320ee 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 @@ -102,6 +102,7 @@ public class VerifyReplication extends Configured implements Tool { private Result currentCompareRowInPeerTable; private Table replicatedTable; private int sleepMsBeforeReCompare; + private String delimiter = ""; private boolean verbose = false; /** @@ -119,6 +120,7 @@ public class VerifyReplication extends Configured implements Tool { if (replicatedScanner == null) { Configuration conf = context.getConfiguration(); sleepMsBeforeReCompare = conf.getInt(NAME +".sleepMsBeforeReCompare", 0); + delimiter = conf.get(NAME + ".delimiter", ""); verbose = conf.getBoolean(NAME +".verbose", false); final Scan scan = new Scan(); scan.setBatch(batch); @@ -179,7 +181,6 @@ public class VerifyReplication extends Configured implements Tool { } } catch (Exception e) { logFailRowAndIncreaseCounter(context, Counters.CONTENT_DIFFERENT_ROWS, value); - LOG.error("Exception while comparing row : " + e); } currentCompareRowInPeerTable = replicatedScanner.next(); break; @@ -203,9 +204,11 @@ public class VerifyReplication extends Configured implements Tool { Result sourceResult = sourceTable.get(new Get(row.getRow())); Result replicatedResult = replicatedTable.get(new Get(row.getRow())); Result.compareResults(sourceResult, replicatedResult); - context.getCounter(Counters.GOODROWS).increment(1); - if (verbose) { - LOG.info("Good row key: " + delimiter + Bytes.toString(row.getRow()) + delimiter); + if (!sourceResult.isEmpty()) { + context.getCounter(Counters.GOODROWS).increment(1); + if (verbose) { + LOG.info("Good row key: " + delimiter + Bytes.toString(row.getRow()) + delimiter); + } } return; } catch (Exception e) { @@ -309,6 +312,7 @@ public class VerifyReplication extends Configured implements Tool { conf.setLong(NAME+".startTime", startTime); conf.setLong(NAME+".endTime", endTime); conf.setInt(NAME +".sleepMsBeforeReCompare", sleepMsBeforeReCompare); + conf.set(NAME + ".delimiter", delimiter); conf.setBoolean(NAME +".verbose", verbose); if (families != null) { conf.set(NAME+".families", families);
