Package org.apache.solr.bench
Class SolrBenchState
java.lang.Object
org.apache.solr.bench.SolrBenchState
JMH
State class for Solr benchmarks. This is the benchmark's facade to Solr.-
Field Summary
FieldsModifier and TypeFieldDescriptionThe Client.The Nodes.static final intThe constant PROC_COUNT. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcheckWarmUp(org.openjdk.jmh.infra.Control control) Check warm up.voidcreateCollection(String collection, int numShards, int numReplicas) Create collection.voiddoSetup(org.openjdk.jmh.infra.BenchmarkParams benchmarkParams, BaseBenchState baseBenchState) Do setup.voidDump core info.voidforceMerge(String collection, int maxMergeSegments) Force merge.static PathGets file.Gets random.voidvoidIndex.voidmetricsEnabled(boolean metricsEnabled) Metrics enabled.static org.apache.solr.common.params.ModifiableSolrParamsParams modifiable solr params.static org.apache.solr.common.params.ModifiableSolrParamsParams modifiable solr params.voidsetUseHttp1(boolean useHttp1) Setting useHttp1 to true will make theclientuse http1voidshutdownSolr(org.openjdk.jmh.infra.BenchmarkParams benchmarkParams, BaseBenchState baseBenchState) Shutdown Solr.voidstartSolr(int nodeCount) Start Solr.voidtearDown(org.openjdk.jmh.infra.BenchmarkParams benchmarkParams) Tear down.voidwaitForMerges(String collection) Wait for merges.
-
Field Details
-
PROC_COUNT
public static final int PROC_COUNTThe constant PROC_COUNT. -
nodes
The Nodes. -
zkHost
-
client
The Client.
-
-
Constructor Details
-
SolrBenchState
public SolrBenchState()
-
-
Method Details
-
tearDown
Tear down.- Parameters:
benchmarkParams- the benchmark params- Throws:
Exception- the exception
-
checkWarmUp
Check warm up.- Parameters:
control- the control- Throws:
Exception- the exception
-
shutdownSolr
public void shutdownSolr(org.openjdk.jmh.infra.BenchmarkParams benchmarkParams, BaseBenchState baseBenchState) throws Exception Shutdown Solr.- Parameters:
benchmarkParams- the benchmark params- Throws:
Exception- the exception
-
doSetup
public void doSetup(org.openjdk.jmh.infra.BenchmarkParams benchmarkParams, BaseBenchState baseBenchState) throws Exception Do setup.- Parameters:
benchmarkParams- the benchmark paramsbaseBenchState- the base bench state- Throws:
Exception- the exception
-
metricsEnabled
public void metricsEnabled(boolean metricsEnabled) Metrics enabled.- Parameters:
metricsEnabled- the metrics enabled
-
startSolr
public void startSolr(int nodeCount) Start Solr.- Parameters:
nodeCount- the node count
-
getRandom
Gets random.- Returns:
- the random
-
createCollection
Create collection.- Parameters:
collection- the collectionnumShards- the num shardsnumReplicas- the num replicas- Throws:
Exception- the exception
-
setUseHttp1
public void setUseHttp1(boolean useHttp1) Setting useHttp1 to true will make theclientuse http1 -
index
- Throws:
Exception
-
index
Index.- Parameters:
collection- the collectiondocs- the docsdocCount- the doc count- Throws:
Exception- the exception
-
waitForMerges
Wait for merges.- Parameters:
collection- the collection- Throws:
Exception- the exception
-
forceMerge
Force merge.- Parameters:
collection- the collectionmaxMergeSegments- the max merge segments- Throws:
Exception- the exception
-
dumpCoreInfo
Dump core info.- Throws:
IOException- the io exception
-
params
Params modifiable solr params.- Parameters:
moreParams- the more params- Returns:
- the modifiable solr params
-
params
public static org.apache.solr.common.params.ModifiableSolrParams params(org.apache.solr.common.params.ModifiableSolrParams params, String... moreParams) Params modifiable solr params.- Parameters:
params- the paramsmoreParams- the more params- Returns:
- the modifiable solr params
-
getFile
Gets file.- Parameters:
name- the name- Returns:
- the file
-