You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by el...@apache.org on 2015/05/19 23:25:10 UTC

[1/3] accumulo git commit: ACCUMULO-3834 Verify the test client can see constraints before proceeding

Repository: accumulo
Updated Branches:
  refs/heads/1.7 f3c1c3fdb -> ed5b53b93
  refs/heads/master 96733f7e0 -> e22103ca9


ACCUMULO-3834 Verify the test client can see constraints before proceeding


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

Branch: refs/heads/1.7
Commit: ed5b53b9329a8531ac9d7475392001f5c0f52a84
Parents: f3c1c3f
Author: Josh Elser <jo...@gmail.com>
Authored: Tue May 19 17:22:51 2015 -0400
Committer: Josh Elser <jo...@gmail.com>
Committed: Tue May 19 17:23:55 2015 -0400

----------------------------------------------------------------------
 .../accumulo/test/functional/ConstraintIT.java  | 24 ++++++++++++++++----
 1 file changed, 20 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/ed5b53b9/test/src/test/java/org/apache/accumulo/test/functional/ConstraintIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/ConstraintIT.java b/test/src/test/java/org/apache/accumulo/test/functional/ConstraintIT.java
index a8ee9d9..c694143 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/ConstraintIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/ConstraintIT.java
@@ -21,6 +21,7 @@ import static java.nio.charset.StandardCharsets.UTF_8;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
+import java.util.Map;
 import java.util.Map.Entry;
 
 import org.apache.accumulo.core.client.BatchWriter;
@@ -41,8 +42,11 @@ import org.apache.accumulo.examples.simple.constraints.NumericValueConstraint;
 import org.apache.accumulo.harness.AccumuloClusterIT;
 import org.apache.hadoop.io.Text;
 import org.junit.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class ConstraintIT extends AccumuloClusterIT {
+  private static final Logger log = LoggerFactory.getLogger(ConstraintIT.class);
 
   @Override
   protected int defaultTimeoutSeconds() {
@@ -59,12 +63,24 @@ public class ConstraintIT extends AccumuloClusterIT {
       c.tableOperations().addConstraint(table, AlphaNumKeyConstraint.class.getName());
     }
 
-    // Logger logger = Logger.getLogger(Constants.CORE_PACKAGE_NAME);
-    // logger.setLevel(Level.TRACE);
+    // A static sleep to just let ZK do its thing
+    Thread.sleep(10 * 1000);
 
-    test1(tableNames[0]);
+    // Then check that the client has at least gotten the updates
+    for (String table : tableNames) {
+      log.debug("Checking constraints on {}", table);
+      Map<String,Integer> constraints = c.tableOperations().listConstraints(table);
+      while (!constraints.containsKey(NumericValueConstraint.class.getName()) || !constraints.containsKey(AlphaNumKeyConstraint.class.getName())) {
+        log.debug("Failed to verify constraints. Sleeping and retrying");
+        Thread.sleep(2000);
+        constraints = c.tableOperations().listConstraints(table);
+      }
+      log.debug("Verified all constraints on {}", table);
+    }
+
+    log.debug("Verified constraints on all tables. Running tests");
 
-    // logger.setLevel(Level.TRACE);
+    test1(tableNames[0]);
 
     test2(tableNames[1], false);
     test2(tableNames[2], true);


[3/3] accumulo git commit: Merge branch '1.7'

Posted by el...@apache.org.
Merge branch '1.7'


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

Branch: refs/heads/master
Commit: e22103ca9920b734c46f5d4fa0f5fb36c01548e5
Parents: 96733f7 ed5b53b
Author: Josh Elser <jo...@gmail.com>
Authored: Tue May 19 17:24:38 2015 -0400
Committer: Josh Elser <jo...@gmail.com>
Committed: Tue May 19 17:24:38 2015 -0400

----------------------------------------------------------------------
 .../accumulo/test/functional/ConstraintIT.java  | 24 ++++++++++++++++----
 1 file changed, 20 insertions(+), 4 deletions(-)
----------------------------------------------------------------------



[2/3] accumulo git commit: ACCUMULO-3834 Verify the test client can see constraints before proceeding

Posted by el...@apache.org.
ACCUMULO-3834 Verify the test client can see constraints before proceeding


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

Branch: refs/heads/master
Commit: ed5b53b9329a8531ac9d7475392001f5c0f52a84
Parents: f3c1c3f
Author: Josh Elser <jo...@gmail.com>
Authored: Tue May 19 17:22:51 2015 -0400
Committer: Josh Elser <jo...@gmail.com>
Committed: Tue May 19 17:23:55 2015 -0400

----------------------------------------------------------------------
 .../accumulo/test/functional/ConstraintIT.java  | 24 ++++++++++++++++----
 1 file changed, 20 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/ed5b53b9/test/src/test/java/org/apache/accumulo/test/functional/ConstraintIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/ConstraintIT.java b/test/src/test/java/org/apache/accumulo/test/functional/ConstraintIT.java
index a8ee9d9..c694143 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/ConstraintIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/ConstraintIT.java
@@ -21,6 +21,7 @@ import static java.nio.charset.StandardCharsets.UTF_8;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
+import java.util.Map;
 import java.util.Map.Entry;
 
 import org.apache.accumulo.core.client.BatchWriter;
@@ -41,8 +42,11 @@ import org.apache.accumulo.examples.simple.constraints.NumericValueConstraint;
 import org.apache.accumulo.harness.AccumuloClusterIT;
 import org.apache.hadoop.io.Text;
 import org.junit.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class ConstraintIT extends AccumuloClusterIT {
+  private static final Logger log = LoggerFactory.getLogger(ConstraintIT.class);
 
   @Override
   protected int defaultTimeoutSeconds() {
@@ -59,12 +63,24 @@ public class ConstraintIT extends AccumuloClusterIT {
       c.tableOperations().addConstraint(table, AlphaNumKeyConstraint.class.getName());
     }
 
-    // Logger logger = Logger.getLogger(Constants.CORE_PACKAGE_NAME);
-    // logger.setLevel(Level.TRACE);
+    // A static sleep to just let ZK do its thing
+    Thread.sleep(10 * 1000);
 
-    test1(tableNames[0]);
+    // Then check that the client has at least gotten the updates
+    for (String table : tableNames) {
+      log.debug("Checking constraints on {}", table);
+      Map<String,Integer> constraints = c.tableOperations().listConstraints(table);
+      while (!constraints.containsKey(NumericValueConstraint.class.getName()) || !constraints.containsKey(AlphaNumKeyConstraint.class.getName())) {
+        log.debug("Failed to verify constraints. Sleeping and retrying");
+        Thread.sleep(2000);
+        constraints = c.tableOperations().listConstraints(table);
+      }
+      log.debug("Verified all constraints on {}", table);
+    }
+
+    log.debug("Verified constraints on all tables. Running tests");
 
-    // logger.setLevel(Level.TRACE);
+    test1(tableNames[0]);
 
     test2(tableNames[1], false);
     test2(tableNames[2], true);