Class StatusTool

java.lang.Object
org.apache.solr.cli.ToolBase
org.apache.solr.cli.StatusTool
All Implemented Interfaces:
Tool

public class StatusTool extends ToolBase
Supports status command in the bin/solr script.

Get the status of a Solr server.

  • Field Details

    • PORT_OPTION

      public static final org.apache.commons.cli.Option PORT_OPTION
    • SHORT_OPTION

      public static final org.apache.commons.cli.Option SHORT_OPTION
  • Constructor Details

  • Method Details

    • getName

      public String getName()
      Description copied from interface: Tool
      Defines the interface to a Solr tool that can be run from this command-line app.
    • getOptions

      public org.apache.commons.cli.Options getOptions()
      Description copied from interface: Tool
      Retrieve the Options supported by this tool.
      Specified by:
      getOptions in interface Tool
      Overrides:
      getOptions in class ToolBase
      Returns:
      The Options this tool supports.
    • runImpl

      public void runImpl(org.apache.commons.cli.CommandLine cli) throws Exception
      Specified by:
      runImpl in class ToolBase
      Throws:
      Exception
    • waitForSolrUpAndPrintStatus

      public void waitForSolrUpAndPrintStatus(String solrUrl, org.apache.commons.cli.CommandLine cli, int maxWaitSecs) throws Exception
      Throws:
      Exception
    • waitForSolrUp

      public boolean waitForSolrUp(String solrUrl, org.apache.commons.cli.CommandLine cli, int maxWaitSecs) throws Exception
      Wait for Solr to come online and return true if it does, false otherwise.
      Parameters:
      solrUrl - the URL of the Solr server
      cli - the command line options
      maxWaitSecs - the maximum number of seconds to wait
      Returns:
      true if Solr comes online, false otherwise
      Throws:
      Exception
    • printStatusFromRunningSolr

      public boolean printStatusFromRunningSolr(String solrUrl, org.apache.commons.cli.CommandLine cli)
    • statusFromRunningSolr

      public String statusFromRunningSolr(String solrUrl, org.apache.commons.cli.CommandLine cli) throws Exception
      Get the status of a Solr server and responds with a JSON status string.
      Parameters:
      solrUrl - the URL of the Solr server
      cli - the command line options
      Returns:
      the status of the Solr server or null if the server is not online
      Throws:
      Exception - if there is an error getting the status
    • waitToSeeSolrUp

      public Map<String,Object> waitToSeeSolrUp(String solrUrl, String credentials, long maxWait, TimeUnit unit) throws Exception
      Throws:
      Exception
    • getStatus

      public Map<String,Object> getStatus(String solrUrl, String credentials) throws Exception
      Throws:
      Exception
    • getStatus

      public Map<String,Object> getStatus(org.apache.solr.client.solrj.SolrClient solrClient) throws Exception
      Throws:
      Exception
    • reportStatus

      public static Map<String,Object> reportStatus(org.apache.solr.common.util.NamedList<Object> info, org.apache.solr.client.solrj.SolrClient solrClient) throws Exception
      Throws:
      Exception