Class Config
java.lang.Object
org.apache.lucene.benchmark.byTask.utils.Config
Perf run configuration properties.
Numeric property containing ":", e.g. "10:100:5" is interpreted as array of numeric values. It is extracted once, on first use, and maintain a round number to return the appropriate value.
The config property "work.dir" tells where is the root of docs data dirs and indexes dirs. It is set to either of:
- value supplied for it in the alg file;
- otherwise, value of System property "benchmark.work.dir";
- otherwise, "work".
-
Constructor Summary
ConstructorDescriptionRead both algorithm and config properties.Config
(Properties props) Create config without algorithm - useful for a programmatic perf test. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Return a boolean property.double
Return a double property.int
Return an int property.Return a string property.getColsValuesForValsByRound
(int roundNum) int
int
int
newRound()
Increment the round number, for config values that are extracted by round number.void
Set a property.void
setNumThreads
(int numThreads)
-
Constructor Details
-
Config
Read both algorithm and config properties.- Parameters:
algReader
- from where to read algorithm and config properties.- Throws:
IOException
- If there is a low-level I/O error.
-
Config
Create config without algorithm - useful for a programmatic perf test.- Parameters:
props
- - configuration properties.
-
-
Method Details
-
setNumThreads
public void setNumThreads(int numThreads) -
getNumThreads
public int getNumThreads() -
get
Return a string property.- Parameters:
name
- name of property.dflt
- default value.- Returns:
- a string property.
-
set
Set a property. Note: once a multiple values property is set, it can no longer be modified.- Parameters:
name
- name of property.value
- either single or multiple property value (multiple values are separated by ":")- Throws:
Exception
-
get
Return an int property. If the property contain ":", e.g. "10:100:5", it is interpreted as array of ints. It is extracted once, on first call to get() it, and a by-round-value is returned.- Parameters:
name
- name of propertydflt
- default value- Returns:
- a int property.
-
get
Return a double property. If the property contain ":", e.g. "10:100:5", it is interpreted as array of doubles. It is extracted once, on first call to get() it, and a by-round-value is returned.- Parameters:
name
- name of propertydflt
- default value- Returns:
- a double property.
-
get
Return a boolean property. If the property contain ":", e.g. "true.true.false", it is interpreted as array of booleans. It is extracted once, on first call to get() it, and a by-round-value is returned.- Parameters:
name
- name of propertydflt
- default value- Returns:
- a int property.
-
newRound
public int newRound()Increment the round number, for config values that are extracted by round number.- Returns:
- the new round number.
-
getColsNamesForValsByRound
- Returns:
- names of params set by round, for reports title
-
getColsValuesForValsByRound
- Returns:
- values of params set by round, for reports lines.
-
getRoundNumber
public int getRoundNumber()- Returns:
- the round number.
-
getAlgorithmText
- Returns:
- Returns the algorithmText.
-