org.apache.lucene.benchmark.byTask.utils

## Class Config

- java.lang.Object
- - org.apache.lucene.benchmark.byTask.utils.Config

-     public class Config
      extends java.lang.Object

  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

    Constructors
    Constructor and Description
    `Config(java.util.Properties props)` Create config without algorithm - useful for a programmatic perf test.
    `Config(java.io.Reader algReader)` Read both algorithm and config properties.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `get(java.lang.String name, boolean dflt)` Return a boolean property.
    `double` | `get(java.lang.String name, double dflt)` Return a double 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 - useful 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 property value (multiple 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 double get(java.lang.String name,
                            double dflt)

      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 property
        `dflt` - default value
      Returns:
        a double 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 booleans. 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-2016 Apache Software Foundation. All Rights Reserved.