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) | 
| org.apache.solr.common.util.NamedList<Object> | createCollection(String name,
                int numShards,
                int replicationFactor,
                String configName,
                String createNodeSet,
                String asyncId,
                Map<String,String> collectionProperties) | 
| org.apache.solr.common.util.NamedList<Object> | deleteCollection(String name) | 
| List<org.apache.solr.client.solrj.embedded.JettySolrRunner> | getJettySolrRunners() | 
| 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 | 
| protected org.apache.solr.client.solrj.embedded.JettySolrRunner | startJettySolrRunner(org.apache.solr.client.solrj.embedded.JettySolrRunner jetty) | 
| 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) | 
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 ZkTestServer getZkServer()
public List<org.apache.solr.client.solrj.embedded.JettySolrRunner> getJettySolrRunners()
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 JettyExceptionpublic 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 configurationExceptionpublic 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 JettySolrRunnerExceptionpublic org.apache.solr.client.solrj.embedded.JettySolrRunner startJettySolrRunner()
                                                                           throws Exception
Exceptionpublic org.apache.solr.client.solrj.embedded.JettySolrRunner stopJettySolrRunner(int index)
                                                                          throws Exception
index - the index of node in collection returned by getJettySolrRunners()Exceptionprotected org.apache.solr.client.solrj.embedded.JettySolrRunner startJettySolrRunner(org.apache.solr.client.solrj.embedded.JettySolrRunner jetty)
                                                                              throws Exception
Exceptionprotected org.apache.solr.client.solrj.embedded.JettySolrRunner stopJettySolrRunner(org.apache.solr.client.solrj.embedded.JettySolrRunner jetty)
                                                                             throws Exception
Exceptionpublic void uploadConfigDir(File configDir, String configName) throws IOException, org.apache.zookeeper.KeeperException, InterruptedException
IOExceptionorg.apache.zookeeper.KeeperExceptionInterruptedExceptionpublic 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
org.apache.solr.client.solrj.SolrServerExceptionIOExceptionpublic 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
org.apache.solr.client.solrj.SolrServerExceptionIOExceptionpublic org.apache.solr.common.util.NamedList<Object> deleteCollection(String name) throws org.apache.solr.client.solrj.SolrServerException, IOException
org.apache.solr.client.solrj.SolrServerExceptionIOExceptionpublic void shutdown()
              throws Exception
Exceptionpublic org.apache.solr.client.solrj.impl.CloudSolrClient getSolrClient()
protected org.apache.solr.client.solrj.impl.CloudSolrClient buildSolrClient()
Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.