public class MiniSolrCloudCluster extends Object
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_CLOUD_SOLR_XML |
Constructor and Description |
---|
MiniSolrCloudCluster(int numServers,
Path baseDir,
org.apache.solr.client.solrj.embedded.JettyConfig jettyConfig)
Create a MiniSolrCloudCluster with default solr.xml
|
MiniSolrCloudCluster(int numServers,
Path baseDir,
String solrXml,
org.apache.solr.client.solrj.embedded.JettyConfig jettyConfig)
Create a MiniSolrCloudCluster
|
MiniSolrCloudCluster(int numServers,
Path baseDir,
String solrXml,
org.apache.solr.client.solrj.embedded.JettyConfig jettyConfig,
ZkTestServer zkTestServer)
Create a MiniSolrCloudCluster
|
MiniSolrCloudCluster(int numServers,
String hostContext,
Path baseDir,
String solrXml,
SortedMap<org.eclipse.jetty.servlet.ServletHolder,String> extraServlets,
SortedMap<Class<? extends javax.servlet.Filter>,String> extraRequestFilters)
Create a MiniSolrCloudCluster
|
MiniSolrCloudCluster(int numServers,
String hostContext,
Path baseDir,
String solrXml,
SortedMap<org.eclipse.jetty.servlet.ServletHolder,String> extraServlets,
SortedMap<Class<? extends javax.servlet.Filter>,String> extraRequestFilters,
org.apache.solr.client.solrj.embedded.SSLConfig sslConfig)
Create a MiniSolrCloudCluster
|
Modifier and Type | Method and Description |
---|---|
protected org.apache.solr.client.solrj.impl.CloudSolrClient |
buildSolrClient() |
org.apache.solr.common.util.NamedList<Object> |
createCollection(String name,
int numShards,
int replicationFactor,
String configName,
Map<String,String> collectionProperties)
Deprecated.
Use
CollectionAdminRequest.createCollection(String, String, int, int) |
org.apache.solr.common.util.NamedList<Object> |
createCollection(String name,
int numShards,
int replicationFactor,
String configName,
String createNodeSet,
String asyncId,
Map<String,String> collectionProperties)
Deprecated.
Use
CollectionAdminRequest.createCollection(String, String, int, int) |
void |
deleteAllCollections() |
org.apache.solr.common.util.NamedList<Object> |
deleteCollection(String name)
Deprecated.
use
CollectionAdminRequest.deleteCollection(String) |
void |
expireZkSession(org.apache.solr.client.solrj.embedded.JettySolrRunner jetty)
Make the zookeeper session on a particular jetty expire
|
List<org.apache.solr.client.solrj.embedded.JettySolrRunner> |
getJettySolrRunners() |
org.apache.solr.client.solrj.embedded.JettySolrRunner |
getRandomJetty(Random random) |
org.apache.solr.client.solrj.embedded.JettySolrRunner |
getReplicaJetty(org.apache.solr.common.cloud.Replica replica)
Return the jetty that a particular replica resides on
|
org.apache.solr.client.solrj.impl.CloudSolrClient |
getSolrClient() |
ZkTestServer |
getZkServer() |
void |
shutdown()
Shut down the cluster, including all Solr nodes and ZooKeeper
|
org.apache.solr.client.solrj.embedded.JettySolrRunner |
startJettySolrRunner()
Start a new Solr instance, using the default config
|
org.apache.solr.client.solrj.embedded.JettySolrRunner |
startJettySolrRunner(org.apache.solr.client.solrj.embedded.JettySolrRunner jetty)
Add a previously stopped node back to the cluster
|
org.apache.solr.client.solrj.embedded.JettySolrRunner |
startJettySolrRunner(String name,
String hostContext,
org.apache.solr.client.solrj.embedded.JettyConfig config)
Start a new Solr instance on a particular servlet context
|
org.apache.solr.client.solrj.embedded.JettySolrRunner |
startJettySolrRunner(String name,
String hostContext,
SortedMap<org.eclipse.jetty.servlet.ServletHolder,String> extraServlets,
SortedMap<Class<? extends javax.servlet.Filter>,String> extraRequestFilters)
Start a new Solr instance
|
org.apache.solr.client.solrj.embedded.JettySolrRunner |
startJettySolrRunner(String name,
String hostContext,
SortedMap<org.eclipse.jetty.servlet.ServletHolder,String> extraServlets,
SortedMap<Class<? extends javax.servlet.Filter>,String> extraRequestFilters,
org.apache.solr.client.solrj.embedded.SSLConfig sslConfig)
Start a new Solr instance
|
org.apache.solr.client.solrj.embedded.JettySolrRunner |
stopJettySolrRunner(int index)
Stop a Solr instance
|
protected org.apache.solr.client.solrj.embedded.JettySolrRunner |
stopJettySolrRunner(org.apache.solr.client.solrj.embedded.JettySolrRunner jetty) |
void |
uploadConfigDir(File configDir,
String configName)
Deprecated.
|
void |
uploadConfigSet(Path configDir,
String configName)
Upload a config set
|
void |
waitForAllNodes(int timeout) |
public static final String DEFAULT_CLOUD_SOLR_XML
public MiniSolrCloudCluster(int numServers, Path baseDir, org.apache.solr.client.solrj.embedded.JettyConfig jettyConfig) throws Exception
numServers
- number of Solr servers to startbaseDir
- base directory that the mini cluster should be run fromjettyConfig
- Jetty configurationException
- if there was an error starting the clusterpublic MiniSolrCloudCluster(int numServers, String hostContext, Path baseDir, String solrXml, SortedMap<org.eclipse.jetty.servlet.ServletHolder,String> extraServlets, SortedMap<Class<? extends javax.servlet.Filter>,String> extraRequestFilters) throws Exception
numServers
- number of Solr servers to starthostContext
- context path of Solr servers used by JettybaseDir
- base directory that the mini cluster should be run fromsolrXml
- solr.xml file to be uploaded to ZooKeeperextraServlets
- Extra servlets to be started by JettyextraRequestFilters
- extra filters to be started by JettyException
- if there was an error starting the clusterpublic MiniSolrCloudCluster(int numServers, String hostContext, Path baseDir, String solrXml, SortedMap<org.eclipse.jetty.servlet.ServletHolder,String> extraServlets, SortedMap<Class<? extends javax.servlet.Filter>,String> extraRequestFilters, org.apache.solr.client.solrj.embedded.SSLConfig sslConfig) throws Exception
numServers
- number of Solr servers to starthostContext
- context path of Solr servers used by JettybaseDir
- base directory that the mini cluster should be run fromsolrXml
- solr.xml file to be uploaded to ZooKeeperextraServlets
- Extra servlets to be started by JettyextraRequestFilters
- extra filters to be started by JettysslConfig
- SSL configurationException
- if there was an error starting the clusterpublic MiniSolrCloudCluster(int numServers, Path baseDir, String solrXml, org.apache.solr.client.solrj.embedded.JettyConfig jettyConfig) throws Exception
numServers
- number of Solr servers to startbaseDir
- base directory that the mini cluster should be run fromsolrXml
- solr.xml file to be uploaded to ZooKeeperjettyConfig
- Jetty configurationException
- if there was an error starting the clusterpublic MiniSolrCloudCluster(int numServers, Path baseDir, String solrXml, org.apache.solr.client.solrj.embedded.JettyConfig jettyConfig, ZkTestServer zkTestServer) throws Exception
numServers
- number of Solr servers to startbaseDir
- base directory that the mini cluster should be run fromsolrXml
- solr.xml file to be uploaded to ZooKeeperjettyConfig
- Jetty configurationzkTestServer
- ZkTestServer to use. If null, one will be createdException
- if there was an error starting the clusterpublic void waitForAllNodes(int timeout) throws IOException, InterruptedException
IOException
InterruptedException
public ZkTestServer getZkServer()
public List<org.apache.solr.client.solrj.embedded.JettySolrRunner> getJettySolrRunners()
public org.apache.solr.client.solrj.embedded.JettySolrRunner getRandomJetty(Random random)
public org.apache.solr.client.solrj.embedded.JettySolrRunner startJettySolrRunner(String name, String hostContext, SortedMap<org.eclipse.jetty.servlet.ServletHolder,String> extraServlets, SortedMap<Class<? extends javax.servlet.Filter>,String> extraRequestFilters) throws Exception
hostContext
- context path of Solr servers used by JettyextraServlets
- Extra servlets to be started by JettyextraRequestFilters
- extra filters to be started by JettyException
public org.apache.solr.client.solrj.embedded.JettySolrRunner startJettySolrRunner(String name, String hostContext, SortedMap<org.eclipse.jetty.servlet.ServletHolder,String> extraServlets, SortedMap<Class<? extends javax.servlet.Filter>,String> extraRequestFilters, org.apache.solr.client.solrj.embedded.SSLConfig sslConfig) throws Exception
hostContext
- context path of Solr servers used by JettyextraServlets
- Extra servlets to be started by JettyextraRequestFilters
- extra filters to be started by JettysslConfig
- SSL configurationException
public org.apache.solr.client.solrj.embedded.JettySolrRunner startJettySolrRunner(String name, String hostContext, org.apache.solr.client.solrj.embedded.JettyConfig config) throws Exception
name
- the instance namehostContext
- the context to run onconfig
- a JettyConfig for the instance's JettySolrRunner
Exception
public org.apache.solr.client.solrj.embedded.JettySolrRunner startJettySolrRunner() throws Exception
Exception
public org.apache.solr.client.solrj.embedded.JettySolrRunner stopJettySolrRunner(int index) throws Exception
index
- the index of node in collection returned by getJettySolrRunners()
Exception
public org.apache.solr.client.solrj.embedded.JettySolrRunner startJettySolrRunner(org.apache.solr.client.solrj.embedded.JettySolrRunner jetty) throws Exception
jetty
- a JettySolrRunner
previously returned by stopJettySolrRunner(int)
Exception
- on errorprotected org.apache.solr.client.solrj.embedded.JettySolrRunner stopJettySolrRunner(org.apache.solr.client.solrj.embedded.JettySolrRunner jetty) throws Exception
Exception
@Deprecated public void uploadConfigDir(File configDir, String configName) throws IOException, org.apache.zookeeper.KeeperException, InterruptedException
uploadConfigSet(Path, String)
IOException
org.apache.zookeeper.KeeperException
InterruptedException
public void uploadConfigSet(Path configDir, String configName) throws IOException, org.apache.zookeeper.KeeperException, InterruptedException
configDir
- a path to the config set to uploadconfigName
- the name to give the configsetIOException
org.apache.zookeeper.KeeperException
InterruptedException
@Deprecated public org.apache.solr.common.util.NamedList<Object> createCollection(String name, int numShards, int replicationFactor, String configName, Map<String,String> collectionProperties) throws org.apache.solr.client.solrj.SolrServerException, IOException
CollectionAdminRequest.createCollection(String, String, int, int)
org.apache.solr.client.solrj.SolrServerException
IOException
@Deprecated public org.apache.solr.common.util.NamedList<Object> createCollection(String name, int numShards, int replicationFactor, String configName, String createNodeSet, String asyncId, Map<String,String> collectionProperties) throws org.apache.solr.client.solrj.SolrServerException, IOException
CollectionAdminRequest.createCollection(String, String, int, int)
org.apache.solr.client.solrj.SolrServerException
IOException
@Deprecated public org.apache.solr.common.util.NamedList<Object> deleteCollection(String name) throws org.apache.solr.client.solrj.SolrServerException, IOException
CollectionAdminRequest.deleteCollection(String)
org.apache.solr.client.solrj.SolrServerException
IOException
public void shutdown() throws Exception
Exception
public org.apache.solr.client.solrj.impl.CloudSolrClient getSolrClient()
protected org.apache.solr.client.solrj.impl.CloudSolrClient buildSolrClient()
public org.apache.solr.client.solrj.embedded.JettySolrRunner getReplicaJetty(org.apache.solr.common.cloud.Replica replica)
public void expireZkSession(org.apache.solr.client.solrj.embedded.JettySolrRunner jetty)
Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.