Package org.apache.lucene.monitor

## Class MonitorConfiguration

- java.lang.Object
- - org.apache.lucene.monitor.MonitorConfiguration

-     public class MonitorConfiguration
      extends Object

  Encapsulates various configuration settings for a Monitor's query index

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `MonitorConfiguration()` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `IndexWriter` | `buildIndexWriter()` |
    `IOSupplier<Directory>` | `getDirectoryProvider()` |
    `protected IndexWriterConfig` | `getIndexWriterConfig()` |
    `long` | `getPurgeFrequency()` |
    `TimeUnit` | `getPurgeFrequencyUnits()` |
    `QueryDecomposer` | `getQueryDecomposer()` |
    `MonitorQuerySerializer` | `getQuerySerializer()` |
    `int` | `getQueryUpdateBufferSize()` |
    `boolean` | `isReadOnly()` |
    `MonitorConfiguration` | `setDirectoryProvider​(IOSupplier<Directory> directoryProvider, MonitorQuerySerializer serializer)` |
    `MonitorConfiguration` | `setDirectoryProvider​(IOSupplier<Directory> directoryProvider, MonitorQuerySerializer serializer, Boolean readOnly)` | Sets a custom directory, with a custom serializer.
    `MonitorConfiguration` | `setIndexPath​(Path indexPath, MonitorQuerySerializer serializer)` |
    `MonitorConfiguration` | `setPurgeFrequency​(long frequency, TimeUnit units)` | Set the frequency with with the Monitor's querycache will be garbage-collected
    `MonitorConfiguration` | `setQueryDecomposer​(QueryDecomposer queryDecomposer)` | Set the QueryDecomposer to be used by the Monitor
    `MonitorConfiguration` | `setQueryUpdateBufferSize​(int size)` | Set how many queries will be buffered in memory before being committed to the queryindex

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

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

- - ### Constructor Detail

    - #### MonitorConfiguration

          public MonitorConfiguration()

  - ### Method Detail

    - #### isReadOnly

          public boolean isReadOnly()

    - #### getDirectoryProvider

          public IOSupplier<Directory> getDirectoryProvider()

    - #### setDirectoryProvider

          public MonitorConfiguration setDirectoryProvider​(IOSupplier<Directory> directoryProvider,
                                                           MonitorQuerySerializer serializer,
                                                           Boolean readOnly)

      Sets a custom directory, with a custom serializer.

      You have also the chance to configure the Monitor as read-only.

      Parameters:
        `directoryProvider` - lambda to provide the index Directory implementation
        `serializer` - the serializer used to store the queries
        `readOnly` - set the monitor as read-only
      Returns:
        MonitorCOnfiguration

    - #### setDirectoryProvider

          public MonitorConfiguration setDirectoryProvider​(IOSupplier<Directory> directoryProvider,
                                                           MonitorQuerySerializer serializer)

    - #### setIndexPath

          public MonitorConfiguration setIndexPath​(Path indexPath,
                                                   MonitorQuerySerializer serializer)

    - #### buildIndexWriter

          public IndexWriter buildIndexWriter()
                                       throws IOException

      Throws:
        `IOException`

    - #### getIndexWriterConfig

          protected IndexWriterConfig getIndexWriterConfig()

    - #### getQuerySerializer

          public MonitorQuerySerializer getQuerySerializer()

    - #### setQueryDecomposer

          public MonitorConfiguration setQueryDecomposer​(QueryDecomposer queryDecomposer)

      Set the QueryDecomposer to be used by the Monitor
      Parameters:
        `queryDecomposer` - the QueryDecomposer to be used by the Monitor
      Returns:
        the current configuration

    - #### getQueryDecomposer

          public QueryDecomposer getQueryDecomposer()

      Returns:
        the QueryDecomposer used by the Monitor

    - #### setPurgeFrequency

          public MonitorConfiguration setPurgeFrequency​(long frequency,
                                                        TimeUnit units)

      Set the frequency with with the Monitor's querycache will be garbage-collected
      Parameters:
        `frequency` - the frequency value
        `units` - the frequency units
      Returns:
        the current configuration

    - #### getPurgeFrequency

          public long getPurgeFrequency()

      Returns:
        the value of Monitor's querycache garbage-collection frequency

    - #### getPurgeFrequencyUnits

          public TimeUnit getPurgeFrequencyUnits()

      Returns:
        Get the units of the Monitor's querycache garbage-collection frequency

    - #### setQueryUpdateBufferSize

          public MonitorConfiguration setQueryUpdateBufferSize​(int size)

      Set how many queries will be buffered in memory before being committed to the queryindex
      Parameters:
        `size` - how many queries will be buffered in memory before being committed to the queryindex
      Returns:
        the current configuration

    - #### getQueryUpdateBufferSize

          public int getQueryUpdateBufferSize()

      Returns:
        the size of the queryindex's in-memory buffer