accumulo-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] keith-turner commented on a change in pull request #519: Add filter to listcompactions
Date Wed, 06 Jun 2018 14:25:57 GMT
keith-turner commented on a change in pull request #519: Add filter to listcompactions
URL: https://github.com/apache/accumulo/pull/519#discussion_r193429710
 
 

 ##########
 File path: shell/src/main/java/org/apache/accumulo/shell/commands/ListCompactionsCommand.java
 ##########
 @@ -54,7 +58,17 @@ public int execute(final String fullCommand, final CommandLine cl, final
Shell s
       tservers = instanceOps.getTabletServers();
     }
 
-    shellState.printLines(new ActiveCompactionIterator(tservers, instanceOps), paginate);
+    if (cl.hasOption(filterOption.getOpt())) {
+      filterText = cl.getOptionValue(filterOption.getOpt());
+    }
+    Iterator<String> activeCompactionIterator = new ActiveCompactionIterator(tservers,
instanceOps);
+    if (filterText != null) {
+      String finalFilterText = filterText;
+      activeCompactionIterator = Iterators.filter(activeCompactionIterator,
+          t -> t.contains(finalFilterText));
 
 Review comment:
   Could do a regex instead of contains.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message