incubator-accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject svn commit: r1227651 - in /incubator/accumulo/trunk: ./ docs/examples/README.bloom src/core/ src/core/src/main/java/org/apache/accumulo/core/util/shell/Shell.java
Date Thu, 05 Jan 2012 15:52:23 GMT
Author: ecn
Date: Thu Jan  5 15:52:22 2012
New Revision: 1227651

URL: http://svn.apache.org/viewvc?rev=1227651&view=rev
Log:
ACCUMULO-249 add -e option to the shell, simplify the bloom README

Modified:
    incubator/accumulo/trunk/   (props changed)
    incubator/accumulo/trunk/docs/examples/README.bloom
    incubator/accumulo/trunk/src/core/   (props changed)
    incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/shell/Shell.java

Propchange: incubator/accumulo/trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Jan  5 15:52:22 2012
@@ -1,3 +1,3 @@
 /incubator/accumulo/branches/1.3:1190280,1190413,1190420,1190427,1190500,1195622,1195625,1195629,1195635,1196044,1196054,1196057,1196071-1196072,1196106,1197066,1198935,1199383,1203683,1204625,1205547,1205880,1206169,1208031,1209124,1209526,1209532,1209539,1209541,1209587,1209657,1210518,1210571,1210596,1210598,1213424,1214320,1225006,1227215,1227231,1227611
 /incubator/accumulo/branches/1.3.5rc:1209938
-/incubator/accumulo/branches/1.4:1201902-1222706,1225007,1227202,1227216,1227289,1227611-1227612
+/incubator/accumulo/branches/1.4:1201902-1222706,1225007,1227202,1227216,1227289,1227611-1227612,1227650

Modified: incubator/accumulo/trunk/docs/examples/README.bloom
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/docs/examples/README.bloom?rev=1227651&r1=1227650&r2=1227651&view=diff
==============================================================================
--- incubator/accumulo/trunk/docs/examples/README.bloom (original)
+++ incubator/accumulo/trunk/docs/examples/README.bloom Thu Jan  5 15:52:22 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

Propchange: incubator/accumulo/trunk/src/core/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Jan  5 15:52:22 2012
@@ -1,3 +1,3 @@
 /incubator/accumulo/branches/1.3/src/core:1190280,1190413,1190420,1190427,1190500,1195622,1195625,1195629,1195635,1196044,1196054,1196057,1196071-1196072,1196106,1197066,1198935,1199383,1203683,1204625,1205547,1205880,1206169,1208031,1209124,1209526,1209532,1209539,1209541,1209587,1209657,1210518,1210571,1210596,1210598,1213424,1214320,1225006,1227215
 /incubator/accumulo/branches/1.3.5rc/src/core:1209938
-/incubator/accumulo/branches/1.4/src/core:1201902-1227271,1227611-1227612
+/incubator/accumulo/branches/1.4/src/core:1201902-1227271,1227611-1227612,1227650

Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/shell/Shell.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/shell/Shell.java?rev=1227651&r1=1227650&r2=1227651&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/shell/Shell.java
(original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/shell/Shell.java
Thu Jan  5 15:52:22 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;
@@ -214,6 +216,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");
@@ -335,8 +340,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(),
@@ -415,6 +424,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) {



Mime
View raw message