Issue 1129 fix grep pn option#1135
Merged
keith-turner merged 6 commits intoapache:masterfrom May 7, 2019
Merged
Conversation
the pn (profile name) option existed for grep and egrep commands, but it did not do anything. Fix adds iterators with given pn to the grep and egrep scanner
ctubbsii
requested changes
Apr 30, 2019
Add check for pn option in Grep and Egrep commands. When pn is used, only grep from iterators in that profile.
…nResnik/accumulo into Issue-1129-fix-grep-pn-option
Contributor
Author
|
I rebased and squashed to update the bad commit comments. They are still in the history here, but they are not on the branch. Please let me know if I need to do anything else. |
keith-turner
reviewed
May 2, 2019
| final Options opts = super.getOptions(); | ||
| numThreadsOpt = new Option("nt", "num-threads", true, "number of threads to use"); | ||
| negateOpt = new Option("v", "negate", false, "only include rows without search term"); | ||
| profileNameOpt = new Option("pn", "profile-name", true, |
Contributor
There was a problem hiding this comment.
Not completely sure, but I think the earlier call to super.getOptions(); may already add a profile option.
Contributor
Author
There was a problem hiding this comment.
agreed, code updated
Make small updates to ScanCommand.java to provide for inherited pn option to work for grep and egrep commands
keith-turner
reviewed
May 3, 2019
shell/src/main/java/org/apache/accumulo/shell/commands/GrepCommand.java
Outdated
Show resolved
Hide resolved
shell/src/main/java/org/apache/accumulo/shell/commands/EGrepCommand.java
Outdated
Show resolved
Hide resolved
Contributor
|
Looks good, thanks @DonResnik |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Here are the commands I ran to test this:
root@uno> createtable test
root@uno> insert row1 colf colq value
root@uno> insert row1 colf1 colq value
root@uno> insert row2 colf colq value
root@uno> insert row2 colf1 colq value
root@uno test> scan
row1 colf:colq1 [] value
row1 colf1:colq1 [] value
row2 colf:colq1 [] value
row2 colf1:colq1 [] value
root@uno test> setshelliter -class org.apache.accumulo.core.iterators.ColumnFamilyCounter -p 100 -pn testIter
[skipped the name and name-value setting options]
root@uno test> scan -pn testIter
row1 colf: [] 1
row1 colf1: [] 1
row2 colf: [] 1
row2 colf1: [] 1
root@uno test> grep row1 -pn testIter
row1 colf: [] 1
row1 colf1: [] 1
root@uno test> egrep .row1. -pn testIter
row1 colf: [] 1
row1 colf1: [] 1