Package org.apache.solr.cli
Class SolrProcessManager
- java.lang.Object
-
- org.apache.solr.cli.SolrProcessManager
-
public class SolrProcessManager extends Object
Class to interact with Solr OS processes
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SolrProcessManager.SolrProcess
Represents a running Solr process
-
Field Summary
Fields Modifier and Type Field Description static boolean
enableTestingMode
-
Constructor Summary
Constructors Constructor Description SolrProcessManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Collection<SolrProcessManager.SolrProcess>
getAllRunning()
Optional<SolrProcessManager.SolrProcess>
getProcessForPid(Long pid)
Return the SolrProcess for a given PID, if it is runningboolean
isRunningWithPid(Long pid)
boolean
isRunningWithPort(Integer port)
Optional<SolrProcessManager.SolrProcess>
processForPort(Integer port)
Collection<SolrProcessManager.SolrProcess>
scanSolrPidFiles()
Scans the PID directory for Solr PID files and returns a list of SolrProcesses for each running Solr instance.
-
-
-
Method Detail
-
isRunningWithPort
public boolean isRunningWithPort(Integer port)
-
isRunningWithPid
public boolean isRunningWithPid(Long pid)
-
processForPort
public Optional<SolrProcessManager.SolrProcess> processForPort(Integer port)
-
getProcessForPid
public Optional<SolrProcessManager.SolrProcess> getProcessForPid(Long pid)
Return the SolrProcess for a given PID, if it is running
-
scanSolrPidFiles
public Collection<SolrProcessManager.SolrProcess> scanSolrPidFiles() throws IOException
Scans the PID directory for Solr PID files and returns a list of SolrProcesses for each running Solr instance. If a PID file is found but no process is running, the PID file is deleted. On Windows, the file is a 'PORT' file containing the port number.- Returns:
- a list of SolrProcesses for each running Solr instance
- Throws:
IOException
-
getAllRunning
public Collection<SolrProcessManager.SolrProcess> getAllRunning()
-
-