You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by ec...@apache.org on 2013/07/09 21:50:08 UTC

svn commit: r1501497 [2/2] - in /accumulo/trunk: core/src/main/java/org/apache/accumulo/core/cli/ minicluster/src/main/java/org/apache/accumulo/minicluster/ server/src/main/java/org/apache/accumulo/server/tabletserver/ test/src/main/java/org/apache/acc...

Modified: accumulo/trunk/test/src/test/java/org/apache/accumulo/test/functional/TableIT.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/test/src/test/java/org/apache/accumulo/test/functional/TableIT.java?rev=1501497&r1=1501496&r2=1501497&view=diff
==============================================================================
--- accumulo/trunk/test/src/test/java/org/apache/accumulo/test/functional/TableIT.java (original)
+++ accumulo/trunk/test/src/test/java/org/apache/accumulo/test/functional/TableIT.java Tue Jul  9 19:50:06 2013
@@ -26,6 +26,7 @@ import org.apache.accumulo.core.cli.Batc
 import org.apache.accumulo.core.cli.ScannerOpts;
 import org.apache.accumulo.core.client.Connector;
 import org.apache.accumulo.core.client.Scanner;
+import org.apache.accumulo.core.client.admin.TableOperations;
 import org.apache.accumulo.core.data.Key;
 import org.apache.accumulo.core.data.KeyExtent;
 import org.apache.accumulo.core.data.Value;
@@ -45,12 +46,13 @@ public class TableIT extends MacTest {
   @Test(timeout = 60 * 1000)
   public void test() throws Exception {
     Connector c = getConnector();
-    c.tableOperations().create("test_ingest");
+    TableOperations to = c.tableOperations();
+    to.create("test_ingest");
     TestIngest.Opts opts = new TestIngest.Opts();
     TestIngest.ingest(c, opts, new BatchWriterOpts());
     VerifyIngest.Opts vopts = new VerifyIngest.Opts();
     VerifyIngest.verifyIngest(c, vopts, new ScannerOpts());
-    String id = c.tableOperations().tableIdMap().get("test_ingest");
+    String id = to.tableIdMap().get("test_ingest");
     Scanner s = c.createScanner(MetadataTable.NAME, Authorizations.EMPTY);
     s.setRange(new KeyExtent(new Text(id), null, null).toMetadataRange());
     int count = 0;
@@ -61,7 +63,7 @@ public class TableIT extends MacTest {
     assertTrue(count > 0);
     FileSystem fs = FileSystem.get(CachedConfiguration.getInstance());
     assertTrue(fs.listStatus(new Path(cluster.getConfig().getDir() + "/accumulo/tables/" + id)).length > 0);
-    c.tableOperations().delete("test_ingest");
+    to.delete("test_ingest");
     count = 0;
     for (@SuppressWarnings("unused")
     Entry<Key,Value> entry : s) {
@@ -69,10 +71,11 @@ public class TableIT extends MacTest {
     }
     assertEquals(0, count);
     assertEquals(0, fs.listStatus(new Path(cluster.getConfig().getDir() + "/accumulo/tables/" + id)).length);
-    assertNull(c.tableOperations().tableIdMap().get("test_ingest"));
-    c.tableOperations().create("test_ingest");
+    assertNull(to.tableIdMap().get("test_ingest"));
+    to.create("test_ingest");
     TestIngest.ingest(c, opts, new BatchWriterOpts());
     VerifyIngest.verifyIngest(c, vopts, new ScannerOpts());
+    to.delete("test_ingest");
     assertEquals(0, cluster.exec(Admin.class, "stopAll").waitFor());
   }
   

Modified: accumulo/trunk/test/src/test/java/org/apache/accumulo/test/functional/TimeoutIT.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/test/src/test/java/org/apache/accumulo/test/functional/TimeoutIT.java?rev=1501497&r1=1501496&r2=1501497&view=diff
==============================================================================
--- accumulo/trunk/test/src/test/java/org/apache/accumulo/test/functional/TimeoutIT.java (original)
+++ accumulo/trunk/test/src/test/java/org/apache/accumulo/test/functional/TimeoutIT.java Tue Jul  9 19:50:06 2013
@@ -66,9 +66,9 @@ public class TimeoutIT extends MacTest {
       bw.close();
       fail("batch writer did not timeout");
     } catch (MutationsRejectedException mre) {
-      if (!(mre.getCause() instanceof TimedOutException)) {
-        throw mre;
-      }
+      if (mre.getCause() instanceof TimedOutException)
+        return;
+      throw mre;
     }
   }
   

Modified: accumulo/trunk/test/src/test/java/org/apache/accumulo/test/functional/VisibilityIT.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/test/src/test/java/org/apache/accumulo/test/functional/VisibilityIT.java?rev=1501497&r1=1501496&r2=1501497&view=diff
==============================================================================
--- accumulo/trunk/test/src/test/java/org/apache/accumulo/test/functional/VisibilityIT.java (original)
+++ accumulo/trunk/test/src/test/java/org/apache/accumulo/test/functional/VisibilityIT.java Tue Jul  9 19:50:06 2013
@@ -46,7 +46,7 @@ import org.junit.Test;
 
 public class VisibilityIT extends MacTest {
   
-  @Test
+  @Test(timeout=30*1000)
   public void run() throws Exception {
     Connector c = getConnector();
     c.tableOperations().create("vt");

Added: accumulo/trunk/test/src/test/java/org/apache/accumulo/test/functional/WriteAheadLogIT.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/test/src/test/java/org/apache/accumulo/test/functional/WriteAheadLogIT.java?rev=1501497&view=auto
==============================================================================
--- accumulo/trunk/test/src/test/java/org/apache/accumulo/test/functional/WriteAheadLogIT.java (added)
+++ accumulo/trunk/test/src/test/java/org/apache/accumulo/test/functional/WriteAheadLogIT.java Tue Jul  9 19:50:06 2013
@@ -0,0 +1,69 @@
+/*
+ * 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.*;
+
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.accumulo.core.cli.BatchWriterOpts;
+import org.apache.accumulo.core.cli.ScannerOpts;
+import org.apache.accumulo.core.client.Connector;
+import org.apache.accumulo.core.conf.Property;
+import org.apache.accumulo.minicluster.MiniAccumuloConfig;
+import org.apache.accumulo.minicluster.ProcessReference;
+import org.apache.accumulo.minicluster.ServerType;
+import org.apache.accumulo.server.util.Admin;
+import org.apache.accumulo.test.TestIngest;
+import org.apache.accumulo.test.VerifyIngest;
+import org.junit.Test;
+
+public class WriteAheadLogIT extends MacTest {
+  
+  @Override
+  public void configure(MiniAccumuloConfig cfg) {
+    Map<String, String> siteConfig = new HashMap<String, String>();
+    siteConfig.put(Property.TSERV_WALOG_MAX_SIZE.getKey(), "2M");
+    siteConfig.put(Property.GC_CYCLE_DELAY.getKey(), "1");
+    siteConfig.put(Property.GC_CYCLE_START.getKey(), "1");
+    siteConfig.put(Property.MASTER_RECOVERY_DELAY.getKey(), "0");
+    siteConfig.put(Property.TSERV_MAXMEM.getKey(), "200K");
+    siteConfig.put(Property.TSERV_MAJC_DELAY.getKey(), "1");
+  }
+
+  @Test(timeout=60*1000)
+  public void test() throws Exception {
+    Connector c = getConnector();
+    c.tableOperations().create("test_ingest");
+    c.tableOperations().setProperty("test_ingest", Property.TABLE_SPLIT_THRESHOLD.getKey(), "750K");
+    TestIngest.Opts opts = new TestIngest.Opts();
+    TestIngest.ingest(c, opts, new BatchWriterOpts());
+    VerifyIngest.Opts vopts = new VerifyIngest.Opts();
+    VerifyIngest.verifyIngest(c, vopts, new ScannerOpts());
+    Map<ServerType,Collection<ProcessReference>> processes = cluster.getProcesses();
+    for (ProcessReference tserver : processes.get(ServerType.TABLET_SERVER)) {
+      cluster.killProcess(ServerType.TABLET_SERVER, tserver);
+    }
+    assertEquals(0, cluster.getProcesses().get(ServerType.TABLET_SERVER).size());
+    cluster.start();
+    VerifyIngest.verifyIngest(c, vopts, new ScannerOpts());
+    assertEquals(0, cluster.exec(Admin.class, "stopAll").waitFor());
+  }
+  
+}

Propchange: accumulo/trunk/test/src/test/java/org/apache/accumulo/test/functional/WriteAheadLogIT.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: accumulo/trunk/test/src/test/java/org/apache/accumulo/test/functional/ZooCacheIT.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/test/src/test/java/org/apache/accumulo/test/functional/ZooCacheIT.java?rev=1501497&view=auto
==============================================================================
--- accumulo/trunk/test/src/test/java/org/apache/accumulo/test/functional/ZooCacheIT.java (added)
+++ accumulo/trunk/test/src/test/java/org/apache/accumulo/test/functional/ZooCacheIT.java Tue Jul  9 19:50:06 2013
@@ -0,0 +1,55 @@
+/*
+ * 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.*;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.atomic.AtomicReference;
+
+import org.junit.Test;
+
+public class ZooCacheIT extends MacTest {
+  
+  @Test(timeout=200*1000)
+  public void test() throws Exception {
+    assertEquals(0, cluster.exec(CacheTestClean.class, "/zcTest-42", "/tmp/zcTest-42").waitFor());
+    final AtomicReference<Exception> ref = new AtomicReference<Exception>();
+    List<Thread> threads = new ArrayList<Thread>();
+    for (int i = 0; i < 3; i++) {
+      Thread reader = new Thread() {
+        public void run() {
+          try {
+            CacheTestReader.main(new String[]{"/zcTest-42", "/tmp/zcTest-42", cluster.getZooKeepers()});
+          } catch(Exception ex) {
+            ref.set(ex);
+          }
+        }
+      };
+      reader.start();
+      threads.add(reader);
+    }
+    assertEquals(0, cluster.exec(CacheTestWriter.class, "/zcTest-42", "/tmp/zcTest-42", "3","500").waitFor());
+    for (Thread t: threads) {
+      t.join();
+      if (ref.get() != null)
+        throw ref.get();
+    }
+  }
+  
+}

Propchange: accumulo/trunk/test/src/test/java/org/apache/accumulo/test/functional/ZooCacheIT.java
------------------------------------------------------------------------------
    svn:eol-style = native