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 <eric.new...@gmail.com>
Authored: Tue Feb 18 12:09:29 2014 -0500
Committer: Eric Newton <eric.new...@gmail.com>
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<Text> splits = new TreeSet<Text>();
--    for (byte i = 0; i < 100; i++) {
--      splits.add(new Text(new byte[]{0, 0, i}));
--    }
--
--    List<Future<?>> results = new ArrayList<Future<?>>();
--    List<Runnable> tasks = new ArrayList<Runnable>();
--    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<Text> splits = new TreeSet<Text>();
++    for (byte i = 0; i < 100; i++) {
++      splits.add(new Text(new byte[]{0, 0, i}));
++    }
++
++    List<Future<?>> results = new ArrayList<Future<?>>();
++    List<Runnable> tasks = new ArrayList<Runnable>();
++    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));
++    }
++  }
++
++}

Reply via email to