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 6E84A10B39 for ; Tue, 18 Feb 2014 17:09:47 +0000 (UTC) Received: (qmail 97864 invoked by uid 500); 18 Feb 2014 17:09:44 -0000 Delivered-To: apmail-accumulo-commits-archive@accumulo.apache.org Received: (qmail 97768 invoked by uid 500); 18 Feb 2014 17:09:44 -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 97751 invoked by uid 99); 18 Feb 2014 17:09:43 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 18 Feb 2014 17:09:43 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 6F60692ACDA; Tue, 18 Feb 2014 17:09:43 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: ecn@apache.org To: commits@accumulo.apache.org Date: Tue, 18 Feb 2014 17:09:44 -0000 Message-Id: <802eaf1828044f518904e72448cee056@git.apache.org> In-Reply-To: <646a703e2cf6476292066c196404fc23@git.apache.org> References: <646a703e2cf6476292066c196404fc23@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [2/3] git commit: Merge branch '1.5.1-SNAPSHOT' into 1.6.0-SNAPSHOT Merge branch '1.5.1-SNAPSHOT' into 1.6.0-SNAPSHOT Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/6c91e349 Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/6c91e349 Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/6c91e349 Branch: refs/heads/master Commit: 6c91e3491ce87cfe06c36d10fab402a6d96cb926 Parents: 7908193 b0d5808 Author: Eric Newton Authored: Tue Feb 18 12:09:29 2014 -0500 Committer: Eric Newton Committed: Tue Feb 18 12:09:29 2014 -0500 ---------------------------------------------------------------------- .../accumulo/test/DeleteTableDuringSplitIT.java | 126 ------------------- .../functional/DeleteTableDuringSplitIT.java | 86 +++++++++++++ 2 files changed, 86 insertions(+), 126 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/accumulo/blob/6c91e349/test/src/test/java/org/apache/accumulo/test/DeleteTableDuringSplitIT.java ---------------------------------------------------------------------- diff --cc test/src/test/java/org/apache/accumulo/test/DeleteTableDuringSplitIT.java index 65b39a7,65b39a7..0000000 deleted file mode 100644,100644 --- a/test/src/test/java/org/apache/accumulo/test/DeleteTableDuringSplitIT.java +++ /dev/null @@@ -1,126 -1,126 +1,0 @@@ --/* -- * Licensed to the Apache Software Foundation (ASF) under one or more -- * contributor license agreements. See the NOTICE file distributed with -- * this work for additional information regarding copyright ownership. -- * The ASF licenses this file to You under the Apache License, Version 2.0 -- * (the "License"); you may not use this file except in compliance with -- * the License. You may obtain a copy of the License at -- * -- * http://www.apache.org/licenses/LICENSE-2.0 -- * -- * Unless required by applicable law or agreed to in writing, software -- * distributed under the License is distributed on an "AS IS" BASIS, -- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- * See the License for the specific language governing permissions and -- * limitations under the License. -- */ --package org.apache.accumulo.test; -- --import static org.junit.Assert.assertFalse; -- --import java.util.ArrayList; --import java.util.List; --import java.util.SortedSet; --import java.util.TreeSet; --import java.util.concurrent.Future; -- --import org.apache.accumulo.core.client.AccumuloException; --import org.apache.accumulo.core.client.AccumuloSecurityException; --import org.apache.accumulo.core.client.Connector; --import org.apache.accumulo.core.client.TableNotFoundException; --import org.apache.accumulo.core.client.ZooKeeperInstance; --import org.apache.accumulo.core.client.security.tokens.PasswordToken; --import org.apache.accumulo.core.util.SimpleThreadPool; --import org.apache.accumulo.fate.util.UtilWaitThread; --import org.apache.accumulo.minicluster.MiniAccumuloCluster; --import org.apache.hadoop.io.Text; --import org.junit.After; --import org.junit.Before; --import org.junit.Test; --import org.junit.rules.TemporaryFolder; -- --// ACCUMULO-2361 --public class DeleteTableDuringSplitIT { -- public static TemporaryFolder folder = new TemporaryFolder(); -- private MiniAccumuloCluster accumulo; -- private String secret = "secret"; -- -- Connector getConnector() throws AccumuloException, AccumuloSecurityException { -- ZooKeeperInstance zki = new ZooKeeperInstance(accumulo.getInstanceName(), accumulo.getZooKeepers()); -- return zki.getConnector("root", new PasswordToken(secret)); -- } -- -- String[] getTableNames(int n) { -- String[] result = new String[n]; -- for (int i = 0; i < n; i++) { -- result[i] = "test_" + i; -- } -- return result; -- } -- -- @Before -- public void setUp() throws Exception { -- folder.create(); -- accumulo = new MiniAccumuloCluster(folder.getRoot(), secret); -- accumulo.start(); -- } -- -- @After -- public void tearDown() throws Exception { -- accumulo.stop(); -- //folder.delete(); -- } -- -- -- @Test(timeout= 10 * 60 * 1000) -- public void test() throws Exception { -- String[] tableNames = getTableNames(100); -- // make a bunch of tables -- for (String tableName : tableNames) { -- getConnector().tableOperations().create(tableName); -- } -- final SortedSet splits = new TreeSet(); -- for (byte i = 0; i < 100; i++) { -- splits.add(new Text(new byte[]{0, 0, i})); -- } -- -- List> results = new ArrayList>(); -- List tasks = new ArrayList(); -- SimpleThreadPool es = new SimpleThreadPool(tableNames.length, "concurrent-api-requests"); -- for (String tableName : tableNames) { -- final String finalName = tableName; -- tasks.add(new Runnable() { -- @Override -- public void run() { -- try { -- getConnector().tableOperations().addSplits(finalName, splits); -- } catch (TableNotFoundException ex) { -- } catch (Exception ex) { -- throw new RuntimeException(finalName, ex); -- } -- } -- }); -- tasks.add(new Runnable() { -- @Override -- public void run() { -- try { -- UtilWaitThread.sleep(500); -- getConnector().tableOperations().delete(finalName); -- } catch (Exception ex) { -- throw new RuntimeException(ex); -- } -- } -- }); -- } -- //Collections.shuffle(tasks); -- for (Runnable r : tasks) -- results.add(es.submit(r)); -- for (Future f : results) { -- f.get(); -- } -- for (String tableName : tableNames) { -- assertFalse(getConnector().tableOperations().exists(tableName)); -- } -- } -- --} http://git-wip-us.apache.org/repos/asf/accumulo/blob/6c91e349/test/src/test/java/org/apache/accumulo/test/functional/DeleteTableDuringSplitIT.java ---------------------------------------------------------------------- diff --cc test/src/test/java/org/apache/accumulo/test/functional/DeleteTableDuringSplitIT.java index 0000000,0000000..cf96302 new file mode 100644 --- /dev/null +++ b/test/src/test/java/org/apache/accumulo/test/functional/DeleteTableDuringSplitIT.java @@@ -1,0 -1,0 +1,86 @@@ ++/* ++ * Licensed to the Apache Software Foundation (ASF) under one or more ++ * contributor license agreements. See the NOTICE file distributed with ++ * this work for additional information regarding copyright ownership. ++ * The ASF licenses this file to You under the Apache License, Version 2.0 ++ * (the "License"); you may not use this file except in compliance with ++ * the License. You may obtain a copy of the License at ++ * ++ * http://www.apache.org/licenses/LICENSE-2.0 ++ * ++ * Unless required by applicable law or agreed to in writing, software ++ * distributed under the License is distributed on an "AS IS" BASIS, ++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++ * See the License for the specific language governing permissions and ++ * limitations under the License. ++ */ ++package org.apache.accumulo.test.functional; ++ ++import static org.junit.Assert.assertFalse; ++ ++import java.util.ArrayList; ++import java.util.List; ++import java.util.SortedSet; ++import java.util.TreeSet; ++import java.util.concurrent.Future; ++ ++import org.apache.accumulo.core.client.TableNotFoundException; ++import org.apache.accumulo.core.util.SimpleThreadPool; ++import org.apache.accumulo.fate.util.UtilWaitThread; ++import org.apache.hadoop.io.Text; ++import org.junit.Test; ++ ++// ACCUMULO-2361 ++public class DeleteTableDuringSplitIT extends SimpleMacIT { ++ ++ @Test(timeout= 10 * 60 * 1000) ++ public void test() throws Exception { ++ String[] tableNames = getTableNames(100); ++ // make a bunch of tables ++ for (String tableName : tableNames) { ++ getConnector().tableOperations().create(tableName); ++ } ++ final SortedSet splits = new TreeSet(); ++ for (byte i = 0; i < 100; i++) { ++ splits.add(new Text(new byte[]{0, 0, i})); ++ } ++ ++ List> results = new ArrayList>(); ++ List tasks = new ArrayList(); ++ SimpleThreadPool es = new SimpleThreadPool(tableNames.length, "concurrent-api-requests"); ++ for (String tableName : tableNames) { ++ final String finalName = tableName; ++ tasks.add(new Runnable() { ++ @Override ++ public void run() { ++ try { ++ getConnector().tableOperations().addSplits(finalName, splits); ++ } catch (TableNotFoundException ex) { ++ } catch (Exception ex) { ++ throw new RuntimeException(finalName, ex); ++ } ++ } ++ }); ++ tasks.add(new Runnable() { ++ @Override ++ public void run() { ++ try { ++ UtilWaitThread.sleep(500); ++ getConnector().tableOperations().delete(finalName); ++ } catch (Exception ex) { ++ throw new RuntimeException(ex); ++ } ++ } ++ }); ++ } ++ for (Runnable r : tasks) ++ results.add(es.submit(r)); ++ for (Future f : results) { ++ f.get(); ++ } ++ for (String tableName : tableNames) { ++ assertFalse(getConnector().tableOperations().exists(tableName)); ++ } ++ } ++ ++}