org.apache.lucene.benchmark.byTask.utils
Class Config

java.lang.Object
  extended by org.apache.lucene.benchmark.byTask.utils.Config

public class Config
extends java.lang.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(java.util.Properties props)
          Create config without algorithm - usefull for a programmatic perf test.
Config(java.io.Reader algReader)
          Read both algorithm and config properties.
 
Method Summary
 boolean get(java.lang.String name, boolean dflt)
          Return a boolean property.
 int get(java.lang.String name, int dflt)
          Return an int property.
 java.lang.String get(java.lang.String name, java.lang.String dflt)
          Return a string property.
 java.lang.String getAlgorithmText()
           
 java.lang.String getColsNamesForValsByRound()
           
 java.lang.String getColsValuesForValsByRound(int roundNum)
           
 int getRoundNumber()
           
 int newRound()
          Increment the round number, for config values that are extracted by round number.
 void set(java.lang.String name, java.lang.String value)
          Set a property.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Config

public Config(java.io.Reader algReader)
       throws java.io.IOException
Read both algorithm and config properties.

Parameters:
algReader - from where to read algorithm and config properties.
Throws:
java.io.IOException

Config

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

Parameters:
props - - configuration properties.
Throws:
java.io.IOException
Method Detail

get

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

Parameters:
name - name of property.
dflt - default value.
Returns:
a string property.

set

public void set(java.lang.String name,
                java.lang.String value)
         throws java.lang.Exception
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:
java.lang.Exception

get

public int get(java.lang.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(java.lang.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.

newRound

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

Returns:
the new round number.

getColsNamesForValsByRound

public java.lang.String getColsNamesForValsByRound()
Returns:
names of params set by round, for reports title

getColsValuesForValsByRound

public java.lang.String getColsValuesForValsByRound(int roundNum)
Returns:
values of params set by round, for reports lines.

getRoundNumber

public int getRoundNumber()
Returns:
the round number.

getAlgorithmText

public java.lang.String getAlgorithmText()
Returns:
Returns the algorithmText.


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