You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@solr.apache.org by ep...@apache.org on 2024/09/18 16:36:50 UTC

(solr) branch branch_9x updated: SOLR-17457: Fix support for --max-wait-secs for bin/solr.cmd (#2717)

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

epugh pushed a commit to branch branch_9x
in repository https://gitbox.apache.org/repos/asf/solr.git


The following commit(s) were added to refs/heads/branch_9x by this push:
     new cacb29ebe34 SOLR-17457: Fix support for --max-wait-secs for bin/solr.cmd (#2717)
cacb29ebe34 is described below

commit cacb29ebe341668d0ebba8fa4ed2a72781d4dd5d
Author: Christos Malliaridis <c....@gmail.com>
AuthorDate: Wed Sep 18 19:36:44 2024 +0300

    SOLR-17457: Fix support for --max-wait-secs for bin/solr.cmd (#2717)
    
    * Add support for --max-wait-secs and deprecate --maxWaitSecs in StatusTool
---
 .../src/java/org/apache/solr/cli/StatusTool.java   | 25 ++++++++++++++++------
 1 file changed, 18 insertions(+), 7 deletions(-)

diff --git a/solr/core/src/java/org/apache/solr/cli/StatusTool.java b/solr/core/src/java/org/apache/solr/cli/StatusTool.java
index 9e85b446bb4..f69c82debdc 100644
--- a/solr/core/src/java/org/apache/solr/cli/StatusTool.java
+++ b/solr/core/src/java/org/apache/solr/cli/StatusTool.java
@@ -25,6 +25,7 @@ import java.util.Map;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.TimeoutException;
 import org.apache.commons.cli.CommandLine;
+import org.apache.commons.cli.DeprecatedAttributes;
 import org.apache.commons.cli.HelpFormatter;
 import org.apache.commons.cli.Option;
 import org.apache.commons.cli.Options;
@@ -52,7 +53,7 @@ public class StatusTool extends ToolBase {
     return "status";
   }
 
-  public static final Option OPTION_MAXWAITSECS =
+  private static final Option OPTION_MAXWAITSECS =
       Option.builder()
           .longOpt("max-wait-secs")
           .argName("SECS")
@@ -61,6 +62,20 @@ public class StatusTool extends ToolBase {
           .desc("Wait up to the specified number of seconds to see Solr running.")
           .build();
 
+  private static final Option OPTION_MAXWAITSECS_DEPRECATED =
+      Option.builder("maxWaitSecs")
+          .argName("SECS")
+          .hasArg()
+          .required(false)
+          .desc("Wait up to the specified number of seconds to see Solr running.")
+          .deprecated(
+              DeprecatedAttributes.builder()
+                  .setForRemoval(true)
+                  .setSince("9.7")
+                  .setDescription("Use --max-wait-secs instead")
+                  .get())
+          .build();
+
   @Override
   public List<Option> getOptions() {
     return List.of(
@@ -77,12 +92,8 @@ public class StatusTool extends ToolBase {
                     + SolrCLI.getDefaultSolrUrl()
                     + '.')
             .build(),
-        Option.builder("maxWaitSecs")
-            .argName("SECS")
-            .hasArg()
-            .required(false)
-            .desc("Wait up to the specified number of seconds to see Solr running.")
-            .build());
+        OPTION_MAXWAITSECS,
+        OPTION_MAXWAITSECS_DEPRECATED);
   }
 
   @Override