Package org.apache.solr.cli
Class StatusTool
java.lang.Object
org.apache.solr.cli.ToolBase
org.apache.solr.cli.StatusTool
- All Implemented Interfaces:
Tool
Supports status command in the bin/solr script.
Get the status of a Solr server.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.apache.commons.cli.Optionstatic final org.apache.commons.cli.Option -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetName()Defines the interface to a Solr tool that can be run from this command-line app.org.apache.commons.cli.OptionsRetrieve theOptionssupported by this tool.getStatus(org.apache.solr.client.solrj.SolrClient solrClient) booleanprintStatusFromRunningSolr(String solrUrl, org.apache.commons.cli.CommandLine cli) reportStatus(org.apache.solr.common.util.NamedList<Object> info, org.apache.solr.client.solrj.SolrClient solrClient) voidrunImpl(org.apache.commons.cli.CommandLine cli) statusFromRunningSolr(String solrUrl, org.apache.commons.cli.CommandLine cli) Get the status of a Solr server and responds with a JSON status string.booleanwaitForSolrUp(String solrUrl, org.apache.commons.cli.CommandLine cli, int maxWaitSecs) Wait for Solr to come online and return true if it does, false otherwise.voidwaitForSolrUpAndPrintStatus(String solrUrl, org.apache.commons.cli.CommandLine cli, int maxWaitSecs) waitToSeeSolrUp(String solrUrl, String credentials, long maxWait, TimeUnit unit) Methods inherited from class org.apache.solr.cli.ToolBase
echo, echoIfVerbose, getConnectionOptions, getRuntime, isVerbose, runTool
-
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
-
StatusTool
-
-
Method Details
-
getName
Description copied from interface:ToolDefines 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:ToolRetrieve theOptionssupported by this tool.- Specified by:
getOptionsin interfaceTool- Overrides:
getOptionsin classToolBase- Returns:
- The
Optionsthis tool supports.
-
runImpl
-
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 servercli- the command line optionsmaxWaitSecs- the maximum number of seconds to wait- Returns:
- true if Solr comes online, false otherwise
- Throws:
Exception
-
printStatusFromRunningSolr
-
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 servercli- 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
- 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
-