hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apurt...@apache.org
Subject [1/9] git commit: HBASE-11706 Set versions for VerifyReplication (cuijianwei)
Date Sat, 09 Aug 2014 02:36:27 GMT
Repository: hbase
Updated Branches:
  refs/heads/0.98 800000c1e -> 67c232326
  refs/heads/branch-1 1669bc44c -> b8f2f67d4
  refs/heads/master fa46724f3 -> 12d4a42e7


HBASE-11706 Set versions for VerifyReplication (cuijianwei)


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

Branch: refs/heads/master
Commit: 3c03dcb1b9422c8afa06fc427c5de1d3dca5ae6c
Parents: fa46724
Author: Andrew Purtell <apurtell@apache.org>
Authored: Fri Aug 8 18:30:47 2014 -0700
Committer: Andrew Purtell <apurtell@apache.org>
Committed: Fri Aug 8 18:30:47 2014 -0700

----------------------------------------------------------------------
 .../mapreduce/replication/VerifyReplication.java      | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/3c03dcb1/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 d4ac8f7..7748675 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
@@ -69,6 +69,7 @@ public class VerifyReplication extends Configured implements Tool {
   public final static String NAME = "verifyrep";
   static long startTime = 0;
   static long endTime = Long.MAX_VALUE;
+  static int versions = -1;
   static String tableName = null;
   static String families = null;
   static String peerId = null;
@@ -109,6 +110,9 @@ public class VerifyReplication extends Configured implements Tool {
           }
         }
         scan.setTimeRange(startTime, endTime);
+        if (versions >= 0) {
+          scan.setMaxVersions(versions);
+        }
         HConnectionManager.execute(new HConnectable<Void>(conf) {
           @Override
           public Void connect(HConnection conn) throws IOException {
@@ -208,6 +212,9 @@ public class VerifyReplication extends Configured implements Tool {
 
     Scan scan = new Scan();
     scan.setTimeRange(startTime, endTime);
+    if (versions >= 0) {
+      scan.setMaxVersions(versions);
+    }
     if(families != null) {
       String[] fams = families.split(",");
       for(String fam : fams) {
@@ -250,6 +257,12 @@ public class VerifyReplication extends Configured implements Tool {
           continue;
         }
 
+        final String versionsArgKey = "--versions=";
+        if (cmd.startsWith(versionsArgKey)) {
+          versions = Integer.parseInt(cmd.substring(versionsArgKey.length()));
+          continue;
+        }
+
         final String familiesArgKey = "--families=";
         if (cmd.startsWith(familiesArgKey)) {
           families = cmd.substring(familiesArgKey.length());
@@ -286,6 +299,7 @@ public class VerifyReplication extends Configured implements Tool {
     System.err.println(" starttime    beginning of the time range");
     System.err.println("              without endtime means from starttime to forever");
     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();
     System.err.println("Args:");


Mime
View raw message