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 Summary
Constructors Constructor Description LuceneBatchedWorkProcessor(EventContext eventContext, IndexAccessor indexAccessor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbeginBatch()Initializes internal state before works are submitted.voidcomplete()Executes any outstanding operation, or schedule their execution.CompletableFuture<?>endBatch()Ensures all works submitted since the last call toBatchedWorkProcessor.beginBatch()will actually be executed, along with any finishing task (commit, ...).voidforceCommit()voidforceRefresh()<T> Tsubmit(IndexingWork<T> work)
-
-
-
Constructor Detail
-
LuceneBatchedWorkProcessor
public LuceneBatchedWorkProcessor(EventContext eventContext, IndexAccessor indexAccessor)
-
-
Method Detail
-
beginBatch
public void beginBatch()
Description copied from interface:BatchedWorkProcessorInitializes internal state before works are submitted.- Specified by:
beginBatchin interfaceBatchedWorkProcessor
-
endBatch
public CompletableFuture<?> endBatch()
Description copied from interface:BatchedWorkProcessorEnsures all works submitted since the last call toBatchedWorkProcessor.beginBatch()will actually be executed, along with any finishing task (commit, ...).- Specified by:
endBatchin interfaceBatchedWorkProcessor- Returns:
- A future completing when the executor is allowed to start another batch.
-
complete
public void complete()
Description copied from interface:BatchedWorkProcessorExecutes 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:
completein interfaceBatchedWorkProcessor
-
submit
public <T> T submit(IndexingWork<T> work)
-
forceCommit
public void forceCommit()
-
forceRefresh
public void forceRefresh()
-
-