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/03/10 04:14:11 UTC

svn commit: r1454779 - in /accumulo/contrib/instamo-archetype/trunk/src/main/resources/archetype-resources: README.md pom.xml src/main/java/ShellExample.java src/main/resources/log4j.properties

Author: elserj
Date: Sun Mar 10 03:14:11 2013
New Revision: 1454779

URL: http://svn.apache.org/r1454779
Log:
ACCUMULO-1166 Adding an example of the Accumulo shell

Added:
    accumulo/contrib/instamo-archetype/trunk/src/main/resources/archetype-resources/src/main/java/ShellExample.java
Modified:
    accumulo/contrib/instamo-archetype/trunk/src/main/resources/archetype-resources/README.md
    accumulo/contrib/instamo-archetype/trunk/src/main/resources/archetype-resources/pom.xml
    accumulo/contrib/instamo-archetype/trunk/src/main/resources/archetype-resources/src/main/resources/log4j.properties

Modified: accumulo/contrib/instamo-archetype/trunk/src/main/resources/archetype-resources/README.md
URL: http://svn.apache.org/viewvc/accumulo/contrib/instamo-archetype/trunk/src/main/resources/archetype-resources/README.md?rev=1454779&r1=1454778&r2=1454779&view=diff
==============================================================================
--- accumulo/contrib/instamo-archetype/trunk/src/main/resources/archetype-resources/README.md (original)
+++ accumulo/contrib/instamo-archetype/trunk/src/main/resources/archetype-resources/README.md Sun Mar 10 03:14:11 2013
@@ -14,14 +14,26 @@ vim src/main/java/${package}/AccumuloApp
 mvn package
 ```
 
+After packing the code, you can run one of the below applications.
+
 Map Reduce
 ----------
 
-Its possible to run local map reduce jobs against the MiniAccumuloCluster
+It's possible to run local map reduce jobs against the MiniAccumuloCluster
 instance.   There is an example of this in the src directory  The following
 command will run the map reduce example.
 
 ```
-mvn exec:exec
+mvn exec:exec -P mapreduce
 ```
 
+Accumulo Shell
+-----------
+
+The Accumulo shell is a simple application that, among other features, provides
+interactive access to tables in Accumulo. The following command will launch the
+shell against a local Accumulo instance.
+
+```
+mvn exec:exec -P shell
+```

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

Added: accumulo/contrib/instamo-archetype/trunk/src/main/resources/archetype-resources/src/main/java/ShellExample.java
URL: http://svn.apache.org/viewvc/accumulo/contrib/instamo-archetype/trunk/src/main/resources/archetype-resources/src/main/java/ShellExample.java?rev=1454779&view=auto
==============================================================================
--- accumulo/contrib/instamo-archetype/trunk/src/main/resources/archetype-resources/src/main/java/ShellExample.java (added)
+++ accumulo/contrib/instamo-archetype/trunk/src/main/resources/archetype-resources/src/main/java/ShellExample.java Sun Mar 10 03:14:11 2013
@@ -0,0 +1,63 @@
+package instamo.example;
+
+import com.google.common.io.Files;
+
+import java.io.File;
+import java.io.IOException;
+import java.lang.InterruptedException;
+import java.lang.Runnable;
+import java.util.Arrays;
+
+import org.apache.accumulo.core.util.shell.Shell;
+import org.apache.accumulo.test.MiniAccumuloCluster;
+
+public class ShellExample implements Runnable {
+  
+  @Override
+  public void run() {
+    File tempDir = null;
+    MiniAccumuloCluster mac = null;
+    
+    try {
+      tempDir = Files.createTempDir();
+      tempDir.deleteOnExit();
+
+      final String PASSWORD = "pass1234";
+
+      mac = new MiniAccumuloCluster(tempDir, PASSWORD);
+
+      mac.start();
+
+      String[] args = new String[] {"-u", "root", "-p", PASSWORD, "-z",
+        mac.getInstanceName(), mac.getZooKeepers()};
+
+      Shell.main(args);
+
+    } catch (InterruptedException e) {
+      System.err.println("Error starting MiniAccumuloCluster: " + e.getMessage());
+    } catch (IOException e) {
+      System.err.println("Error starting MiniAccumuloCluster: " + e.getMessage());
+    } finally {
+      if (null != tempDir) {
+        tempDir.delete();
+      }
+
+      if (null != mac) {
+        try {
+          mac.stop();
+        } catch (InterruptedException e) {
+          System.err.println("Error stopping MiniAccumuloCluster: " + e.getMessage());
+        } catch (IOException e) {
+          System.err.println("Error stopping MiniAccumuloCluster: " + e.getMessage());
+        }
+      }
+    }
+  }
+
+  public static void main(String[] args) {
+    System.out.println("\n   ---- Initializing Accumulo Shell\n");
+
+    ShellExample shell = new ShellExample();
+    shell.run();
+  }
+}

Modified: accumulo/contrib/instamo-archetype/trunk/src/main/resources/archetype-resources/src/main/resources/log4j.properties
URL: http://svn.apache.org/viewvc/accumulo/contrib/instamo-archetype/trunk/src/main/resources/archetype-resources/src/main/resources/log4j.properties?rev=1454779&r1=1454778&r2=1454779&view=diff
==============================================================================
--- accumulo/contrib/instamo-archetype/trunk/src/main/resources/archetype-resources/src/main/resources/log4j.properties (original)
+++ accumulo/contrib/instamo-archetype/trunk/src/main/resources/archetype-resources/src/main/resources/log4j.properties Sun Mar 10 03:14:11 2013
@@ -7,6 +7,6 @@ log4j.appender.CA.layout=org.apache.log4
 log4j.appender.CA.layout.ConversionPattern=[%t] %-5p %c %x - %m%n
 
 log4j.logger.org.apache.zookeeper=ERROR,CA
-log4j.logger.org.apache.accumulo.core.client.impl.ServerClient=ERROR
-log4j.logger.org.apache.accumulo.server.security.Auditor=off
-
+log4j.logger.org.apache.accumulo.core.client.impl.ServerClient=ERROR,CA
+log4j.logger.org.apache.accumulo.core.util.shell.Shell.audit=WARN,CA
+log4j.logger.org.apache.commons.vfs2.impl.DefaultFileSystemManager=WARN,CA