org.apache.lucene.benchmark.byTask.utils

Class Config

public class Config extends Object

Perf run configuration properties. Numeric peroperty containing ":", e.g. "10:100:5" is interpreted as array of numeric values. It is extracted once, on first use, and maintain an round number to return the appropriate value.
Constructor Summary
Config(Reader algReader)
Read both algorithm and config properties.
Config(Properties props)
Create config without algorithm - usefull for a programmatic perf test.
Method Summary
Stringget(String name, String dflt)
Return a string property.
intget(String name, int dflt)
Return an int property.
booleanget(String name, boolean dflt)
Return a boolean property.
StringgetAlgorithmText()
StringgetColsNamesForValsByRound()
StringgetColsValuesForValsByRound(int roundNum)
intgetRoundNumber()
intnewRound()
Increment the round number, for config values that are extracted by round number.
voidset(String name, String value)
Set a property.

Constructor Detail

Config

public Config(Reader algReader)
Read both algorithm and config properties.

Parameters: algReader from where to read algorithm and config properties.

Throws: IOException

Config

public Config(Properties props)
Create config without algorithm - usefull for a programmatic perf test.

Parameters: props - configuration properties.

Throws: IOException

Method Detail

get

public String get(String name, String dflt)
Return a string property.

Parameters: name name of property. dflt default value.

Returns: a string property.

get

public int get(String name, int dflt)
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 property dflt default value

Returns: a int property.

get

public boolean get(String name, boolean dflt)
Return a boolean property. If the property contain ":", e.g. "true.true.false", it is interpreted as array of boleans. It is extracted once, on first call to get() it, and a by-round-value is returned.

Parameters: name name of property dflt default value

Returns: a int property.

getAlgorithmText

public String getAlgorithmText()

Returns: Returns the algorithmText.

getColsNamesForValsByRound

public String getColsNamesForValsByRound()

Returns: names of params set by round, for reports title

getColsValuesForValsByRound

public String getColsValuesForValsByRound(int roundNum)

Returns: values of params set by round, for reports lines.

getRoundNumber

public int getRoundNumber()

Returns: the round number.

newRound

public int newRound()
Increment the round number, for config values that are extracted by round number.

Returns: the new round number.

set

public void set(String name, String value)
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 propery value (multple values are separated by ":")

Throws: Exception

Copyright © 2000-2007 Apache Software Foundation. All Rights Reserved.