Return-Path: X-Original-To: apmail-incubator-accumulo-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-accumulo-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 85916950A for ; Thu, 5 Jan 2012 15:52:17 +0000 (UTC) Received: (qmail 24729 invoked by uid 500); 5 Jan 2012 15:52:17 -0000 Delivered-To: apmail-incubator-accumulo-commits-archive@incubator.apache.org Received: (qmail 24694 invoked by uid 500); 5 Jan 2012 15:52:17 -0000 Mailing-List: contact accumulo-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: accumulo-dev@incubator.apache.org Delivered-To: mailing list accumulo-commits@incubator.apache.org Received: (qmail 24687 invoked by uid 99); 5 Jan 2012 15:52:17 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Jan 2012 15:52:17 +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; Thu, 05 Jan 2012 15:52:14 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id AC5632388980; Thu, 5 Jan 2012 15:51:52 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1227650 - in /incubator/accumulo/branches/1.4: docs/examples/README.bloom src/core/src/main/java/org/apache/accumulo/core/util/shell/Shell.java Date: Thu, 05 Jan 2012 15:51:52 -0000 To: accumulo-commits@incubator.apache.org From: ecn@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120105155152.AC5632388980@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: ecn Date: Thu Jan 5 15:51:52 2012 New Revision: 1227650 URL: http://svn.apache.org/viewvc?rev=1227650&view=rev Log: ACCUMULO-249 add -e option to the shell, simplify the bloom README Modified: incubator/accumulo/branches/1.4/docs/examples/README.bloom incubator/accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/util/shell/Shell.java Modified: incubator/accumulo/branches/1.4/docs/examples/README.bloom URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.4/docs/examples/README.bloom?rev=1227650&r1=1227649&r2=1227650&view=diff ============================================================================== --- incubator/accumulo/branches/1.4/docs/examples/README.bloom (original) +++ incubator/accumulo/branches/1.4/docs/examples/README.bloom Thu Jan 5 15:51:52 2012 @@ -41,16 +41,19 @@ initialized with the seed 7. $ ./bin/accumulo org.apache.accumulo.examples.client.RandomBatchWriter -s 7 instance zookeepers username password bloom_test 1000000 0 1000000000 50 2000000 60000 3 exampleVis -Below the table is flushed, look at the monitor page and wait for the flush to -complete. +Below the table is flushed: - $ ./bin/accumulo shell -u username -p password - username@instance> flush -t bloom_test - Flush of table bloom_test initiated... - username@instance> exit - -The flush will be finished when there are no entries in memory and the -number of minor compactions goes to zero. Refresh the page to see changes to the table. + $ ./bin/accumulo shell -u username -p password -e 'flush -t bloom_test -w' + Shell - Accumulo Interactive Shell + - + - version: 1.4.0-incubating-SNAPSHOT + - instance name: test + - instance id: 54e9b81f-bf36-4a66-a020-f93d98f151a6 + - + - type 'help' for a list of available commands + - + root@test> flush -t bloom_test -w + 05 10:40:06,069 [shell.Shell] INFO : Flush of table bloom_test completed. After the flush completes, 500 random queries are done against the table. The same seed is used to generate the queries, therefore everything is found in the Modified: incubator/accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/util/shell/Shell.java URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/util/shell/Shell.java?rev=1227650&r1=1227649&r2=1227650&view=diff ============================================================================== --- incubator/accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/util/shell/Shell.java (original) +++ incubator/accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/util/shell/Shell.java Thu Jan 5 15:51:52 2012 @@ -182,6 +182,8 @@ public class Shell { // file to execute commands from private String execFile = null; + // single command to execute from the command line + private String execCommand = null; private boolean verbose = true; private boolean tabCompletion; @@ -213,6 +215,9 @@ public class Shell { Option helpOpt = new Option(helpOption, helpLongOption, false, "display this help"); opts.addOption(helpOpt); + Option execCommandOpt = new Option("e", "execute-command", true, "executes a command, and then exits"); + opts.addOption(execCommandOpt); + OptionGroup execFileGroup = new OptionGroup(); Option execfileOption = new Option("f", "execute-file", true, "executes commands from a file at startup"); @@ -334,8 +339,12 @@ public class Shell { if (cl.hasOption(execfileOption.getOpt())) { execFile = cl.getOptionValue(execfileOption.getOpt()); verbose = false; - } else if (cl.hasOption(execfileVerboseOption.getOpt())) + } else if (cl.hasOption(execfileVerboseOption.getOpt())) { execFile = cl.getOptionValue(execfileVerboseOption.getOpt()); + } + if (cl.hasOption(execCommandOpt.getOpt())) { + execCommand = cl.getOptionValue(execCommandOpt.getOpt()); + } rootToken = new Token(); Command external[] = {new AboutCommand(), new AddSplitsCommand(), new AuthenticateCommand(), new ByeCommand(), new ClasspathCommand(), new ClearCommand(), @@ -414,6 +423,11 @@ public class Shell { java.util.Scanner scanner = new java.util.Scanner(new File(execFile)); while (scanner.hasNextLine()) execCommand(scanner.nextLine(), true, isVerbose()); + } else if (execCommand != null) { + for (String command : execCommand.split("\n")) { + execCommand(command, true, isVerbose()); + } + return exitCode; } while (true) {