Class LuceneBatchedWorkProcessor

java.lang.Object
org.hibernate.search.backend.lucene.orchestration.impl.LuceneBatchedWorkProcessor
All Implemented Interfaces:
BatchedWorkProcessor

public class LuceneBatchedWorkProcessor extends Object implements BatchedWorkProcessor
A thread-safe component responsible for applying write works to an index writer.

Ported from Search 5's LuceneBackendQueueTask, in particular.

  • Constructor Details

  • Method Details

    • beginBatch

      public void beginBatch()
      Description copied from interface: BatchedWorkProcessor
      Initializes internal state before works are submitted.
      Specified by:
      beginBatch in interface BatchedWorkProcessor
    • endBatch

      public CompletableFuture<?> endBatch()
      Description copied from interface: BatchedWorkProcessor
      Ensures all works submitted since the last call to BatchedWorkProcessor.beginBatch() will actually be executed, along with any finishing task (commit, ...).
      Specified by:
      endBatch in interface BatchedWorkProcessor
      Returns:
      A future completing when the executor is allowed to start another batch.
    • complete

      public void complete()
      Description copied from interface: BatchedWorkProcessor
      Executes any outstanding operation, or schedule their execution.

      Called when the executor considers the work queue complete and does not plan on submitting another batch due to work starvation.

      Specified by:
      complete in interface BatchedWorkProcessor
    • submit

      public <T> T submit(IndexingWork<T> work)
    • forceCommit

      public void forceCommit()
    • forceRefresh

      public void forceRefresh()