org.apache.lucene.benchmark.byTask.tasks

## Class NewAnalyzerTask

- java.lang.Object
- - org.apache.lucene.benchmark.byTask.tasks.PerfTask
  - - org.apache.lucene.benchmark.byTask.tasks.NewAnalyzerTask

- All Implemented Interfaces:
    Cloneable

      public class NewAnalyzerTask
      extends PerfTask

  Create a new `Analyzer` and set it in the getRunData() for use by all future tasks.

- - ### Field Summary

    - ### Fields inherited from class org.apache.lucene.benchmark.byTask.tasks.PerfTask

      `logStep, NEW_LINE, params, stopNow`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `NewAnalyzerTask(PerfRunData runData)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static Analyzer` | `createAnalyzer(String className)`
    `int` | `doLogic()` Perform the task once (ignoring repetitions specification) Return number of work items done by this task.
    `void` | `setParams(String params)` Set the params (analyzerName only), Comma-separate list of Analyzer class names.
    `boolean` | `supportsParams()` Sub classes that support parameters must override this method to return true.

    - ### Methods inherited from class org.apache.lucene.benchmark.byTask.tasks.PerfTask

      `clone, close, getAlgLineNum, getBackgroundDeltaPriority, getDepth, getLogMessage, getName, getParams, getRunData, getRunInBackground, isDisableCounting, runAndMaybeStats, setAlgLineNum, setDepth, setDisableCounting, setName, setRunInBackground, setup, shouldNeverLogAtStart, shouldNotRecordStats, stopNow, tearDown, toString`

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

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

- - ### Constructor Detail

    - #### NewAnalyzerTask

          public NewAnalyzerTask(PerfRunData runData)

  - ### Method Detail

    - #### createAnalyzer

          public static final Analyzer createAnalyzer(String className)
                                               throws Exception

      Throws:
        `Exception`

    - #### doLogic

          public int doLogic()
                      throws IOException

      Description copied from class: `PerfTask`
      Perform the task once (ignoring repetitions specification) Return number of work items done by this task. For indexing that can be number of docs added. For warming that can be number of scanned items, etc.
      Specified by:
        `doLogic` in class `PerfTask`
      Returns:
        number of work items done by this task.
      Throws:
        `IOException`

    - #### setParams

          public void setParams(String params)

      Set the params (analyzerName only), Comma-separate list of Analyzer class names. If the Analyzer lives in org.apache.lucene.analysis, the name can be shortened by dropping the o.a.l.a part of the Fully Qualified Class Name.

      Analyzer names may also refer to previously defined AnalyzerFactory's.

      Example Declaration: {"NewAnalyzer" NewAnalyzer(WhitespaceAnalyzer, SimpleAnalyzer, StopAnalyzer, standard.StandardAnalyzer) >

      Example AnalyzerFactory usage:

           -AnalyzerFactory(name:'whitespace tokenized',WhitespaceTokenizer)
           -NewAnalyzer('whitespace tokenized')

      Overrides:
        `setParams` in class `PerfTask`
      Parameters:
        `params` - analyzerClassName, or empty for the StandardAnalyzer

    - #### supportsParams

          public boolean supportsParams()

      Description copied from class: `PerfTask`
      Sub classes that support parameters must override this method to return true.
      Overrides:
        `supportsParams` in class `PerfTask`
      Returns:
        true iff this task supports command line params.

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