accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From els...@apache.org
Subject svn commit: r1471210 - in /accumulo/contrib/instamo-archetype/branches/1.4: ./ src/main/resources/archetype-resources/ src/main/resources/archetype-resources/src/main/java/ src/main/resources/archetype-resources/src/test/java/
Date Wed, 24 Apr 2013 00:17:51 GMT
Author: elserj
Date: Wed Apr 24 00:17:50 2013
New Revision: 1471210

URL: http://svn.apache.org/r1471210
Log:
ACCUMULO-1166 "Undo" all of the fixes made in 1.5 to the client to get Instamo working against
1.4 since MAC was backported.

Modified:
    accumulo/contrib/instamo-archetype/branches/1.4/pom.xml
    accumulo/contrib/instamo-archetype/branches/1.4/src/main/resources/archetype-resources/pom.xml
    accumulo/contrib/instamo-archetype/branches/1.4/src/main/resources/archetype-resources/src/main/java/AccumuloApp.java
    accumulo/contrib/instamo-archetype/branches/1.4/src/main/resources/archetype-resources/src/main/java/MapReduceExample.java
    accumulo/contrib/instamo-archetype/branches/1.4/src/main/resources/archetype-resources/src/test/java/ExampleAccumuloUnitTest.java

Modified: accumulo/contrib/instamo-archetype/branches/1.4/pom.xml
URL: http://svn.apache.org/viewvc/accumulo/contrib/instamo-archetype/branches/1.4/pom.xml?rev=1471210&r1=1471209&r2=1471210&view=diff
==============================================================================
Binary files - no diff available.

Modified: accumulo/contrib/instamo-archetype/branches/1.4/src/main/resources/archetype-resources/pom.xml
URL: http://svn.apache.org/viewvc/accumulo/contrib/instamo-archetype/branches/1.4/src/main/resources/archetype-resources/pom.xml?rev=1471210&r1=1471209&r2=1471210&view=diff
==============================================================================
Binary files - no diff available.

Modified: accumulo/contrib/instamo-archetype/branches/1.4/src/main/resources/archetype-resources/src/main/java/AccumuloApp.java
URL: http://svn.apache.org/viewvc/accumulo/contrib/instamo-archetype/branches/1.4/src/main/resources/archetype-resources/src/main/java/AccumuloApp.java?rev=1471210&r1=1471209&r2=1471210&view=diff
==============================================================================
--- accumulo/contrib/instamo-archetype/branches/1.4/src/main/resources/archetype-resources/src/main/java/AccumuloApp.java
(original)
+++ accumulo/contrib/instamo-archetype/branches/1.4/src/main/resources/archetype-resources/src/main/java/AccumuloApp.java
Wed Apr 24 00:17:50 2013
@@ -23,28 +23,29 @@ import java.util.Map.Entry;
 
 import org.apache.accumulo.core.Constants;
 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.Instance;
 import org.apache.accumulo.core.client.Scanner;
 import org.apache.accumulo.core.client.ZooKeeperInstance;
-import org.apache.accumulo.core.client.security.tokens.AuthenticationToken;
 import org.apache.accumulo.core.data.Key;
 import org.apache.accumulo.core.data.Mutation;
 import org.apache.accumulo.core.data.Value;
 
 public class AccumuloApp {
+  private static final Long MAX_MEMORY = 50 * 1024 * 1024l;
+  private static final Long MAX_LATENCY = 2 * 60 * 1000l;
+  private static final Integer MAX_WRITE_THREADS = 3;
   
-  public static void run(String instanceName, String zookeepers, AuthenticationToken token,
String args[]) throws Exception {
+  public static void run(String instanceName, String zookeepers, byte[] password, String
args[]) throws Exception {
     // edit this method to play with Accumulo
 
     Instance instance = new ZooKeeperInstance(instanceName, zookeepers);
     
-    Connector conn = instance.getConnector("root", token);
+    Connector conn = instance.getConnector("root", password);
     
     conn.tableOperations().create("foo");
     
-    BatchWriter bw = conn.createBatchWriter("foo", new BatchWriterConfig());
+    BatchWriter bw = conn.createBatchWriter("foo", MAX_MEMORY, MAX_LATENCY, MAX_WRITE_THREADS);
     Mutation m = new Mutation("r1");
     m.put("cf1", "cq1", "v1");
     m.put("cf1", "cq2", "v3");

Modified: accumulo/contrib/instamo-archetype/branches/1.4/src/main/resources/archetype-resources/src/main/java/MapReduceExample.java
URL: http://svn.apache.org/viewvc/accumulo/contrib/instamo-archetype/branches/1.4/src/main/resources/archetype-resources/src/main/java/MapReduceExample.java?rev=1471210&r1=1471209&r2=1471210&view=diff
==============================================================================
--- accumulo/contrib/instamo-archetype/branches/1.4/src/main/resources/archetype-resources/src/main/java/MapReduceExample.java
(original)
+++ accumulo/contrib/instamo-archetype/branches/1.4/src/main/resources/archetype-resources/src/main/java/MapReduceExample.java
Wed Apr 24 00:17:50 2013
@@ -22,9 +22,9 @@ package ${package};
 import java.io.File;
 import java.util.UUID;
 
+import org.apache.accumulo.server.test.continuous.ContinuousIngest;
+import org.apache.accumulo.server.test.continuous.ContinuousVerify;
 import org.apache.accumulo.test.MiniAccumuloCluster;
-import org.apache.accumulo.test.continuous.ContinuousIngest;
-import org.apache.accumulo.test.continuous.ContinuousVerify;
 import org.apache.commons.io.FileUtils;
 
 /**
@@ -33,17 +33,21 @@ import org.apache.commons.io.FileUtils;
 public class MapReduceExample {
   
   public static void run(String instanceName, String zookeepers, String rootPassword, String
args[]) throws Exception {
+    final String MAX_SHORT = Short.toString(Short.MAX_VALUE);
+    final String MAX_LONG = Long.toString(Long.MAX_VALUE);
+    final String MAX_LATENCY = Integer.toString(2 * 60 * 1000);
+    final String MAX_THREADS = "3";
     
     // run continuous ingest to create data. This is not a map reduce job
-    ContinuousIngest.main(new String[] {"-i", instanceName, "-z", zookeepers, "-u", "root",
"-p", rootPassword, "--table", "ci", "--num", "5000000",
-        "--batchMemory", "1000000"});
+    ContinuousIngest.main(new String[] {instanceName, zookeepers, "root", rootPassword, "ci",
"5000000", "0", MAX_LONG,
+      MAX_SHORT, MAX_SHORT, "1000000", MAX_LATENCY, MAX_THREADS, "false"});
     
     String outputDir = FileUtils.getTempDirectoryPath() + File.separator + "ci_verify" +
UUID.randomUUID().toString();
     
     try {
       // run verify map reduce job locally. This jobs looks for holes in the linked list
create by continuous ingest
-      ContinuousVerify.main(new String[] {"-D", "mapred.job.tracker=local", "-D", "fs.default.name=file:///",
"-i", instanceName, "-z", zookeepers, "-u",
-          "root", "-p", rootPassword, "--table", "ci", "--output", outputDir, "--maxMappers",
"4", "--reducers", "1"});
+      ContinuousVerify.main(new String[] {"-D", "mapred.job.tracker=local", "-D", "fs.default.name=file:///",
instanceName, zookeepers, "root", rootPassword, "ci", outputDir, "4", "1", "false"});
+
     } finally {
       // delete output dir of mapreduce job
       FileUtils.deleteQuietly(new File(outputDir));

Modified: accumulo/contrib/instamo-archetype/branches/1.4/src/main/resources/archetype-resources/src/test/java/ExampleAccumuloUnitTest.java
URL: http://svn.apache.org/viewvc/accumulo/contrib/instamo-archetype/branches/1.4/src/main/resources/archetype-resources/src/test/java/ExampleAccumuloUnitTest.java?rev=1471210&r1=1471209&r2=1471210&view=diff
==============================================================================
--- accumulo/contrib/instamo-archetype/branches/1.4/src/main/resources/archetype-resources/src/test/java/ExampleAccumuloUnitTest.java
(original)
+++ accumulo/contrib/instamo-archetype/branches/1.4/src/main/resources/archetype-resources/src/test/java/ExampleAccumuloUnitTest.java
Wed Apr 24 00:17:50 2013
@@ -19,7 +19,6 @@
  */
 package ${package};
 
-import org.apache.accumulo.core.client.security.tokens.PasswordToken;
 import org.apache.accumulo.test.MiniAccumuloCluster;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
@@ -49,7 +48,7 @@ public class ExampleAccumuloUnitTest {
 
   @Test(timeout = 30000)
   public void test() throws Exception {
-    AccumuloApp.run(accumulo.getInstanceName(), accumulo.getZooKeepers(), new PasswordToken("superSecret"),
new String[0]);
+    AccumuloApp.run(accumulo.getInstanceName(), accumulo.getZooKeepers(), "superSecret".getBytes(),
new String[0]);
   }
   
   @AfterClass



Mime
View raw message