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 2021/03/24 00:08:54 UTC

[accumulo] branch main updated: Deprecate the shell script command (#1970)

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


The following commit(s) were added to refs/heads/main by this push:
     new 6e30475  Deprecate the shell script command (#1970)
6e30475 is described below

commit 6e30475419e49e5c5f8d8f03c1f00fc55ebf39cd
Author: harjitdotsingh <75...@users.noreply.github.com>
AuthorDate: Tue Mar 23 20:07:11 2021 -0400

    Deprecate the shell script command (#1970)
    
    This fixes #1949
---
 shell/src/main/java/org/apache/accumulo/shell/Shell.java          | 1 +
 .../java/org/apache/accumulo/shell/commands/ScriptCommand.java    | 8 ++++++++
 2 files changed, 9 insertions(+)

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 ed23b25..a206406 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/Shell.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/Shell.java
@@ -393,6 +393,7 @@ public class Shell extends ShellOptions implements KeywordExecutable {
         {new ClasspathCommand(), new org.apache.accumulo.shell.commands.DebugCommand(),
             new ListScansCommand(), new ListCompactionsCommand(), new TraceCommand(),
             new PingCommand(), new ListBulkCommand(), new ListTabletsCommand()};
+    @SuppressWarnings("deprecation")
     Command[] execCommands =
         {new ExecfileCommand(), new HistoryCommand(), new ExtensionCommand(), new ScriptCommand()};
     Command[] exitCommands = {new ByeCommand(), new ExitCommand(), new QuitCommand()};
diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/ScriptCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/ScriptCommand.java
index fdece54..59cb596 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/commands/ScriptCommand.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/commands/ScriptCommand.java
@@ -54,6 +54,12 @@ import org.apache.commons.cli.Options;
 
 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
 
+/**
+ * @deprecated since 2.0; this command shouldn't be used; The script command is deprecated; use
+ *             jshell for scripting instead
+ */
+
+@Deprecated(since = "2.1.0")
 public class ScriptCommand extends Command {
 
   // Command to allow user to run scripts, see JSR-223
@@ -68,6 +74,8 @@ public class ScriptCommand extends Command {
   public int execute(String fullCommand, CommandLine cl, Shell shellState) throws Exception {
 
     boolean invoke = false;
+
+    Shell.log.warn("The script command is deprecated; use jshell for scripting instead");
     ScriptEngineManager mgr = new ScriptEngineManager();
 
     if (cl.hasOption(list.getOpt())) {