NoMergeScheduler (Lucene 10.5.0 core API)
Description: declaration: package: org.apache.lucene.index, class: NoMergeScheduler

Package org.apache.lucene.index

# Class NoMergeScheduler

java.lang.Object
org.apache.lucene.index.MergeScheduler
org.apache.lucene.index.NoMergeScheduler

All Implemented Interfaces:
  `Closeable`, `AutoCloseable`

public final class NoMergeScheduler extends MergeScheduler
A `MergeScheduler` which never executes any merges. It is also a singleton and can be accessed through `INSTANCE`. Use it if you want to prevent an `IndexWriter` from ever executing merges, regardless of the `MergePolicy` used. Note that you can achieve the same thing by using `NoMergePolicy`, however with `NoMergeScheduler` you also ensure that no unnecessary code of any `MergeScheduler` implementation is ever executed. Hence it is recommended to use both if you want to disable merges from ever happening.

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from class org.apache.lucene.index.MergeScheduler

  `MergeScheduler.MergeSource`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final MergeScheduler`
  `INSTANCE`
  The single instance of `NoMergeScheduler`

  ### Fields inherited from class org.apache.lucene.index.MergeScheduler

  `infoStream`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `MergeScheduler`
  `clone()`
  `void`
  `close()`
  Close this MergeScheduler.
  `Executor`
  `getIntraMergeExecutor(MergePolicy.OneMerge merge)`
  Provides an executor for parallelism during a single merge operation.
  `void`
  `merge(MergeScheduler.MergeSource mergeSource, MergeTrigger trigger)`
  Run the merges provided by `MergeScheduler.MergeSource.getNextMerge()`.
  `Directory`
  `wrapForMerge(MergePolicy.OneMerge merge, Directory in)`
  Wraps the incoming `Directory` so that we can merge-throttle it using `RateLimitedIndexOutput`.

  ### Methods inherited from class org.apache.lucene.index.MergeScheduler

  `message, verbose`

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

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

- ## Field Details

  - ### INSTANCE

    public static final MergeScheduler INSTANCE
    The single instance of `NoMergeScheduler`

- ## Method Details

  - ### close

    public void close()
    Description copied from class: `MergeScheduler`
    Close this MergeScheduler.
    Specified by:
      `close` in interface `AutoCloseable`
    Specified by:
      `close` in interface `Closeable`
    Overrides:
      `close` in class `MergeScheduler`

  - ### merge

    public void merge(MergeScheduler.MergeSource mergeSource, MergeTrigger trigger)
    Description copied from class: `MergeScheduler`
    Run the merges provided by `MergeScheduler.MergeSource.getNextMerge()`.
    Specified by:
      `merge` in class `MergeScheduler`
    Parameters:
      `mergeSource` - the `IndexWriter` to obtain the merges from.
      `trigger` - the `MergeTrigger` that caused this merge to happen

  - ### wrapForMerge

    public Directory wrapForMerge(MergePolicy.OneMerge merge, Directory in)
    Description copied from class: `MergeScheduler`
    Wraps the incoming `Directory` so that we can merge-throttle it using `RateLimitedIndexOutput`.
    Overrides:
      `wrapForMerge` in class `MergeScheduler`

  - ### clone

    public MergeScheduler clone()
    Overrides:
      `clone` in class `Object`

  - ### getIntraMergeExecutor

    public Executor getIntraMergeExecutor(MergePolicy.OneMerge merge)
    Description copied from class: `MergeScheduler`
    Provides an executor for parallelism during a single merge operation. By default, the method returns a `SameThreadExecutorService` where all intra-merge actions occur in their calling thread.
    Overrides:
      `getIntraMergeExecutor` in class `MergeScheduler`