You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by kt...@apache.org on 2019/05/07 17:07:08 UTC
[accumulo] branch master updated: fix #1129 honoring pn option in
grep and egrep (#1135)
This is an automated email from the ASF dual-hosted git repository.
kturner pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/accumulo.git
The following commit(s) were added to refs/heads/master by this push:
new 531d258 fix #1129 honoring pn option in grep and egrep (#1135)
531d258 is described below
commit 531d258db5c0a90a5d76b214977b2ec064a84233
Author: Don Resnik <do...@vistronix.com>
AuthorDate: Tue May 7 13:07:03 2019 -0400
fix #1129 honoring pn option in grep and egrep (#1135)
---
.../main/java/org/apache/accumulo/shell/commands/EGrepCommand.java | 4 +---
.../main/java/org/apache/accumulo/shell/commands/GrepCommand.java | 6 ++++--
.../main/java/org/apache/accumulo/shell/commands/ScanCommand.java | 4 ++--
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/EGrepCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/EGrepCommand.java
index 1395362..a121099 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/commands/EGrepCommand.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/commands/EGrepCommand.java
@@ -16,8 +16,6 @@
*/
package org.apache.accumulo.shell.commands;
-import java.io.IOException;
-
import org.apache.accumulo.core.client.BatchScanner;
import org.apache.accumulo.core.client.IteratorSetting;
import org.apache.accumulo.core.iterators.user.RegExFilter;
@@ -31,7 +29,7 @@ public class EGrepCommand extends GrepCommand {
@Override
protected void setUpIterator(final int prio, final String name, final String term,
- final BatchScanner scanner, CommandLine cl, boolean negate) throws IOException {
+ final BatchScanner scanner, CommandLine cl, boolean negate) throws Exception {
if (prio < 0) {
throw new IllegalArgumentException("Priority < 0 " + prio);
}
diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/GrepCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/GrepCommand.java
index 138fe92..50e9510 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/commands/GrepCommand.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/commands/GrepCommand.java
@@ -16,7 +16,6 @@
*/
package org.apache.accumulo.shell.commands;
-import java.io.IOException;
import java.util.Collections;
import java.util.concurrent.TimeUnit;
@@ -63,6 +62,7 @@ public class GrepCommand extends ScanCommand {
if (cl.hasOption(negateOpt.getOpt())) {
negate = true;
}
+
final Authorizations auths = getAuths(cl, shellState);
final BatchScanner scanner =
shellState.getAccumuloClient().createBatchScanner(tableName, auths, numThreads);
@@ -71,6 +71,7 @@ public class GrepCommand extends ScanCommand {
scanner.setTimeout(getTimeout(cl), TimeUnit.MILLISECONDS);
setupSampling(tableName, cl, shellState, scanner);
+ addScanIterators(shellState, cl, scanner, "");
for (int i = 0; i < cl.getArgs().length; i++) {
setUpIterator(Integer.MAX_VALUE - cl.getArgs().length + i, "grep" + i, cl.getArgs()[i],
@@ -93,7 +94,8 @@ public class GrepCommand extends ScanCommand {
}
protected void setUpIterator(final int prio, final String name, final String term,
- final BatchScanner scanner, CommandLine cl, boolean negate) throws IOException {
+ final BatchScanner scanner, CommandLine cl, boolean negate) throws Exception {
+
if (prio < 0) {
throw new IllegalArgumentException("Priority < 0 " + prio);
}
diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/ScanCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/ScanCommand.java
index e3255e6..4173d5f 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/commands/ScanCommand.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/commands/ScanCommand.java
@@ -60,11 +60,11 @@ public class ScanCommand extends Command {
formatterOpt, interpreterOpt, formatterInterpeterOpt, outputFileOpt;
protected Option timestampOpt;
+ protected Option profileOpt;
private Option optStartRowExclusive;
private Option optStartRowInclusive;
private Option optEndRowExclusive;
private Option timeoutOption;
- private Option profileOpt;
private Option sampleOpt;
private Option contextOpt;
private Option executionHintsOpt;
@@ -164,7 +164,7 @@ public class ScanCommand extends Command {
}
}
- protected void addScanIterators(final Shell shellState, CommandLine cl, final Scanner scanner,
+ protected void addScanIterators(final Shell shellState, CommandLine cl, final ScannerBase scanner,
final String tableName) throws Exception {
List<IteratorSetting> tableScanIterators;