org.apache.lucene.benchmark.byTask

## Class PerfRunData

- java.lang.Object
- - org.apache.lucene.benchmark.byTask.PerfRunData

- All Implemented Interfaces:
    Closeable, AutoCloseable

      public class PerfRunData
      extends Object
      implements Closeable

  Data maintained by a performance test run.

  Data includes:

  - Configuration.
  - Directory, Writer, Reader.
  - Taxonomy Directory, Writer, Reader.
  - DocMaker, FacetSource and a few instances of QueryMaker.
  - Named AnalysisFactories.
  - Analyzer.
  - Statistics data which updated during the run.
  Config properties:
  - work.dir=<path to root of docs and index dirs| Default: work>
  - analyzer=<class name for analyzer| Default: StandardAnalyzer>
  - doc.maker=<class name for doc-maker| Default: DocMaker>
  - facet.source=<class name for facet-source| Default: RandomFacetSource>
  - query.maker=<class name for query-maker| Default: SimpleQueryMaker>
  - log.queries=<whether queries should be printed| Default: false>
  - directory=<type of directory to use for the index| Default: RAMDirectory>
  - taxonomy.directory=<type of directory for taxonomy index| Default: RAMDirectory>

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `PerfRunData(Config config)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()`
    `Analyzer` | `getAnalyzer()`
    `Map<String,AnalyzerFactory>` | `getAnalyzerFactories()`
    `Config` | `getConfig()`
    `ContentSource` | `getContentSource()` Returns the ContentSource.
    `Directory` | `getDirectory()`
    `DocMaker` | `getDocMaker()` Returns the DocMaker.
    `FacetSource` | `getFacetSource()` Returns the facet source.
    `DirectoryReader` | `getIndexReader()`
    `IndexSearcher` | `getIndexSearcher()`
    `IndexWriter` | `getIndexWriter()`
    `Locale` | `getLocale()`
    `Object` | `getPerfObject(String key)` Returns an object that was previously set by `setPerfObject(String, Object)`.
    `Points` | `getPoints()`
    `QueryMaker` | `getQueryMaker(ReadTask readTask)`
    `long` | `getStartTimeMillis()`
    `Directory` | `getTaxonomyDir()`
    `TaxonomyReader` | `getTaxonomyReader()`
    `TaxonomyWriter` | `getTaxonomyWriter()`
    `void` | `reinit(boolean eraseIndex)`
    `void` | `resetInputs()`
    `void` | `setAnalyzer(Analyzer analyzer)`
    `void` | `setDirectory(Directory directory)`
    `void` | `setIndexReader(DirectoryReader indexReader)` Set the index reader.
    `void` | `setIndexWriter(IndexWriter indexWriter)`
    `void` | `setLocale(Locale locale)`
    `void` | `setPerfObject(String key, Object obj)` Sets an object that is required by `PerfTask`s, keyed by the given `key`.
    `long` | `setStartTimeMillis()`
    `void` | `setTaxonomyReader(TaxonomyReader taxoReader)` Set the taxonomy reader.
    `void` | `setTaxonomyWriter(TaxonomyWriter taxoWriter)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### PerfRunData

          public PerfRunData(Config config)
                      throws Exception

      Throws:
        `Exception`

  - ### Method Detail

    - #### close

          public void close()
                     throws IOException

      Specified by:
        `close` in interface `Closeable`
      Specified by:
        `close` in interface `AutoCloseable`
      Throws:
        `IOException`

    - #### reinit

          public void reinit(boolean eraseIndex)
                      throws Exception

      Throws:
        `Exception`

    - #### getPerfObject

          public Object getPerfObject(String key)

      Returns an object that was previously set by `setPerfObject(String, Object)`.

    - #### setPerfObject

          public void setPerfObject(String key,
                                    Object obj)

      Sets an object that is required by `PerfTask`s, keyed by the given `key`. If the object implements `Closeable`, it will be closed by `close()`.

    - #### setStartTimeMillis

          public long setStartTimeMillis()

    - #### getStartTimeMillis

          public long getStartTimeMillis()

      Returns:
        Start time in milliseconds

    - #### getPoints

          public Points getPoints()

      Returns:
        Returns the points.

    - #### getDirectory

          public Directory getDirectory()

      Returns:
        Returns the directory.

    - #### setDirectory

          public void setDirectory(Directory directory)

      Parameters:
        `directory` - The directory to set.

    - #### getTaxonomyDir

          public Directory getTaxonomyDir()

      Returns:
        Returns the taxonomy directory

    - #### setTaxonomyReader

          public void setTaxonomyReader(TaxonomyReader taxoReader)
                                 throws IOException

      Set the taxonomy reader. Takes ownership of that taxonomy reader, that is, internally performs taxoReader.incRef() (If caller no longer needs that reader it should decRef()/close() it after calling this method, otherwise, the reader will remain open).
      Parameters:
        `taxoReader` - The taxonomy reader to set.
      Throws:
        `IOException`

    - #### getTaxonomyReader

          public TaxonomyReader getTaxonomyReader()

      Returns:
        Returns the taxonomyReader. NOTE: this returns a reference. You must call TaxonomyReader.decRef() when you're done.

    - #### setTaxonomyWriter

          public void setTaxonomyWriter(TaxonomyWriter taxoWriter)

      Parameters:
        `taxoWriter` - The taxonomy writer to set.

    - #### getTaxonomyWriter

          public TaxonomyWriter getTaxonomyWriter()

    - #### getIndexReader

          public DirectoryReader getIndexReader()

      Returns:
        Returns the indexReader. NOTE: this returns a reference. You must call IndexReader.decRef() when you're done.

    - #### getIndexSearcher

          public IndexSearcher getIndexSearcher()

      Returns:
        Returns the indexSearcher. NOTE: this returns a reference to the underlying IndexReader. You must call IndexReader.decRef() when you're done.

    - #### setIndexReader

          public void setIndexReader(DirectoryReader indexReader)
                              throws IOException

      Set the index reader. Takes ownership of that index reader, that is, internally performs indexReader.incRef() (If caller no longer needs that reader it should decRef()/close() it after calling this method, otherwise, the reader will remain open).
      Parameters:
        `indexReader` - The indexReader to set.
      Throws:
        `IOException`

    - #### getIndexWriter

          public IndexWriter getIndexWriter()

      Returns:
        Returns the indexWriter.

    - #### setIndexWriter

          public void setIndexWriter(IndexWriter indexWriter)

      Parameters:
        `indexWriter` - The indexWriter to set.

    - #### getAnalyzer

          public Analyzer getAnalyzer()

      Returns:
        Returns the analyzer.

    - #### setAnalyzer

          public void setAnalyzer(Analyzer analyzer)

    - #### getContentSource

          public ContentSource getContentSource()

      Returns the ContentSource.

    - #### getDocMaker

          public DocMaker getDocMaker()

      Returns the DocMaker.

    - #### getFacetSource

          public FacetSource getFacetSource()

      Returns the facet source.

    - #### getLocale

          public Locale getLocale()

      Returns:
        the locale

    - #### setLocale

          public void setLocale(Locale locale)

      Parameters:
        `locale` - the locale to set

    - #### getConfig

          public Config getConfig()

      Returns:
        Returns the config.

    - #### resetInputs

          public void resetInputs()
                           throws IOException

      Throws:
        `IOException`

    - #### getQueryMaker

          public QueryMaker getQueryMaker(ReadTask readTask)

      Returns:
        Returns the queryMaker by read task type (class)

    - #### getAnalyzerFactories

          public Map<String,AnalyzerFactory> getAnalyzerFactories()

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