Fixes frequency command, fixes use of period instead of colon. Fixes frequency printing
Signed-off-by: Aaron McCurry <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/incubator-blur/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-blur/commit/d17e64e7 Tree: http://git-wip-us.apache.org/repos/asf/incubator-blur/tree/d17e64e7 Diff: http://git-wip-us.apache.org/repos/asf/incubator-blur/diff/d17e64e7 Branch: refs/heads/apache-blur-0.2 Commit: d17e64e7970f0c28eca0709544b9afebe66b9159 Parents: 57b85a1 Author: hunterwilliams <[email protected]> Authored: Thu Sep 12 14:04:57 2013 -0400 Committer: Aaron McCurry <[email protected]> Committed: Sun Sep 15 20:56:22 2013 -0400 ---------------------------------------------------------------------- .../java/org/apache/blur/shell/TermsDataCommand.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/d17e64e7/blur-shell/src/main/java/org/apache/blur/shell/TermsDataCommand.java ---------------------------------------------------------------------- diff --git a/blur-shell/src/main/java/org/apache/blur/shell/TermsDataCommand.java b/blur-shell/src/main/java/org/apache/blur/shell/TermsDataCommand.java index 1b05142..7afe5c3 100644 --- a/blur-shell/src/main/java/org/apache/blur/shell/TermsDataCommand.java +++ b/blur-shell/src/main/java/org/apache/blur/shell/TermsDataCommand.java @@ -63,8 +63,8 @@ public class TermsDataCommand extends Command implements TableFirstArgCommand { short size = 100; - if (namePlusValue.contains(":")){ - int index = namePlusValue.indexOf(":"); + if (namePlusValue.contains(".")){ + int index = namePlusValue.indexOf("."); family = namePlusValue.substring(0, index); column = namePlusValue.substring(index + 1); } @@ -86,9 +86,12 @@ public class TermsDataCommand extends Command implements TableFirstArgCommand { //todo print line by line. also break input at certain amount List<String> terms = client.terms(tablename,family,column,startWith,size); for (int i=0;i<terms.size(); i++){ - out.println(terms.get(i)); if (checkFreq){ - out.println("\t"+client.recordFrequency(tablename,family,column,terms.get(i))); + out.println(terms.get(i)+"\t"+client.recordFrequency(tablename,family,column,terms.get(i))); + } + else + { + out.println(terms.get(i)); } } } @@ -115,8 +118,7 @@ public class TermsDataCommand extends Command implements TableFirstArgCommand { .withDescription("The value to start with.").create("s")); options.addOption(OptionBuilder.withArgName("size").hasArg() .withDescription("The number of terms to return.").create("n")); - options.addOption(OptionBuilder.withArgName("frequency").hasArg() - .withDescription("The frequency of each term.").create("F")); + options.addOption(OptionBuilder.withDescription("The frequency of each term.").create("F")); CommandLineParser parser = new PosixParser(); CommandLine cmd = null;
