Updated Branches: refs/heads/1.6.0-SNAPSHOT 39b22d3eb -> ae20660d8
ACCUMULO-2035 ACCUMULO-2025 I accidently made limitVersion always true instead of never true. Now proper. Also split apart the Iterator and Constraints tests in NamespacesIT Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/ae20660d Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/ae20660d Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/ae20660d Branch: refs/heads/1.6.0-SNAPSHOT Commit: ae20660d8202cf511c5dbd07b164634fa6f32126 Parents: 39b22d3 Author: John Vines <[email protected]> Authored: Mon Dec 16 18:56:40 2013 -0500 Committer: John Vines <[email protected]> Committed: Mon Dec 16 18:56:40 2013 -0500 ---------------------------------------------------------------------- .../core/client/admin/TableOperationsImpl.java | 6 ++++- .../org/apache/accumulo/test/NamespacesIT.java | 25 ++++++++++++++++---- 2 files changed, 26 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/accumulo/blob/ae20660d/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperationsImpl.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperationsImpl.java b/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperationsImpl.java index 2819031..26192ef 100644 --- a/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperationsImpl.java +++ b/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperationsImpl.java @@ -218,7 +218,11 @@ public class TableOperationsImpl extends TableOperationsHelper { List<ByteBuffer> args = Arrays.asList(ByteBuffer.wrap(tableName.getBytes()), ByteBuffer.wrap(timeType.name().getBytes())); - Map<String,String> opts = IteratorUtil.generateInitialTableProperties(limitVersion); + Map<String,String> opts; + if (limitVersion) + opts = IteratorUtil.generateInitialTableProperties(limitVersion); + else + opts = Collections.emptyMap(); try { doTableOperation(TableOperation.CREATE, args, opts); http://git-wip-us.apache.org/repos/asf/accumulo/blob/ae20660d/test/src/test/java/org/apache/accumulo/test/NamespacesIT.java ---------------------------------------------------------------------- diff --git a/test/src/test/java/org/apache/accumulo/test/NamespacesIT.java b/test/src/test/java/org/apache/accumulo/test/NamespacesIT.java index f38c944..d00334a 100644 --- a/test/src/test/java/org/apache/accumulo/test/NamespacesIT.java +++ b/test/src/test/java/org/apache/accumulo/test/NamespacesIT.java @@ -279,10 +279,10 @@ public class NamespacesIT extends SimpleMacIT { } /** - * This tests adding iterators to a namespace, listing them, and removing them as well as adding and removing constraints + * This tests adding iterators to a namespace, listing them, and removing them */ @Test - public void testNamespaceIteratorsAndConstraints() throws Exception { + public void testNamespaceIterators() throws Exception { Connector c = getConnector(); String namespace = "iterator"; @@ -307,15 +307,32 @@ public class NamespacesIT extends SimpleMacIT { assertTrue(!s.iterator().hasNext()); assertTrue(c.namespaceOperations().listIterators(namespace).containsKey(iter)); - c.namespaceOperations().removeIterator(namespace, iter, EnumSet.copyOf(scope)); + } + + /** + * This tests adding iterators to a namespace, listing them, and removing them as well as adding and removing constraints + */ + @Test + public void testNamespaceConstraints() throws Exception { + Connector c = getConnector(); + + String namespace = "iterator"; + String tableName = namespace + ".table"; + String iter = "thing"; + + c.namespaceOperations().create(namespace); + c.tableOperations().create(tableName, false); + + c.namespaceOperations().removeIterator(namespace, iter, EnumSet.of(IteratorScope.scan)); c.namespaceOperations().addConstraint(namespace, NumericValueConstraint.class.getName()); // doesn't take effect immediately, needs time to propagate UtilWaitThread.sleep(250); - m = new Mutation("rowy"); + Mutation m = new Mutation("rowy"); m.put("a", "b", new Value("abcde".getBytes(Constants.UTF8))); try { + BatchWriter bw = c.createBatchWriter(tableName, new BatchWriterConfig()); bw.addMutation(m); bw.flush(); bw.close();
