public class JettySolrRunner extends Object
Modifier and Type | Class and Description |
---|---|
static class |
JettySolrRunner.DebugFilter |
static class |
JettySolrRunner.Servlet404
This is a stupid hack to give jetty something to attach to
|
Constructor and Description |
---|
JettySolrRunner(String solrHome,
JettyConfig config)
Construct a JettySolrRunner
After construction, you must start the jetty with
start() |
JettySolrRunner(String solrHome,
Properties nodeProperties,
JettyConfig config)
Construct a JettySolrRunner
After construction, you must start the jetty with
start() |
JettySolrRunner(String solrHome,
String context,
int port)
Create a new JettySolrRunner.
|
Modifier and Type | Method and Description |
---|---|
URL |
getBaseUrl()
Returns a base URL consisting of the protocol, host, and port for a
Connector in use by the Jetty Server contained in this runner.
|
CoreContainer |
getCoreContainer() |
JettySolrRunner.DebugFilter |
getDebugFilter() |
int |
getLocalPort()
Returns the Local Port of the jetty Server.
|
String |
getNodeName() |
Properties |
getNodeProperties() |
SolrDispatchFilter |
getSolrDispatchFilter() |
String |
getSolrHome() |
boolean |
isRunning() |
boolean |
isStopped() |
static void |
main(String[] args)
A main class that starts jetty+solr This is useful for debugging
|
SolrClient |
newClient() |
SolrClient |
newClient(int connectionTimeoutMillis,
int socketTimeoutMillis) |
void |
setProxyPort(int proxyPort)
Sets the port of a local socket proxy that sits infront of this server; if set
then all client traffic will flow through the proxy, giving us the ability to
simulate network partitions very easily.
|
void |
start()
Start the Jetty server
If the server has been started before, it will restart using the same port
|
void |
start(boolean reusePort)
Start the Jetty server
|
void |
stop()
Stop the Jetty server
|
public JettySolrRunner(String solrHome, String context, int port)
start()
solrHome
- the solr home directory to usecontext
- the context to run inport
- the port to run onpublic JettySolrRunner(String solrHome, JettyConfig config)
start()
solrHome
- the base path to run fromconfig
- the configurationpublic JettySolrRunner(String solrHome, Properties nodeProperties, JettyConfig config)
start()
solrHome
- the solrHome to usenodeProperties
- the container propertiesconfig
- the configurationpublic SolrDispatchFilter getSolrDispatchFilter()
SolrDispatchFilter
for this nodepublic CoreContainer getCoreContainer()
CoreContainer
for this nodepublic String getNodeName()
public boolean isRunning()
public boolean isStopped()
public void start() throws Exception
Exception
- if an error occurs on startuppublic void start(boolean reusePort) throws Exception
reusePort
- when true, will start up on the same port as used by any
previous runs of this JettySolrRunner. If false, will use
the port specified by the server's JettyConfig.Exception
- if an error occurs on startuppublic void stop() throws Exception
Exception
- if an error occurs on shutdownpublic int getLocalPort()
RuntimeException
- if there is no Connectorpublic void setProxyPort(int proxyPort)
public URL getBaseUrl()
public SolrClient newClient()
public SolrClient newClient(int connectionTimeoutMillis, int socketTimeoutMillis)
public JettySolrRunner.DebugFilter getDebugFilter()
public static void main(String[] args)
public String getSolrHome()
public Properties getNodeProperties()
Copyright © 2000-2018 Apache Software Foundation. All Rights Reserved.