accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ctubb...@apache.org
Subject [3/6] accumulo git commit: ACCUMULO-3029 Fix broken bulk example
Date Fri, 29 May 2015 20:29:28 GMT
ACCUMULO-3029 Fix broken bulk example

* Fix VerifyIngest to match GenerateTestData
* Execute VerifyIngest in ExamplesIT


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

Branch: refs/heads/master
Commit: 182fbce76fed21554abc7dfaae1a2cc016e5727e
Parents: 55a9c8a
Author: Christopher Tubbs <ctubbsii@apache.org>
Authored: Fri May 29 15:33:49 2015 -0400
Committer: Christopher Tubbs <ctubbsii@apache.org>
Committed: Fri May 29 15:33:49 2015 -0400

----------------------------------------------------------------------
 .../simple/mapreduce/bulk/VerifyIngest.java       | 18 +++++++++++-------
 .../accumulo/test/functional/ExamplesIT.java      |  2 ++
 2 files changed, 13 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/182fbce7/examples/simple/src/main/java/org/apache/accumulo/examples/simple/mapreduce/bulk/VerifyIngest.java
----------------------------------------------------------------------
diff --git a/examples/simple/src/main/java/org/apache/accumulo/examples/simple/mapreduce/bulk/VerifyIngest.java
b/examples/simple/src/main/java/org/apache/accumulo/examples/simple/mapreduce/bulk/VerifyIngest.java
index 846eaf7..1385a19 100644
--- a/examples/simple/src/main/java/org/apache/accumulo/examples/simple/mapreduce/bulk/VerifyIngest.java
+++ b/examples/simple/src/main/java/org/apache/accumulo/examples/simple/mapreduce/bulk/VerifyIngest.java
@@ -50,7 +50,7 @@ public class VerifyIngest {
     Connector connector = opts.getConnector();
     Scanner scanner = connector.createScanner(opts.tableName, opts.auths);
 
-    scanner.setRange(new Range(new Text(String.format("row_%08d", opts.startRow)), null));
+    scanner.setRange(new Range(new Text(String.format("row_%010d", opts.startRow)), null));
 
     Iterator<Entry<Key,Value>> si = scanner.iterator();
 
@@ -61,26 +61,30 @@ public class VerifyIngest {
       if (si.hasNext()) {
         Entry<Key,Value> entry = si.next();
 
-        if (!entry.getKey().getRow().toString().equals(String.format("row_%08d", i))) {
-          log.error("unexpected row key " + entry.getKey().getRow().toString() + " expected
" + String.format("row_%08d", i));
+        if (!entry.getKey().getRow().toString().equals(String.format("row_%010d", i))) {
+          log.error("unexpected row key " + entry.getKey().getRow().toString() + " expected
" + String.format("row_%010d", i));
           ok = false;
         }
 
-        if (!entry.getValue().toString().equals(String.format("value_%08d", i))) {
-          log.error("unexpected value " + entry.getValue().toString() + " expected " + String.format("value_%08d",
i));
+        if (!entry.getValue().toString().equals(String.format("value_%010d", i))) {
+          log.error("unexpected value " + entry.getValue().toString() + " expected " + String.format("value_%010d",
i));
           ok = false;
         }
 
       } else {
-        log.error("no more rows, expected " + String.format("row_%08d", i));
+        log.error("no more rows, expected " + String.format("row_%010d", i));
         ok = false;
         break;
       }
 
     }
 
-    if (ok)
+    if (ok) {
       System.out.println("OK");
+      System.exit(0);
+    } else {
+      System.exit(1);
+    }
   }
 
 }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/182fbce7/test/src/test/java/org/apache/accumulo/test/functional/ExamplesIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/ExamplesIT.java b/test/src/test/java/org/apache/accumulo/test/functional/ExamplesIT.java
index 18e9ad5..3204528 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/ExamplesIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/ExamplesIT.java
@@ -71,6 +71,7 @@ import org.apache.accumulo.examples.simple.mapreduce.WordCount;
 import org.apache.accumulo.examples.simple.mapreduce.bulk.BulkIngestExample;
 import org.apache.accumulo.examples.simple.mapreduce.bulk.GenerateTestData;
 import org.apache.accumulo.examples.simple.mapreduce.bulk.SetupTable;
+import org.apache.accumulo.examples.simple.mapreduce.bulk.VerifyIngest;
 import org.apache.accumulo.examples.simple.shard.ContinuousQuery;
 import org.apache.accumulo.examples.simple.shard.Index;
 import org.apache.accumulo.examples.simple.shard.Query;
@@ -352,6 +353,7 @@ public class ExamplesIT extends AccumuloClusterIT {
     goodExec(SetupTable.class, "-i", instance, "-z", keepers, "-u", user, "-p", passwd, "--table",
tableName);
     goodExec(BulkIngestExample.class, "-i", instance, "-z", keepers, "-u", user, "-p", passwd,
"--table", tableName, "--inputDir", dir + "/tmp/input",
         "--workDir", dir + "/tmp");
+    goodExec(VerifyIngest.class, "-i", instance, "-z", keepers, "-u", user, "-p", passwd,
"--table", tableName, "--start-row", "0", "--count", "10000");
   }
 
   @Test


Mime
View raw message