You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by te...@apache.org on 2016/08/21 00:16:47 UTC

hbase git commit: HBASE-16409 Row key for bad row should be properly delimited in VerifyReplication

Repository: hbase
Updated Branches:
  refs/heads/master 7145e46b7 -> d077219d3


HBASE-16409 Row key for bad row should be properly delimited in VerifyReplication


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

Branch: refs/heads/master
Commit: d077219d3a5f6f9393b1ae66a3db75503632e02a
Parents: 7145e46
Author: tedyu <yu...@gmail.com>
Authored: Sat Aug 20 17:16:39 2016 -0700
Committer: tedyu <yu...@gmail.com>
Committed: Sat Aug 20 17:16:39 2016 -0700

----------------------------------------------------------------------
 .../hbase/mapreduce/replication/VerifyReplication.java | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/d077219d/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 16ff6fa..c0aa745 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
@@ -80,6 +80,7 @@ public class VerifyReplication extends Configured implements Tool {
   static int versions = -1;
   static String tableName = null;
   static String families = null;
+  static String delimiter = null;
   static String peerId = null;
   static String rowPrefixes = null;
 
@@ -185,7 +186,8 @@ public class VerifyReplication extends Configured implements Tool {
     private void logFailRowAndIncreaseCounter(Context context, Counters counter, Result row) {
       context.getCounter(counter).increment(1);
       context.getCounter(Counters.BADROWS).increment(1);
-      LOG.error(counter.toString() + ", rowkey=" + Bytes.toString(row.getRow()));
+      LOG.error(counter.toString() + ", rowkey=" + delimiter + Bytes.toString(row.getRow()) +
+          delimiter);
     }
 
     @Override
@@ -400,6 +402,12 @@ public class VerifyReplication extends Configured implements Tool {
           printUsage("Invalid argument '" + cmd + "'");
         }
 
+        final String delimiterArgKey = "--delimiter=";
+        if (cmd.startsWith(delimiterArgKey)) {
+          delimiter = cmd.substring(delimiterArgKey.length());
+          continue;
+        }
+
         if (i == args.length-2) {
           peerId = cmd;
         }
@@ -435,7 +443,7 @@ 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] <peerid> <tablename>");
+        " [--endtime=Y] [--families=A] [--row-prefixes=B] [--delimiter=] <peerid> <tablename>");
     System.err.println();
     System.err.println("Options:");
     System.err.println(" starttime    beginning of the time range");
@@ -444,6 +452,7 @@ public class VerifyReplication extends Configured implements Tool {
     System.err.println(" versions     number of cell versions to verify");
     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();
     System.err.println("Args:");
     System.err.println(" peerid       Id of the peer used for verification, must match the one given for replication");