You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by el...@apache.org on 2013/11/28 00:57:00 UTC

[1/4] git commit: ACCUMULO-1941 Fix TabletIT test

Updated Branches:
  refs/heads/master e67763773 -> 378a9f1d6


ACCUMULO-1941 Fix TabletIT test


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/40a007a2
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/40a007a2
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/40a007a2

Branch: refs/heads/master
Commit: 40a007a2d57f53f4430164eda95f513444ac2897
Parents: edae90f
Author: Christopher Tubbs <ct...@apache.org>
Authored: Wed Nov 27 13:30:52 2013 -0500
Committer: Christopher Tubbs <ct...@apache.org>
Committed: Wed Nov 27 13:30:52 2013 -0500

----------------------------------------------------------------------
 .../apache/accumulo/test/CreateTestTable.java   | 90 --------------------
 .../accumulo/test/functional/TabletIT.java      | 63 ++++++++++++--
 2 files changed, 55 insertions(+), 98 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/40a007a2/test/src/main/java/org/apache/accumulo/test/CreateTestTable.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/CreateTestTable.java b/test/src/main/java/org/apache/accumulo/test/CreateTestTable.java
deleted file mode 100644
index 14c5cef..0000000
--- a/test/src/main/java/org/apache/accumulo/test/CreateTestTable.java
+++ /dev/null
@@ -1,90 +0,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 java.util.Map.Entry;
-import java.util.TreeSet;
-
-import org.apache.accumulo.server.cli.ClientOnDefaultTable;
-import org.apache.accumulo.core.cli.BatchWriterOpts;
-import org.apache.accumulo.core.cli.ScannerOpts;
-import org.apache.accumulo.core.client.BatchWriter;
-import org.apache.accumulo.core.client.Connector;
-import org.apache.accumulo.core.client.Scanner;
-import org.apache.accumulo.core.data.Key;
-import org.apache.accumulo.core.data.Mutation;
-import org.apache.accumulo.core.data.Value;
-import org.apache.hadoop.io.Text;
-
-import com.beust.jcommander.Parameter;
-
-public class CreateTestTable {
-  
-  static class Opts extends ClientOnDefaultTable {
-    @Parameter(names={"-readonly", "--readonly"}, description="read only")
-    boolean readOnly = false;
-    @Parameter(names={"-count", "--count"}, description="count", required = true)
-    int count = 10000;
-    Opts() { super("mrtest1"); }
-  }
-  
-  private static void readBack(Connector conn, Opts opts, ScannerOpts scanOpts) throws Exception {
-    Scanner scanner = conn.createScanner("mrtest1", opts.auths);
-    scanner.setBatchSize(scanOpts.scanBatchSize);
-    int count = 0;
-    for (Entry<Key,Value> elt : scanner) {
-      String expected = String.format("%05d", count);
-      assert (elt.getKey().getRow().toString().equals(expected));
-      count++;
-    }
-    assert (opts.count == count);
-  }
-  
-  public static void main(String[] args) throws Exception {
-    String program = CreateTestTable.class.getName();
-    Opts opts = new Opts();
-    BatchWriterOpts bwOpts = new BatchWriterOpts();
-    ScannerOpts scanOpts = new ScannerOpts();
-    opts.parseArgs(program, args, bwOpts, scanOpts);
-    
-    // create the test table within accumulo
-    Connector connector = opts.getConnector();
-    
-    if (!opts.readOnly) {
-      TreeSet<Text> keys = new TreeSet<Text>();
-      for (int i = 0; i < opts.count / 100; i++) {
-        keys.add(new Text(String.format("%05d", i * 100)));
-      }
-      
-      // presplit
-      connector.tableOperations().create(opts.getTableName());
-      connector.tableOperations().addSplits(opts.getTableName(), keys);
-      BatchWriter b = connector.createBatchWriter(opts.getTableName(), bwOpts.getBatchWriterConfig());
-      
-      // populate
-      for (int i = 0; i < opts.count; i++) {
-        Mutation m = new Mutation(new Text(String.format("%05d", i)));
-        m.put(new Text("col" + Integer.toString((i % 3) + 1)), new Text("qual"), new Value("junk".getBytes()));
-        b.addMutation(m);
-      }
-      b.close();
-    }
-    
-    readBack(connector, opts, scanOpts);
-    opts.stopTracing();
-  }
-}

http://git-wip-us.apache.org/repos/asf/accumulo/blob/40a007a2/test/src/test/java/org/apache/accumulo/test/functional/TabletIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/TabletIT.java b/test/src/test/java/org/apache/accumulo/test/functional/TabletIT.java
index f87a856..cf4c35c 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/TabletIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/TabletIT.java
@@ -20,28 +20,75 @@ import static org.junit.Assert.assertEquals;
 
 import java.util.HashMap;
 import java.util.Map;
+import java.util.Map.Entry;
+import java.util.TreeSet;
 
+import org.apache.accumulo.core.client.BatchWriter;
+import org.apache.accumulo.core.client.BatchWriterConfig;
+import org.apache.accumulo.core.client.Connector;
+import org.apache.accumulo.core.client.Scanner;
 import org.apache.accumulo.core.conf.Property;
+import org.apache.accumulo.core.data.Key;
+import org.apache.accumulo.core.data.Mutation;
+import org.apache.accumulo.core.data.Value;
+import org.apache.accumulo.core.security.Authorizations;
+import org.apache.accumulo.minicluster.MemoryUnit;
 import org.apache.accumulo.minicluster.MiniAccumuloConfig;
-import org.apache.accumulo.test.CreateTestTable;
+import org.apache.hadoop.io.Text;
 import org.junit.Test;
 
 public class TabletIT extends ConfigurableMacIT {
-  
+
   private static final int N = 1000;
 
   @Override
   public void configure(MiniAccumuloConfig cfg) {
-    Map<String, String> siteConfig = new HashMap<String,String>();
+    Map<String,String> siteConfig = new HashMap<String,String>();
     siteConfig.put(Property.TABLE_SPLIT_THRESHOLD.getKey(), "200");
     siteConfig.put(Property.TSERV_MAXMEM.getKey(), "128M");
+    cfg.setDefaultMemory(256, MemoryUnit.MEGABYTE);
     cfg.setSiteConfig(siteConfig);
   }
 
-  @Test(timeout = 30 * 1000)
-  public void test() throws Exception {
-    assertEquals(0, cluster.exec(CreateTestTable.class, "" + N).waitFor());
-    assertEquals(0, cluster.exec(CreateTestTable.class, "-readonly", "" + N).waitFor());
+  @Test(timeout = 2 * 60 * 1000)
+  public void createTableTest() throws Exception {
+    String tableName = getTableNames(1)[0];
+    createTableTest(tableName, false);
+    createTableTest(tableName, true);
+  }
+
+  public void createTableTest(String tableName, boolean readOnly) throws Exception {
+    // create the test table within accumulo
+    Connector connector = getConnector();
+
+    if (!readOnly) {
+      TreeSet<Text> keys = new TreeSet<Text>();
+      for (int i = N / 100; i < N; i += N / 100) {
+        keys.add(new Text(String.format("%05d", i)));
+      }
+
+      // presplit
+      connector.tableOperations().create(tableName);
+      connector.tableOperations().addSplits(tableName, keys);
+      BatchWriter b = connector.createBatchWriter(tableName, new BatchWriterConfig());
+
+      // populate
+      for (int i = 0; i < N; i++) {
+        Mutation m = new Mutation(new Text(String.format("%05d", i)));
+        m.put(new Text("col" + Integer.toString((i % 3) + 1)), new Text("qual"), new Value("junk".getBytes()));
+        b.addMutation(m);
+      }
+      b.close();
+    }
+
+    Scanner scanner = getConnector().createScanner(tableName, Authorizations.EMPTY);
+    int count = 0;
+    for (Entry<Key,Value> elt : scanner) {
+      String expected = String.format("%05d", count);
+      assert (elt.getKey().getRow().toString().equals(expected));
+      count++;
+    }
+    assertEquals(N, count);
   }
-  
+
 }


[3/4] git commit: Merge branch '1.5.1-SNAPSHOT' into 1.6.0-SNAPSHOT

Posted by el...@apache.org.
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/387fcfbe
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/387fcfbe
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/387fcfbe

Branch: refs/heads/master
Commit: 387fcfbe8766877056fceecc201ad6f3c87653ea
Parents: 40a007a 7d88697
Author: Josh Elser <el...@apache.org>
Authored: Wed Nov 27 18:38:05 2013 -0500
Committer: Josh Elser <el...@apache.org>
Committed: Wed Nov 27 18:38:05 2013 -0500

----------------------------------------------------------------------

----------------------------------------------------------------------



[2/4] git commit: ACCUMULO-1943 Replace module.xsd in the test jar so randomwalk has access to it.

Posted by el...@apache.org.
ACCUMULO-1943 Replace module.xsd in the test jar so randomwalk has access to it.


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/7d886974
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/7d886974
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/7d886974

Branch: refs/heads/master
Commit: 7d886974d066a65830e4203cddc91f973da75725
Parents: 4be3d66
Author: Josh Elser <el...@apache.org>
Authored: Wed Nov 27 18:37:12 2013 -0500
Committer: Josh Elser <el...@apache.org>
Committed: Wed Nov 27 18:37:12 2013 -0500

----------------------------------------------------------------------
 test/src/main/resources/randomwalk/module.xsd | 69 ++++++++++++++++++++++
 test/src/test/resources/randomwalk/module.xsd | 69 ----------------------
 2 files changed, 69 insertions(+), 69 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/7d886974/test/src/main/resources/randomwalk/module.xsd
----------------------------------------------------------------------
diff --git a/test/src/main/resources/randomwalk/module.xsd b/test/src/main/resources/randomwalk/module.xsd
new file mode 100644
index 0000000..bcdaaae0
--- /dev/null
+++ b/test/src/main/resources/randomwalk/module.xsd
@@ -0,0 +1,69 @@
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+<!--
+  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.
+-->
+
+  <xsd:element name="module" type="ModuleType"/>
+
+  <xsd:complexType name="ModuleType">
+    <xsd:sequence>
+      <xsd:element name="package" type="PrefixType" minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="fixture" type="InitType" minOccurs="0" maxOccurs="1"/>
+      <xsd:element name="init" type="InitType"/>
+      <xsd:element name="node" type="NodeType" minOccurs="1" maxOccurs="unbounded"/>
+   </xsd:sequence>
+  </xsd:complexType>
+
+  <xsd:complexType name="PrefixType">
+    <xsd:attribute name="prefix" type="xsd:string"/>
+    <xsd:attribute name="value" type="xsd:string"/>
+  </xsd:complexType>
+
+  <xsd:complexType name="InitType">
+    <xsd:attribute name="id" type="xsd:string"/>
+    <xsd:attribute name="maxHops" type="xsd:nonNegativeInteger"/>
+    <xsd:attribute name="maxSec" type="xsd:nonNegativeInteger"/>
+    <xsd:attribute name="teardown" type="xsd:boolean"/>
+  </xsd:complexType>
+
+  <xsd:complexType name="NodeType">
+    <xsd:sequence>
+      <xsd:element name="alias" type="AliasType" minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="property" type="PropertyType" minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="edge" type="EdgeType" minOccurs="1" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:string"/>
+    <xsd:attribute name="src" type="xsd:string"/>
+    <xsd:attribute name="maxHops" type="xsd:nonNegativeInteger"/>
+    <xsd:attribute name="maxSec" type="xsd:nonNegativeInteger"/>
+    <xsd:attribute name="teardown" type="xsd:boolean"/>
+  </xsd:complexType>
+
+  <xsd:complexType name="EdgeType">
+    <xsd:attribute name="id" type="xsd:string"/>
+    <xsd:attribute name="weight" type="xsd:positiveInteger"/>
+  </xsd:complexType>
+
+  <xsd:complexType name="AliasType">
+    <xsd:attribute name="name" type="xsd:string"/>
+  </xsd:complexType>
+  
+  <xsd:complexType name="PropertyType">
+    <xsd:attribute name="key" type="xsd:string"/>
+    <xsd:attribute name="value" type="xsd:string"/>
+  </xsd:complexType>
+
+</xsd:schema>

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7d886974/test/src/test/resources/randomwalk/module.xsd
----------------------------------------------------------------------
diff --git a/test/src/test/resources/randomwalk/module.xsd b/test/src/test/resources/randomwalk/module.xsd
deleted file mode 100644
index bcdaaae0..0000000
--- a/test/src/test/resources/randomwalk/module.xsd
+++ /dev/null
@@ -1,69 +0,0 @@
-<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
-<!--
-  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.
--->
-
-  <xsd:element name="module" type="ModuleType"/>
-
-  <xsd:complexType name="ModuleType">
-    <xsd:sequence>
-      <xsd:element name="package" type="PrefixType" minOccurs="0" maxOccurs="unbounded"/>
-      <xsd:element name="fixture" type="InitType" minOccurs="0" maxOccurs="1"/>
-      <xsd:element name="init" type="InitType"/>
-      <xsd:element name="node" type="NodeType" minOccurs="1" maxOccurs="unbounded"/>
-   </xsd:sequence>
-  </xsd:complexType>
-
-  <xsd:complexType name="PrefixType">
-    <xsd:attribute name="prefix" type="xsd:string"/>
-    <xsd:attribute name="value" type="xsd:string"/>
-  </xsd:complexType>
-
-  <xsd:complexType name="InitType">
-    <xsd:attribute name="id" type="xsd:string"/>
-    <xsd:attribute name="maxHops" type="xsd:nonNegativeInteger"/>
-    <xsd:attribute name="maxSec" type="xsd:nonNegativeInteger"/>
-    <xsd:attribute name="teardown" type="xsd:boolean"/>
-  </xsd:complexType>
-
-  <xsd:complexType name="NodeType">
-    <xsd:sequence>
-      <xsd:element name="alias" type="AliasType" minOccurs="0" maxOccurs="unbounded"/>
-      <xsd:element name="property" type="PropertyType" minOccurs="0" maxOccurs="unbounded"/>
-      <xsd:element name="edge" type="EdgeType" minOccurs="1" maxOccurs="unbounded"/>
-    </xsd:sequence>
-    <xsd:attribute name="id" type="xsd:string"/>
-    <xsd:attribute name="src" type="xsd:string"/>
-    <xsd:attribute name="maxHops" type="xsd:nonNegativeInteger"/>
-    <xsd:attribute name="maxSec" type="xsd:nonNegativeInteger"/>
-    <xsd:attribute name="teardown" type="xsd:boolean"/>
-  </xsd:complexType>
-
-  <xsd:complexType name="EdgeType">
-    <xsd:attribute name="id" type="xsd:string"/>
-    <xsd:attribute name="weight" type="xsd:positiveInteger"/>
-  </xsd:complexType>
-
-  <xsd:complexType name="AliasType">
-    <xsd:attribute name="name" type="xsd:string"/>
-  </xsd:complexType>
-  
-  <xsd:complexType name="PropertyType">
-    <xsd:attribute name="key" type="xsd:string"/>
-    <xsd:attribute name="value" type="xsd:string"/>
-  </xsd:complexType>
-
-</xsd:schema>


[4/4] git commit: Merge branch '1.6.0-SNAPSHOT'

Posted by el...@apache.org.
Merge branch '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/378a9f1d
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/378a9f1d
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/378a9f1d

Branch: refs/heads/master
Commit: 378a9f1d696b5456b4255bd23b7f601eed78d720
Parents: e677637 387fcfb
Author: Josh Elser <el...@apache.org>
Authored: Wed Nov 27 18:38:32 2013 -0500
Committer: Josh Elser <el...@apache.org>
Committed: Wed Nov 27 18:38:32 2013 -0500

----------------------------------------------------------------------
 .../apache/accumulo/test/CreateTestTable.java   | 90 --------------------
 .../accumulo/test/functional/TabletIT.java      | 63 ++++++++++++--
 2 files changed, 55 insertions(+), 98 deletions(-)
----------------------------------------------------------------------