Return-Path: X-Original-To: apmail-accumulo-commits-archive@www.apache.org Delivered-To: apmail-accumulo-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 89DCB102F4 for ; Mon, 16 Dec 2013 23:58:19 +0000 (UTC) Received: (qmail 74285 invoked by uid 500); 16 Dec 2013 23:58:19 -0000 Delivered-To: apmail-accumulo-commits-archive@accumulo.apache.org Received: (qmail 74263 invoked by uid 500); 16 Dec 2013 23:58:19 -0000 Mailing-List: contact commits-help@accumulo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@accumulo.apache.org Delivered-To: mailing list commits@accumulo.apache.org Received: (qmail 74255 invoked by uid 99); 16 Dec 2013 23:58:19 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 Dec 2013 23:58:19 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 3F6BF82A3E6; Mon, 16 Dec 2013 23:58:19 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: vines@apache.org To: commits@accumulo.apache.org Date: Mon, 16 Dec 2013 23:58:19 -0000 Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: [1/2] git commit: ACCUMULO-2035 ACCUMULO-2025 I accidently made limitVersion always true instead of never true. Now proper. Updated Branches: refs/heads/master 02add1ddd -> c761b59e0 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/master Commit: ae20660d8202cf511c5dbd07b164634fa6f32126 Parents: 39b22d3 Author: John Vines Authored: Mon Dec 16 18:56:40 2013 -0500 Committer: John Vines 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 args = Arrays.asList(ByteBuffer.wrap(tableName.getBytes()), ByteBuffer.wrap(timeType.name().getBytes())); - Map opts = IteratorUtil.generateInitialTableProperties(limitVersion); + Map 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();