Package org.apache.solr.cloud
Class MiniSolrCloudCluster.Builder
- java.lang.Object
-
- org.apache.solr.cloud.MiniSolrCloudCluster.Builder
-
- Enclosing class:
- MiniSolrCloudCluster
public static class MiniSolrCloudCluster.Builder extends Object
Builder class for a MiniSolrCloudCluster
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MiniSolrCloudCluster.Builder
addConfig(String configName, Path configPath)
Upload a collection config before tests startMiniSolrCloudCluster
build()
Configure, run and return theMiniSolrCloudCluster
MiniSolrCloudCluster
configure()
Configure and run theMiniSolrCloudCluster
MiniSolrCloudCluster.Builder
formatZkServer(boolean formatZkServer)
MiniSolrCloudCluster.Builder
useOtherCollectionConfigSetExecution()
This method makes the MiniSolrCloudCluster use the "other" Collection API execution strategy than it normally would.MiniSolrCloudCluster.Builder
withDefaultClusterProperty(String key, String value)
MiniSolrCloudCluster.Builder
withDistributedClusterStateUpdates(boolean distributedCollectionConfigSetApi, boolean distributedClusterStateUpdates)
MiniSolrCloudCluster.Builder
withJettyConfig(Consumer<JettyConfig.Builder> fun)
Use a JettyConfig.Builder to configure the cluster's jetty serversMiniSolrCloudCluster.Builder
withMetrics(boolean trackJettyMetrics)
MiniSolrCloudCluster.Builder
withProperty(String propertyName, String propertyValue)
Set a cluster propertyMiniSolrCloudCluster.Builder
withSecurityJson(String securityJson)
Configure the specified security.json for the MiniSolrCloudClusterMiniSolrCloudCluster.Builder
withSecurityJson(Path securityJson)
Configure the specified security.json for the MiniSolrCloudClusterMiniSolrCloudCluster.Builder
withSolrXml(String solrXml)
Use the provided string as solr.xml contentMiniSolrCloudCluster.Builder
withSolrXml(Path solrXml)
Read solr.xml from the provided path
-
-
-
Constructor Detail
-
Builder
public Builder(int nodeCount, Path baseDir)
Create a builder- Parameters:
nodeCount
- the number of nodes in the clusterbaseDir
- a base directory for the cluster
-
-
Method Detail
-
withJettyConfig
public MiniSolrCloudCluster.Builder withJettyConfig(Consumer<JettyConfig.Builder> fun)
Use a JettyConfig.Builder to configure the cluster's jetty servers
-
withSolrXml
public MiniSolrCloudCluster.Builder withSolrXml(String solrXml)
Use the provided string as solr.xml content
-
withSolrXml
public MiniSolrCloudCluster.Builder withSolrXml(Path solrXml)
Read solr.xml from the provided path
-
withSecurityJson
public MiniSolrCloudCluster.Builder withSecurityJson(Path securityJson)
Configure the specified security.json for the MiniSolrCloudCluster- Parameters:
securityJson
- The path specifying the security.json file- Returns:
- the instance of MiniSolrCloudCluster.Builder
-
withSecurityJson
public MiniSolrCloudCluster.Builder withSecurityJson(String securityJson)
Configure the specified security.json for the MiniSolrCloudCluster- Parameters:
securityJson
- The string specifying the security.json configuration- Returns:
- the instance of MiniSolrCloudCluster.Builder
-
addConfig
public MiniSolrCloudCluster.Builder addConfig(String configName, Path configPath)
Upload a collection config before tests start- Parameters:
configName
- the config nameconfigPath
- the path to the config files
-
useOtherCollectionConfigSetExecution
public MiniSolrCloudCluster.Builder useOtherCollectionConfigSetExecution()
This method makes the MiniSolrCloudCluster use the "other" Collection API execution strategy than it normally would. When some test classes call this method (and some don't) we make sure that a run of multiple tests with a single seed will exercise both code lines (distributed and Overseer based Collection API) so regressions can be spotted faster.The real need is for a few tests covering reasonable use cases to call this method. If you're adding a new test, you don't have to call it (but it's ok if you do).
-
withDistributedClusterStateUpdates
public MiniSolrCloudCluster.Builder withDistributedClusterStateUpdates(boolean distributedCollectionConfigSetApi, boolean distributedClusterStateUpdates)
-
withProperty
public MiniSolrCloudCluster.Builder withProperty(String propertyName, String propertyValue)
Set a cluster property- Parameters:
propertyName
- the property namepropertyValue
- the property value
-
withMetrics
public MiniSolrCloudCluster.Builder withMetrics(boolean trackJettyMetrics)
-
formatZkServer
public MiniSolrCloudCluster.Builder formatZkServer(boolean formatZkServer)
-
configure
public MiniSolrCloudCluster configure() throws Exception
Configure and run theMiniSolrCloudCluster
- Throws:
Exception
- if an error occurs on startup
-
build
public MiniSolrCloudCluster build() throws Exception
Configure, run and return theMiniSolrCloudCluster
- Throws:
Exception
- if an error occurs on startup
-
withDefaultClusterProperty
public MiniSolrCloudCluster.Builder withDefaultClusterProperty(String key, String value)
-
-