You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by ct...@apache.org on 2023/11/14 16:35:02 UTC

(accumulo) branch main updated (8f9636b268 -> 0e8dc7ab84)

This is an automated email from the ASF dual-hosted git repository.

ctubbsii pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/accumulo.git


    from 8f9636b268 Modified Compactor and ScanServer to advertise Client service (#3928) (#3951)
     add db98f7d988 Fix show-few option for ScanCommand (#3905)
     new 0e8dc7ab84 Merge branch '2.1'

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../org/apache/accumulo/shell/commands/GrepCommand.java  | 16 ++++++++++++++--
 .../org/apache/accumulo/shell/commands/ScanCommand.java  | 10 +++++-----
 2 files changed, 19 insertions(+), 7 deletions(-)


(accumulo) 01/01: Merge branch '2.1'

Posted by ct...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ctubbsii pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/accumulo.git

commit 0e8dc7ab8495b0e34889f4a450fdf027a5f79bc4
Merge: 8f9636b268 db98f7d988
Author: Christopher Tubbs <ct...@apache.org>
AuthorDate: Tue Nov 14 11:34:48 2023 -0500

    Merge branch '2.1'

 .../org/apache/accumulo/shell/commands/GrepCommand.java  | 16 ++++++++++++++--
 .../org/apache/accumulo/shell/commands/ScanCommand.java  | 10 +++++-----
 2 files changed, 19 insertions(+), 7 deletions(-)

diff --cc shell/src/main/java/org/apache/accumulo/shell/commands/GrepCommand.java
index a5975d6e54,90c4a6fb44..2579fb4b01
--- a/shell/src/main/java/org/apache/accumulo/shell/commands/GrepCommand.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/commands/GrepCommand.java
@@@ -49,7 -49,24 +49,21 @@@ public class GrepCommand extends ScanCo
        if (cl.getArgList().isEmpty()) {
          throw new MissingArgumentException("No terms specified");
        }
+       // Configure formatting options
+       final FormatterConfig config = new FormatterConfig();
+       config.setPrintTimestamps(cl.hasOption(timestampOpt.getOpt()));
+       if (cl.hasOption(showFewOpt.getOpt())) {
+         final String showLength = cl.getOptionValue(showFewOpt.getOpt());
+         try {
+           final int length = Integer.parseInt(showLength);
+           config.setShownLength(length);
+         } catch (NumberFormatException nfe) {
+           Shell.log.error("Arg must be an integer.", nfe);
+         } catch (IllegalArgumentException iae) {
+           Shell.log.error("Arg must be greater than one.", iae);
+         }
+       }
        final Class<? extends Formatter> formatter = getFormatter(cl, tableName, shellState);
 -      @SuppressWarnings("deprecation")
 -      final org.apache.accumulo.core.util.interpret.ScanInterpreter interpeter =
 -          getInterpreter(cl, tableName, shellState);
  
        // handle first argument, if present, the authorizations list to
        // scan with
@@@ -81,11 -98,9 +95,9 @@@
        }
        try {
          // handle columns
 -        fetchColumns(cl, scanner, interpeter);
 +        fetchColumns(cl, scanner);
  
          // output the records
-         final FormatterConfig config = new FormatterConfig();
-         config.setPrintTimestamps(cl.hasOption(timestampOpt.getOpt()));
          printRecords(cl, shellState, config, scanner, formatter, printFile);
        } finally {
          scanner.close();
diff --cc shell/src/main/java/org/apache/accumulo/shell/commands/ScanCommand.java
index 2e8a7514d0,12ccc94350..a20b6f5c6d
--- a/shell/src/main/java/org/apache/accumulo/shell/commands/ScanCommand.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/commands/ScanCommand.java
@@@ -56,9 -57,10 +56,10 @@@ import org.apache.hadoop.io.Text
  
  public class ScanCommand extends Command {
  
-   private Option scanOptAuths, scanOptRow, scanOptColumns, disablePaginationOpt, showFewOpt,
-       outputFileOpt, scanOptCf, scanOptCq;
 -  private Option scanOptAuths, scanOptRow, scanOptColumns, disablePaginationOpt, formatterOpt,
 -      interpreterOpt, formatterInterpeterOpt, outputFileOpt, scanOptCf, scanOptCq;
++  private Option scanOptAuths, scanOptRow, scanOptColumns, disablePaginationOpt, outputFileOpt,
++      scanOptCf, scanOptCq;
  
+   protected Option showFewOpt;
    protected Option timestampOpt;
    protected Option profileOpt;
    private Option optStartRowExclusive;
@@@ -388,7 -481,9 +388,6 @@@
      o.addOption(timestampOpt);
      o.addOption(disablePaginationOpt);
      o.addOption(OptUtil.tableOpt("table to be scanned"));
-     o.addOption(showFewOpt);
 -    o.addOption(formatterOpt);
 -    o.addOption(interpreterOpt);
 -    o.addOption(formatterInterpeterOpt);
      o.addOption(timeoutOption);
      if (Arrays.asList(ScanCommand.class.getName(), GrepCommand.class.getName(),
          EGrepCommand.class.getName()).contains(this.getClass().getName())) {