org.apache.lucene.benchmark.byTask.tasks

## Class WriteLineDocTask

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

- All Implemented Interfaces:
    java.lang.Cloneable

      public class WriteLineDocTask
      extends PerfTask

  A task which writes documents, one line per document. Each line is in the following format: title <TAB> date <TAB> body. The output of this task can be consumed by `LineDocMaker` and is intended to save the IO overhead of opening a file per document to be indexed.
  Supports the following parameters:
  - line.file.out - the name of the file to write the output to. That parameter is mandatory. NOTE: the file is re-created.
  - bzip.compression - whether the output should be bzip-compressed. This is recommended when the output file is expected to be large. (optional, default: false).
  NOTE: this class is not thread-safe and if used by multiple threads the output is unspecified (as all will write to the same output file in a non-synchronized way).

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static char` | `SEP`

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

      `logStep, NEW_LINE, params`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `WriteLineDocTask(PerfRunData runData)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()`
    `int` | `doLogic()` Perform the task once (ignoring repetitions specification) Return number of work items done by this task.
    `protected java.lang.String` | `getLogMessage(int recsCount)`
    `void` | `setParams(java.lang.String params)` Set the params (docSize only)
    `boolean` | `supportsParams()` Sub classes that supports parameters must override this method to return true.

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

      `clone, getDepth, getName, getParams, getRunData, isDisableCounting, runAndMaybeStats, setDepth, setDisableCounting, setName, setup, shouldNeverLogAtStart, shouldNotRecordStats, tearDown, toString`

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

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

- - ### Field Detail

    - #### SEP

          public static final char SEP

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### WriteLineDocTask

          public WriteLineDocTask(PerfRunData runData)
                           throws java.lang.Exception

      Throws:
        `java.lang.Exception`

  - ### Method Detail

    - #### getLogMessage

          protected java.lang.String getLogMessage(int recsCount)

      Overrides:
        `getLogMessage` in class `PerfTask`

    - #### doLogic

          public int doLogic()
                      throws java.lang.Exception

      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:
        `java.lang.Exception`

    - #### close

          public void close()
                     throws java.lang.Exception

      Overrides:
        `close` in class `PerfTask`
      Throws:
        `java.lang.Exception`

    - #### setParams

          public void setParams(java.lang.String params)

      Set the params (docSize only)
      Overrides:
        `setParams` in class `PerfTask`
      Parameters:
        `params` - docSize, or 0 for no limit.

    - #### supportsParams

          public boolean supportsParams()

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

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