accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From els...@apache.org
Subject svn commit: r1482649 - in /accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/commands: DeleteIterCommand.java SetIterCommand.java
Date Wed, 15 May 2013 00:36:31 GMT
Author: elserj
Date: Wed May 15 00:36:31 2013
New Revision: 1482649

URL: http://svn.apache.org/r1482649
Log:
ACCUMULO-1406 Applying patch from Mike Drob to add shorthand notation on setiter/deleteiter
commands for all 3 iterator scopes.

Modified:
    accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/commands/DeleteIterCommand.java
    accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/commands/SetIterCommand.java

Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/commands/DeleteIterCommand.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/commands/DeleteIterCommand.java?rev=1482649&r1=1482648&r2=1482649&view=diff
==============================================================================
--- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/commands/DeleteIterCommand.java
(original)
+++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/commands/DeleteIterCommand.java
Wed May 15 00:36:31 2013
@@ -26,7 +26,7 @@ import org.apache.commons.cli.Option;
 import org.apache.commons.cli.Options;
 
 public class DeleteIterCommand extends Command {
-  private Option mincScopeOpt, majcScopeOpt, scanScopeOpt, nameOpt;
+  private Option allScopeOpt, mincScopeOpt, majcScopeOpt, scanScopeOpt, nameOpt;
   
   public int execute(final String fullCommand, final CommandLine cl, final Shell shellState)
throws Exception {
     final String tableName = OptUtil.getTableOpt(cl, shellState);
@@ -38,13 +38,13 @@ public class DeleteIterCommand extends C
     }
     
     final EnumSet<IteratorScope> scopes = EnumSet.noneOf(IteratorScope.class);
-    if (cl.hasOption(mincScopeOpt.getOpt())) {
+    if (cl.hasOption(allScopeOpt.getOpt()) || cl.hasOption(mincScopeOpt.getOpt())) {
       scopes.add(IteratorScope.minc);
     }
-    if (cl.hasOption(majcScopeOpt.getOpt())) {
+    if (cl.hasOption(allScopeOpt.getOpt()) || cl.hasOption(majcScopeOpt.getOpt())) {
       scopes.add(IteratorScope.majc);
     }
-    if (cl.hasOption(scanScopeOpt.getOpt())) {
+    if (cl.hasOption(allScopeOpt.getOpt()) || cl.hasOption(scanScopeOpt.getOpt())) {
       scopes.add(IteratorScope.scan);
     }
     if (scopes.isEmpty()) {
@@ -66,6 +66,7 @@ public class DeleteIterCommand extends C
     nameOpt.setArgName("itername");
     nameOpt.setRequired(true);
     
+    allScopeOpt = new Option("all", "all-scopes", false, "remove from all scopes");
     mincScopeOpt = new Option(IteratorScope.minc.name(), "minor-compaction", false, "remove
from minor compaction scope");
     majcScopeOpt = new Option(IteratorScope.majc.name(), "major-compaction", false, "remove
from major compaction scope");
     scanScopeOpt = new Option(IteratorScope.scan.name(), "scan-time", false, "remove from
scan scope");
@@ -73,6 +74,7 @@ public class DeleteIterCommand extends C
     o.addOption(OptUtil.tableOpt("table to delete the iterator from"));
     o.addOption(nameOpt);
     
+    o.addOption(allScopeOpt);
     o.addOption(mincScopeOpt);
     o.addOption(majcScopeOpt);
     o.addOption(scanScopeOpt);

Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/commands/SetIterCommand.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/commands/SetIterCommand.java?rev=1482649&r1=1482648&r2=1482649&view=diff
==============================================================================
--- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/commands/SetIterCommand.java
(original)
+++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/commands/SetIterCommand.java
Wed May 15 00:36:31 2013
@@ -52,7 +52,7 @@ import org.apache.commons.vfs2.FileSyste
 
 public class SetIterCommand extends Command {
   
-  private Option mincScopeOpt, majcScopeOpt, scanScopeOpt, nameOpt, priorityOpt;
+  private Option allScopeOpt, mincScopeOpt, majcScopeOpt, scanScopeOpt, nameOpt, priorityOpt;
   private Option aggTypeOpt, ageoffTypeOpt, regexTypeOpt, versionTypeOpt, reqvisTypeOpt,
classnameTypeOpt;
   
   @Override
@@ -149,13 +149,13 @@ public class SetIterCommand extends Comm
       }
     }
     final EnumSet<IteratorScope> scopes = EnumSet.noneOf(IteratorScope.class);
-    if (cl.hasOption(mincScopeOpt.getOpt())) {
+    if (cl.hasOption(allScopeOpt.getOpt()) || cl.hasOption(mincScopeOpt.getOpt())) {
       scopes.add(IteratorScope.minc);
     }
-    if (cl.hasOption(majcScopeOpt.getOpt())) {
+    if (cl.hasOption(allScopeOpt.getOpt()) || cl.hasOption(majcScopeOpt.getOpt())) {
       scopes.add(IteratorScope.majc);
     }
-    if (cl.hasOption(scanScopeOpt.getOpt())) {
+    if (cl.hasOption(allScopeOpt.getOpt()) || cl.hasOption(scanScopeOpt.getOpt())) {
       scopes.add(IteratorScope.scan);
     }
     if (scopes.isEmpty()) {
@@ -281,6 +281,7 @@ public class SetIterCommand extends Comm
     nameOpt = new Option("n", "name", true, "iterator to set");
     nameOpt.setArgName("itername");
     
+    allScopeOpt = new Option("all", "all-scopes", false, "applied at scan time, minor and
major compactions");
     mincScopeOpt = new Option(IteratorScope.minc.name(), "minor-compaction", false, "applied
at minor compaction");
     majcScopeOpt = new Option(IteratorScope.majc.name(), "major-compaction", false, "applied
at major compaction");
     scanScopeOpt = new Option(IteratorScope.scan.name(), "scan-time", false, "applied at
scan time");
@@ -305,6 +306,7 @@ public class SetIterCommand extends Comm
     o.addOption(OptUtil.tableOpt("table to configure iterators on"));
     o.addOption(priorityOpt);
     o.addOption(nameOpt);
+    o.addOption(allScopeOpt);
     o.addOption(mincScopeOpt);
     o.addOption(majcScopeOpt);
     o.addOption(scanScopeOpt);



Mime
View raw message