Return-Path: X-Original-To: apmail-accumulo-commits-archive@www.apache.org Delivered-To: apmail-accumulo-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0F3EEEDE4 for ; Sun, 10 Mar 2013 03:14:39 +0000 (UTC) Received: (qmail 46508 invoked by uid 500); 10 Mar 2013 03:14:38 -0000 Delivered-To: apmail-accumulo-commits-archive@accumulo.apache.org Received: (qmail 46364 invoked by uid 500); 10 Mar 2013 03:14:33 -0000 Mailing-List: contact commits-help@accumulo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@accumulo.apache.org Delivered-To: mailing list commits@accumulo.apache.org Received: (qmail 46325 invoked by uid 99); 10 Mar 2013 03:14:32 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 10 Mar 2013 03:14:32 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 10 Mar 2013 03:14:31 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 299C323888EA; Sun, 10 Mar 2013 03:14:12 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: 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 Date: Sun, 10 Mar 2013 03:14:11 -0000 To: commits@accumulo.apache.org From: elserj@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130310031412.299C323888EA@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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