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

Package org.apache.lucene.index

# Interface MergeScheduler.MergeSource

Enclosing class:
  `MergeScheduler`

public static interface MergeScheduler.MergeSource
Provides access to new merges and executes the actual merge

WARNING: This API is experimental and might change in incompatible ways in the next release.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `MergePolicy.OneMerge`
  `getNextMerge()`
  The `MergeScheduler` calls this method to retrieve the next merge requested by the MergePolicy
  `boolean`
  `hasPendingMerges()`
  Expert: returns true if there are merges waiting to be scheduled.
  `void`
  `merge(MergePolicy.OneMerge merge)`
  Merges the indicated segments, replacing them in the stack with a single segment.
  `void`
  `onMergeFinished(MergePolicy.OneMerge merge)`
  Does finishing for a merge.

- ## Method Details

  - ### getNextMerge

    MergePolicy.OneMerge getNextMerge()
    The `MergeScheduler` calls this method to retrieve the next merge requested by the MergePolicy

  - ### onMergeFinished

    void onMergeFinished(MergePolicy.OneMerge merge)
    Does finishing for a merge.

  - ### hasPendingMerges

    boolean hasPendingMerges()
    Expert: returns true if there are merges waiting to be scheduled.

  - ### merge

    void merge(MergePolicy.OneMerge merge) throws IOException
    Merges the indicated segments, replacing them in the stack with a single segment.
    Throws:
      `IOException`