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

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


The following commit(s) were added to refs/heads/main by this push:
     new 52f4c8de86 Mark ScanInterpreter related API as deprecated (#2787) 
(#2806)
52f4c8de86 is described below

commit 52f4c8de862ef8658adc43f4b2afb8abff9cd2d0
Author: Christopher L. Shannon <christopher.l.shan...@gmail.com>
AuthorDate: Tue Jul 19 08:27:45 2022 -0400

    Mark ScanInterpreter related API as deprecated (#2787) (#2806)
---
 .../src/main/java/org/apache/accumulo/core/conf/Property.java |  5 ++++-
 .../org/apache/accumulo/core/util/format/HexFormatter.java    |  1 +
 .../accumulo/core/util/interpret/DefaultScanInterpreter.java  |  4 ++++
 .../accumulo/core/util/interpret/HexScanInterpreter.java      |  1 +
 .../apache/accumulo/core/util/interpret/ScanInterpreter.java  |  3 +++
 .../apache/accumulo/core/util/format/HexFormatterTest.java    |  1 +
 shell/src/main/java/org/apache/accumulo/shell/Shell.java      |  1 +
 .../org/apache/accumulo/shell/commands/DeleteManyCommand.java |  1 +
 .../org/apache/accumulo/shell/commands/FormatterCommand.java  |  2 ++
 .../java/org/apache/accumulo/shell/commands/GrepCommand.java  |  1 +
 .../apache/accumulo/shell/commands/InterpreterCommand.java    |  4 ++++
 .../org/apache/accumulo/shell/commands/MaxRowCommand.java     |  1 +
 .../java/org/apache/accumulo/shell/commands/ScanCommand.java  | 11 ++++++++---
 13 files changed, 32 insertions(+), 4 deletions(-)

diff --git a/core/src/main/java/org/apache/accumulo/core/conf/Property.java 
b/core/src/main/java/org/apache/accumulo/core/conf/Property.java
index 82d0264284..100d8f4c69 100644
--- a/core/src/main/java/org/apache/accumulo/core/conf/Property.java
+++ b/core/src/main/java/org/apache/accumulo/core/conf/Property.java
@@ -1113,8 +1113,11 @@ public enum Property {
       "1.3.5"),
   TABLE_FORMATTER_CLASS("table.formatter", DefaultFormatter.class.getName(), 
PropertyType.STRING,
       "The Formatter class to apply on results in the shell", "1.4.0"),
+  @Deprecated(since = "2.1.0")
   TABLE_INTERPRETER_CLASS("table.interepreter", 
DefaultScanInterpreter.class.getName(),
-      PropertyType.STRING, "The ScanInterpreter class to apply on scan 
arguments in the shell",
+      PropertyType.STRING,
+      "The ScanInterpreter class to apply on scan arguments in the shell. "
+          + "Note that this property is deprecated and will be removed in a 
future version.",
       "1.5.0"),
   TABLE_CLASSLOADER_CONTEXT("table.class.loader.context", "", 
PropertyType.STRING,
       "The context to use for loading per-table resources, such as iterators"
diff --git 
a/core/src/main/java/org/apache/accumulo/core/util/format/HexFormatter.java 
b/core/src/main/java/org/apache/accumulo/core/util/format/HexFormatter.java
index e53a17805a..3d3fb3d011 100644
--- a/core/src/main/java/org/apache/accumulo/core/util/format/HexFormatter.java
+++ b/core/src/main/java/org/apache/accumulo/core/util/format/HexFormatter.java
@@ -29,6 +29,7 @@ import org.apache.hadoop.io.Text;
 /**
  * A simple formatter that print the row, column family, column qualifier, and 
value as hex
  */
+@Deprecated(since = "2.1.0")
 public class HexFormatter implements Formatter, ScanInterpreter {
 
   private char[] chars =
diff --git 
a/core/src/main/java/org/apache/accumulo/core/util/interpret/DefaultScanInterpreter.java
 
b/core/src/main/java/org/apache/accumulo/core/util/interpret/DefaultScanInterpreter.java
index eba0a4653a..25086ff61a 100644
--- 
a/core/src/main/java/org/apache/accumulo/core/util/interpret/DefaultScanInterpreter.java
+++ 
b/core/src/main/java/org/apache/accumulo/core/util/interpret/DefaultScanInterpreter.java
@@ -20,6 +20,10 @@ package org.apache.accumulo.core.util.interpret;
 
 import org.apache.hadoop.io.Text;
 
+/**
+ * @deprecated since 2.1.0 This will be removed in a future version in favor 
of JShell
+ */
+@Deprecated(since = "2.1.0")
 public class DefaultScanInterpreter implements ScanInterpreter {
 
   @Override
diff --git 
a/core/src/main/java/org/apache/accumulo/core/util/interpret/HexScanInterpreter.java
 
b/core/src/main/java/org/apache/accumulo/core/util/interpret/HexScanInterpreter.java
index c57a2bb257..09a0400b1c 100644
--- 
a/core/src/main/java/org/apache/accumulo/core/util/interpret/HexScanInterpreter.java
+++ 
b/core/src/main/java/org/apache/accumulo/core/util/interpret/HexScanInterpreter.java
@@ -25,6 +25,7 @@ import org.apache.accumulo.core.util.format.HexFormatter;
  * {@link HexFormatter} back to binary. The hex input can contain dashes 
(because
  * {@link HexFormatter} outputs dashes) which are ignored.
  */
+@Deprecated(since = "2.1.0")
 public class HexScanInterpreter extends HexFormatter {
 
 }
diff --git 
a/core/src/main/java/org/apache/accumulo/core/util/interpret/ScanInterpreter.java
 
b/core/src/main/java/org/apache/accumulo/core/util/interpret/ScanInterpreter.java
index 30f82c898f..7cac40ae72 100644
--- 
a/core/src/main/java/org/apache/accumulo/core/util/interpret/ScanInterpreter.java
+++ 
b/core/src/main/java/org/apache/accumulo/core/util/interpret/ScanInterpreter.java
@@ -23,7 +23,10 @@ import org.apache.hadoop.io.Text;
 /**
  * A simple interface for creating shell plugins that translate the range and 
column arguments for
  * the shell's scan command.
+ *
+ * @deprecated since 2.1.0 This will be removed in a future version in favor 
of JShell
  */
+@Deprecated(since = "2.1.0")
 public interface ScanInterpreter {
 
   Text interpretRow(Text row);
diff --git 
a/core/src/test/java/org/apache/accumulo/core/util/format/HexFormatterTest.java 
b/core/src/test/java/org/apache/accumulo/core/util/format/HexFormatterTest.java
index 901587d5f1..d276d1043b 100644
--- 
a/core/src/test/java/org/apache/accumulo/core/util/format/HexFormatterTest.java
+++ 
b/core/src/test/java/org/apache/accumulo/core/util/format/HexFormatterTest.java
@@ -31,6 +31,7 @@ import org.apache.hadoop.io.Text;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
 
+@Deprecated(since = "2.1.0")
 public class HexFormatterTest {
   HexFormatter formatter;
 
diff --git a/shell/src/main/java/org/apache/accumulo/shell/Shell.java 
b/shell/src/main/java/org/apache/accumulo/shell/Shell.java
index bf95e03f48..fa7e6946b8 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/Shell.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/Shell.java
@@ -377,6 +377,7 @@ public class Shell extends ShellOptions implements 
KeywordExecutable {
 
     rootToken = new Token();
 
+    @SuppressWarnings("deprecation")
     Command[] dataCommands = {new DeleteCommand(), new DeleteManyCommand(), 
new DeleteRowsCommand(),
         new EGrepCommand(), new FormatterCommand(), new InterpreterCommand(), 
new GrepCommand(),
         new ImportDirectoryCommand(), new InsertCommand(), new 
MaxRowCommand(), new ScanCommand()};
diff --git 
a/shell/src/main/java/org/apache/accumulo/shell/commands/DeleteManyCommand.java 
b/shell/src/main/java/org/apache/accumulo/shell/commands/DeleteManyCommand.java
index 8714a101c5..e21f8b0036 100644
--- 
a/shell/src/main/java/org/apache/accumulo/shell/commands/DeleteManyCommand.java
+++ 
b/shell/src/main/java/org/apache/accumulo/shell/commands/DeleteManyCommand.java
@@ -42,6 +42,7 @@ public class DeleteManyCommand extends ScanCommand {
       throws Exception {
     final String tableName = OptUtil.getTableOpt(cl, shellState);
 
+    @SuppressWarnings("deprecation")
     final ScanInterpreter interpeter = getInterpreter(cl, tableName, 
shellState);
 
     // handle first argument, if present, the authorizations list to
diff --git 
a/shell/src/main/java/org/apache/accumulo/shell/commands/FormatterCommand.java 
b/shell/src/main/java/org/apache/accumulo/shell/commands/FormatterCommand.java
index 714dbd91dd..bf517f45d3 100644
--- 
a/shell/src/main/java/org/apache/accumulo/shell/commands/FormatterCommand.java
+++ 
b/shell/src/main/java/org/apache/accumulo/shell/commands/FormatterCommand.java
@@ -57,6 +57,7 @@ public class FormatterCommand extends 
ShellPluginConfigurationCommand {
     return options;
   }
 
+  @SuppressWarnings("deprecation")
   @Override
   protected void setPlugin(final CommandLine cl, final Shell shellState, final 
String tableName,
       final String className) throws AccumuloException, 
AccumuloSecurityException {
@@ -67,6 +68,7 @@ public class FormatterCommand extends 
ShellPluginConfigurationCommand {
     }
   }
 
+  @SuppressWarnings("deprecation")
   @Override
   protected void removePlugin(final CommandLine cl, final Shell shellState, 
final String tableName)
       throws AccumuloException, AccumuloSecurityException {
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 99e7e5c500..f7211e7f50 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
@@ -51,6 +51,7 @@ public class GrepCommand extends ScanCommand {
         throw new MissingArgumentException("No terms specified");
       }
       final Class<? extends Formatter> formatter = getFormatter(cl, tableName, 
shellState);
+      @SuppressWarnings("deprecation")
       final ScanInterpreter interpeter = getInterpreter(cl, tableName, 
shellState);
 
       // handle first argument, if present, the authorizations list to
diff --git 
a/shell/src/main/java/org/apache/accumulo/shell/commands/InterpreterCommand.java
 
b/shell/src/main/java/org/apache/accumulo/shell/commands/InterpreterCommand.java
index 3741f5db43..57a184a2d7 100644
--- 
a/shell/src/main/java/org/apache/accumulo/shell/commands/InterpreterCommand.java
+++ 
b/shell/src/main/java/org/apache/accumulo/shell/commands/InterpreterCommand.java
@@ -22,6 +22,10 @@ import org.apache.accumulo.core.conf.Property;
 import org.apache.accumulo.core.util.interpret.ScanInterpreter;
 import org.apache.accumulo.shell.Shell;
 
+/**
+ * @deprecated since 2.1.0 This will be removed in a future version
+ */
+@Deprecated(since = "2.1.0")
 public class InterpreterCommand extends ShellPluginConfigurationCommand {
 
   public InterpreterCommand() {
diff --git 
a/shell/src/main/java/org/apache/accumulo/shell/commands/MaxRowCommand.java 
b/shell/src/main/java/org/apache/accumulo/shell/commands/MaxRowCommand.java
index 4394ed6d41..fbfc364d78 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/commands/MaxRowCommand.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/commands/MaxRowCommand.java
@@ -36,6 +36,7 @@ public class MaxRowCommand extends ScanCommand {
       throws Exception {
     final String tableName = OptUtil.getTableOpt(cl, shellState);
 
+    @SuppressWarnings("deprecation")
     final ScanInterpreter interpeter = getInterpreter(cl, tableName, 
shellState);
 
     final Range range = getRange(cl, interpeter);
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 afd4acc4d9..6d49ed3a68 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
@@ -93,6 +93,7 @@ public class ScanCommand extends Command {
       final String tableName = OptUtil.getTableOpt(cl, shellState);
 
       final Class<? extends Formatter> formatter = getFormatter(cl, tableName, 
shellState);
+      @SuppressWarnings("deprecation")
       final ScanInterpreter interpeter = getInterpreter(cl, tableName, 
shellState);
 
       String classLoaderContext = null;
@@ -215,6 +216,7 @@ public class ScanCommand extends Command {
     }
   }
 
+  @Deprecated(since = "2.1.0")
   protected ScanInterpreter getInterpreter(final CommandLine cl, final String 
tableName,
       final Shell shellState) throws Exception {
 
@@ -270,7 +272,8 @@ public class ScanCommand extends Command {
   }
 
   protected void fetchColumns(final CommandLine cl, final ScannerBase scanner,
-      final ScanInterpreter formatter) throws UnsupportedEncodingException {
+      @SuppressWarnings("deprecation") final ScanInterpreter formatter)
+      throws UnsupportedEncodingException {
 
     if ((cl.hasOption(scanOptCf.getOpt()) || cl.hasOption(scanOptCq.getOpt()))
         && cl.hasOption(scanOptColumns.getOpt())) {
@@ -296,7 +299,8 @@ public class ScanCommand extends Command {
     }
   }
 
-  private void fetchColumsWithCFAndCQ(CommandLine cl, Scanner scanner, 
ScanInterpreter interpeter) {
+  private void fetchColumsWithCFAndCQ(CommandLine cl, Scanner scanner,
+      @SuppressWarnings("deprecation") ScanInterpreter interpeter) {
     String cf = "";
     String cq = "";
     if (cl.hasOption(scanOptCf.getOpt())) {
@@ -322,7 +326,8 @@ public class ScanCommand extends Command {
 
   }
 
-  protected Range getRange(final CommandLine cl, final ScanInterpreter 
formatter)
+  protected Range getRange(final CommandLine cl,
+      @SuppressWarnings("deprecation") final ScanInterpreter formatter)
       throws UnsupportedEncodingException {
     if ((cl.hasOption(OptUtil.START_ROW_OPT) || 
cl.hasOption(OptUtil.END_ROW_OPT))
         && cl.hasOption(scanOptRow.getOpt())) {

Reply via email to