Package org.apache.solr.util
Class SolrCLI.RunExampleTool
- java.lang.Object
- 
- org.apache.solr.util.SolrCLI.ToolBase
- 
- org.apache.solr.util.SolrCLI.RunExampleTool
 
 
- 
- All Implemented Interfaces:
- SolrCLI.Tool
 - Enclosing class:
- SolrCLI
 
 public static class SolrCLI.RunExampleTool extends SolrCLI.ToolBase Supports an interactive session with the user to launch (or relaunch the -e cloud example)
- 
- 
Field SummaryFields Modifier and Type Field Description protected FileexampleDirprotected org.apache.commons.exec.Executorexecutorprotected Stringscriptprotected FileserverDirprotected StringurlSchemeprotected InputStreamuserInput- 
Fields inherited from class org.apache.solr.util.SolrCLI.ToolBasestdout, verbose
 
- 
 - 
Constructor SummaryConstructors Constructor Description RunExampleTool()Default constructor used by the framework when running as a command-line application.RunExampleTool(org.apache.commons.exec.Executor executor, InputStream userInput, PrintStream stdout)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Map<String,Object>checkPortConflict(String solrUrl, File solrHomeDir, int port, org.apache.commons.cli.CommandLine cli)protected voidcopyIfNeeded(File src, File dest)protected StringcreateCloudExampleCollection(int numNodes, Scanner readInput, boolean prompt, String solrUrl)StringgetName()protected Map<String,Object>getNodeStatus(String solrUrl, int maxWaitSecs)org.apache.commons.cli.Option[]getOptions()protected booleanisPortAvailable(int port)protected booleanisValidConfig(File configsetsDir, String config)protected Stringprompt(Scanner s, String prompt)protected Stringprompt(Scanner s, String prompt, String defaultValue)protected IntegerpromptForInt(Scanner s, String prompt, String label, Integer defVal, Integer min, Integer max)protected IntegerpromptForPort(Scanner s, int node, String prompt, Integer defVal)protected StringreadExtraArgs(String[] extraArgsArr)protected voidrunCloudExample(org.apache.commons.cli.CommandLine cli)protected voidrunExample(org.apache.commons.cli.CommandLine cli, String exampleName)protected voidrunImpl(org.apache.commons.cli.CommandLine cli)protected voidsetCollectionConfigProperty(String solrUrl, String collectionName, String propName, String propValue)protected FilesetupExampleDir(File serverDir, File exampleParentDir, String dirName)protected Map<String,Object>startSolr(File solrHomeDir, boolean cloudMode, org.apache.commons.cli.CommandLine cli, int port, String zkHost, int maxWaitSecs)protected voidwaitToSeeLiveNodes(int maxWaitSecs, String zkHost, int numNodes)- 
Methods inherited from class org.apache.solr.util.SolrCLI.ToolBaseecho, echoIfVerbose, runTool
 
- 
 
- 
- 
- 
Field Detail- 
userInputprotected InputStream userInput 
 - 
executorprotected org.apache.commons.exec.Executor executor 
 - 
scriptprotected String script 
 - 
serverDirprotected File serverDir 
 - 
exampleDirprotected File exampleDir 
 - 
urlSchemeprotected String urlScheme 
 
- 
 - 
Constructor Detail- 
RunExampleToolpublic RunExampleTool() Default constructor used by the framework when running as a command-line application.
 - 
RunExampleToolpublic RunExampleTool(org.apache.commons.exec.Executor executor, InputStream userInput, PrintStream stdout)
 
- 
 - 
Method Detail- 
getNamepublic String getName() 
 - 
getOptionspublic org.apache.commons.cli.Option[] getOptions() 
 - 
runImplprotected void runImpl(org.apache.commons.cli.CommandLine cli) throws Exception- Specified by:
- runImplin class- SolrCLI.ToolBase
- Throws:
- Exception
 
 - 
runExampleprotected void runExample(org.apache.commons.cli.CommandLine cli, String exampleName) throws Exception- Throws:
- Exception
 
 - 
runCloudExampleprotected void runCloudExample(org.apache.commons.cli.CommandLine cli) throws Exception- Throws:
- Exception
 
 - 
setCollectionConfigPropertyprotected void setCollectionConfigProperty(String solrUrl, String collectionName, String propName, String propValue) 
 - 
waitToSeeLiveNodesprotected void waitToSeeLiveNodes(int maxWaitSecs, String zkHost, int numNodes)
 - 
startSolrprotected Map<String,Object> startSolr(File solrHomeDir, boolean cloudMode, org.apache.commons.cli.CommandLine cli, int port, String zkHost, int maxWaitSecs) throws Exception - Throws:
- Exception
 
 - 
checkPortConflictprotected Map<String,Object> checkPortConflict(String solrUrl, File solrHomeDir, int port, org.apache.commons.cli.CommandLine cli) 
 - 
createCloudExampleCollectionprotected String createCloudExampleCollection(int numNodes, Scanner readInput, boolean prompt, String solrUrl) throws Exception - Throws:
- Exception
 
 - 
getNodeStatusprotected Map<String,Object> getNodeStatus(String solrUrl, int maxWaitSecs) throws Exception - Throws:
- Exception
 
 - 
setupExampleDirprotected File setupExampleDir(File serverDir, File exampleParentDir, String dirName) throws IOException - Throws:
- IOException
 
 - 
copyIfNeededprotected void copyIfNeeded(File src, File dest) throws IOException - Throws:
- IOException
 
 - 
isPortAvailableprotected boolean isPortAvailable(int port) 
 - 
promptForIntprotected Integer promptForInt(Scanner s, String prompt, String label, Integer defVal, Integer min, Integer max) 
 
- 
 
-