From ca59922702991f9163a7bfe4674e0c5ce9a14f28 Mon Sep 17 00:00:00 2001 From: Zhihong Yu Date: Wed, 22 Jan 2014 17:28:09 +0000 Subject: [PATCH] HBASE-10395 endTime won't be set in VerifyReplication if startTime is not set (Jianwei Cui) git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1560434 13f79535-47bb-0310-9956-ffa450edef68 --- .../replication/VerifyReplication.java | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) 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 d139eb3e681..0c84c6a8048 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 @@ -62,7 +62,7 @@ public class VerifyReplication { public final static String NAME = "verifyrep"; static long startTime = 0; - static long endTime = 0; + static long endTime = Long.MAX_VALUE; static String tableName = null; static String families = null; static String peerId = null; @@ -94,7 +94,7 @@ public class VerifyReplication { final Scan scan = new Scan(); scan.setCaching(conf.getInt(TableInputFormat.SCAN_CACHEDROWS, 1)); long startTime = conf.getLong(NAME + ".startTime", 0); - long endTime = conf.getLong(NAME + ".endTime", 0); + long endTime = conf.getLong(NAME + ".endTime", Long.MAX_VALUE); String families = conf.get(NAME + ".families", null); if(families != null) { String[] fams = families.split(","); @@ -102,10 +102,7 @@ public class VerifyReplication { scan.addFamily(Bytes.toBytes(fam)); } } - if (startTime != 0) { - scan.setTimeRange(startTime, - endTime == 0 ? HConstants.LATEST_TIMESTAMP : endTime); - } + scan.setTimeRange(startTime, endTime); HConnectionManager.execute(new HConnectable(conf) { @Override public Void connect(HConnection conn) throws IOException { @@ -188,10 +185,7 @@ public class VerifyReplication { job.setJarByClass(VerifyReplication.class); Scan scan = new Scan(); - if (startTime != 0) { - scan.setTimeRange(startTime, - endTime == 0 ? HConstants.LATEST_TIMESTAMP : endTime); - } + scan.setTimeRange(startTime, endTime); if(families != null) { String[] fams = families.split(","); for(String fam : fams) { @@ -265,7 +259,7 @@ public class VerifyReplication { System.err.println("Options:"); System.err.println(" starttime beginning of the time range"); System.err.println(" without endtime means from starttime to forever"); - System.err.println(" stoptime end of the time range"); + System.err.println(" endtime end of the time range"); System.err.println(" families comma-separated list of families to copy"); System.err.println(); System.err.println("Args:"); @@ -276,7 +270,7 @@ public class VerifyReplication { System.err.println(" To verify the data replicated from TestTable for a 1 hour window with peer #5 "); System.err.println(" $ bin/hbase " + "org.apache.hadoop.hbase.mapreduce.replication.VerifyReplication" + - " --starttime=1265875194289 --stoptime=1265878794289 5 TestTable "); + " --starttime=1265875194289 --endtime=1265878794289 5 TestTable "); } /**