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,
Properties nodeProperties,
JettyConfig config,
boolean enableProxy)
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.
|
URL |
getBaseURLV2() |
CoreContainer |
getCoreContainer() |
JettySolrRunner.DebugFilter |
getDebugFilter() |
int |
getLocalPort()
Returns the Local Port of the jetty Server.
|
int |
getLocalPort(boolean internalPort)
Returns the Local Port of the jetty Server.
|
String |
getNodeName() |
Properties |
getNodeProperties() |
SocketProxy |
getProxy() |
URL |
getProxyBaseUrl()
Returns a base URL consisting of the protocol, host, and port for a
Connector in use by the Jetty Server contained in this runner.
|
SolrDispatchFilter |
getSolrDispatchFilter() |
String |
getSolrHome() |
protected org.eclipse.jetty.server.handler.HandlerWrapper |
injectJettyHandlers(org.eclipse.jetty.server.handler.HandlerWrapper chain)
descendants may inject own handler chaining it to the given root
and then returning that own one
|
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 JettySolrRunner(String solrHome, Properties nodeProperties, JettyConfig config, boolean enableProxy)
start()
solrHome
- the solrHome to usenodeProperties
- the container propertiesconfig
- the configurationenableProxy
- enables proxy feature to disable connectionsprotected org.eclipse.jetty.server.handler.HandlerWrapper injectJettyHandlers(org.eclipse.jetty.server.handler.HandlerWrapper chain)
public 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 int getLocalPort(boolean internalPort)
internalPort
- pass true to get the true jetty port rather than the proxy port if configuredRuntimeException
- if there is no Connectorpublic void setProxyPort(int proxyPort)
public URL getBaseUrl()
public URL getBaseURLV2()
public URL getProxyBaseUrl()
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()
public SocketProxy getProxy()
Copyright © 2000-2020 Apache Software Foundation. All Rights Reserved.