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-16409 Row key for bad row should be properly delimited in VerifyReplication
Date Sun, 21 Aug 2016 00:19:45 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-1 b3ca9a9b2 -> d260108e3


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

Branch: refs/heads/branch-1
Commit: d260108e39eb41853fa5856885db82236cf3dbca
Parents: b3ca9a9
Author: tedyu <yuzhihong@gmail.com>
Authored: Sat Aug 20 17:18:27 2016 -0700
Committer: tedyu <yuzhihong@gmail.com>
Committed: Sat Aug 20 17:18:27 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/d260108e/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 a7b38ff..11e12bd 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
@@ -79,6 +79,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;
 
@@ -183,7 +184,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
@@ -396,6 +398,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;
         }
@@ -431,7 +439,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");
@@ -440,6 +448,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");


Mime
View raw message