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 e6b4802..bbb3cfe 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 @@ -75,6 +75,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; private final static String JOB_NAME_CONF_KEY = "mapreduce.job.name"; @@ -175,7 +176,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 @@ -345,6 +347,12 @@ public class VerifyReplication extends Configured implements Tool { continue; } + final String delimiterArgKey = "--delimiter="; + if (cmd.startsWith(delimiterArgKey)) { + delimiter = cmd.substring(delimiterArgKey.length()); + continue; + } + if (i == args.length-2) { peerId = cmd; } @@ -369,7 +377,7 @@ public class VerifyReplication extends Configured implements Tool { System.err.println("ERROR: " + errorMsg); } System.err.println("Usage: verifyrep [--starttime=X]" + - " [--stoptime=Y] [--families=A] "); + " [--stoptime=Y] [--families=A] [--delimiter=] "); System.err.println(); System.err.println("Options:"); System.err.println(" starttime beginning of the time range"); @@ -377,6 +385,7 @@ public class VerifyReplication extends Configured implements Tool { System.err.println(" endtime end of the time range"); System.err.println(" versions number of cell versions to verify"); System.err.println(" families comma-separated list of families to copy"); + 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");