incubator-accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ktur...@apache.org
Subject svn commit: r1241126 - in /incubator/accumulo/trunk: ./ src/core/ src/core/src/main/java/org/apache/accumulo/core/util/shell/ src/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ src/server/
Date Mon, 06 Feb 2012 19:42:41 GMT
Author: kturner
Date: Mon Feb  6 19:42:41 2012
New Revision: 1241126

URL: http://svn.apache.org/viewvc?rev=1241126&view=rev
Log:
ACCUMULO-372 merged scan -r from 1.4, removed select and selectrow from shell

Removed:
    incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/shell/commands/SelectCommand.java
    incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/shell/commands/SelectrowCommand.java
Modified:
    incubator/accumulo/trunk/   (props changed)
    incubator/accumulo/trunk/src/core/   (props changed)
    incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/shell/Shell.java
    incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ScanCommand.java
    incubator/accumulo/trunk/src/server/   (props changed)

Propchange: incubator/accumulo/trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Feb  6 19:42:41 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,1228195,1230180,1230736,1231043,1236873
 /incubator/accumulo/branches/1.3.5rc:1209938
-/incubator/accumulo/branches/1.4:1201902-1241113
+/incubator/accumulo/branches/1.4:1201902-1241123

Propchange: incubator/accumulo/trunk/src/core/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Feb  6 19:42:41 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-1241113
+/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.4/src/core:1201902-1241123

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=1241126&r1=1241125&r2=1241126&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
Mon Feb  6 19:42:41 2012
@@ -117,8 +117,6 @@ import org.apache.accumulo.core.util.she
 import org.apache.accumulo.core.util.shell.commands.RenameTableCommand;
 import org.apache.accumulo.core.util.shell.commands.RevokeCommand;
 import org.apache.accumulo.core.util.shell.commands.ScanCommand;
-import org.apache.accumulo.core.util.shell.commands.SelectCommand;
-import org.apache.accumulo.core.util.shell.commands.SelectrowCommand;
 import org.apache.accumulo.core.util.shell.commands.SetAuthsCommand;
 import org.apache.accumulo.core.util.shell.commands.SetGroupsCommand;
 import org.apache.accumulo.core.util.shell.commands.SetIterCommand;
@@ -366,10 +364,9 @@ public class Shell {
         new GetSplitsCommand(), new GrantCommand(), new GrepCommand(), new HelpCommand(),
new HiddenCommand(), new HistoryCommand(),
         new ImportDirectoryCommand(), new InfoCommand(), new InsertCommand(), new ListIterCommand(),
new ListScansCommand(), new MasterStateCommand(),
         new MaxRowCommand(), new MergeCommand(), new NoTableCommand(), new OfflineCommand(),
new OnlineCommand(), new PasswdCommand(), new QuestionCommand(),
-        new QuitCommand(), new RenameTableCommand(), new RevokeCommand(), new ScanCommand(),
new SelectCommand(), new SelectrowCommand(),
-        new SetAuthsCommand(), new SetGroupsCommand(), new SetIterCommand(), new SetScanIterCommand(),
new SleepCommand(), new SystemPermissionsCommand(),
-        new TableCommand(), new TablePermissionsCommand(), new TablesCommand(), new TraceCommand(),
new UserCommand(), new UserPermissionsCommand(),
-        new UsersCommand(), new WhoAmICommand(),};
+        new QuitCommand(), new RenameTableCommand(), new RevokeCommand(), new ScanCommand(),
new SetAuthsCommand(), new SetGroupsCommand(),
+        new SetIterCommand(), new SetScanIterCommand(), new SleepCommand(), new SystemPermissionsCommand(),
new TableCommand(), new TablePermissionsCommand(),
+        new TablesCommand(), new TraceCommand(), new UserCommand(), new UserPermissionsCommand(),
new UsersCommand(), new WhoAmICommand(),};
     for (Command cmd : external) {
       commandFactory.put(cmd.getName(), cmd);
     }

Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ScanCommand.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ScanCommand.java?rev=1241126&r1=1241125&r2=1241126&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ScanCommand.java
(original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ScanCommand.java
Mon Feb  6 19:42:41 2012
@@ -41,7 +41,7 @@ import org.apache.hadoop.io.Text;
 
 public class ScanCommand extends Command {
   
-  private Option scanOptAuths, scanOptStartRow, scanOptEndRow, scanOptColumns, disablePaginationOpt,
tableOpt, showFewOpt;
+  private Option scanOptAuths, scanOptStartRow, scanOptEndRow, scanOptRow, scanOptColumns,
disablePaginationOpt, tableOpt, showFewOpt;
   protected Option timestampOpt;
   
   public int execute(String fullCommand, CommandLine cl, Shell shellState) throws AccumuloException,
AccumuloSecurityException, TableNotFoundException,
@@ -133,10 +133,19 @@ public class ScanCommand extends Command
   }
   
   protected Range getRange(CommandLine cl) {
-    Text startRow = cl.hasOption(scanOptStartRow.getOpt()) ? new Text(cl.getOptionValue(scanOptStartRow.getOpt()))
: null;
-    Text endRow = cl.hasOption(scanOptEndRow.getOpt()) ? new Text(cl.getOptionValue(scanOptEndRow.getOpt()))
: null;
-    Range r = new Range(startRow, endRow);
-    return r;
+    if ((cl.hasOption(scanOptStartRow.getOpt()) || cl.hasOption(scanOptEndRow.getOpt()))
&& cl.hasOption(scanOptRow.getOpt())) {
+      // did not see a way to make commons cli do this check... it has mutually exclusive
options but does not support the or
+      throw new IllegalArgumentException("Options -" + scanOptRow.getOpt() + " AND (-" +
scanOptStartRow.getOpt() + " OR -" + scanOptEndRow.getOpt()
+          + ") are mutally exclusive ");
+    }
+
+    if (cl.hasOption(scanOptRow.getOpt())) {
+      return new Range(new Text(cl.getOptionValue(scanOptRow.getOpt())));
+    } else {
+      Text startRow = cl.hasOption(scanOptStartRow.getOpt()) ? new Text(cl.getOptionValue(scanOptStartRow.getOpt()))
: null;
+      Text endRow = cl.hasOption(scanOptEndRow.getOpt()) ? new Text(cl.getOptionValue(scanOptEndRow.getOpt()))
: null;
+      return new Range(startRow, endRow);
+    }
   }
   
   protected Authorizations getAuths(CommandLine cl, Shell shellState) throws AccumuloSecurityException,
AccumuloException {
@@ -160,6 +169,7 @@ public class ScanCommand extends Command
     scanOptAuths = new Option("s", "scan-authorizations", true, "scan authorizations (all
user auths are used if this argument is not specified)");
     scanOptStartRow = new Option("b", "begin-row", true, "begin row (inclusive)");
     scanOptEndRow = new Option("e", "end-row", true, "end row (inclusive)");
+    scanOptRow = new Option("r", "row", true, "row to scan");
     scanOptColumns = new Option("c", "columns", true, "comma-separated columns");
     timestampOpt = new Option("st", "show-timestamps", false, "enables displaying timestamps");
     disablePaginationOpt = new Option("np", "no-pagination", false, "disables pagination
of output");
@@ -167,6 +177,7 @@ public class ScanCommand extends Command
     showFewOpt = new Option("f", "show few", true, "Only shows certain amount of characters");
     
     scanOptAuths.setArgName("comma-separated-authorizations");
+    scanOptRow.setArgName("row");
     scanOptStartRow.setArgName("start-row");
     scanOptEndRow.setArgName("end-row");
     scanOptColumns.setArgName("{<columnfamily>[:<columnqualifier>]}");
@@ -176,6 +187,7 @@ public class ScanCommand extends Command
     showFewOpt.setArgName("int");
     
     o.addOption(scanOptAuths);
+    o.addOption(scanOptRow);
     o.addOption(scanOptStartRow);
     o.addOption(scanOptEndRow);
     o.addOption(scanOptColumns);

Propchange: incubator/accumulo/trunk/src/server/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Feb  6 19:42:41 2012
@@ -1,3 +1,3 @@
-/incubator/accumulo/branches/1.3/src/server: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/src/server:1209938
-/incubator/accumulo/branches/1.4/src/server:1201902-1241113
+/incubator/accumulo/branches/1.3/src/server: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.4/src/server:1201902-1241123



Mime
View raw message