Class LuceneBatchedWorkProcessor
java.lang.Object
org.hibernate.search.backend.lucene.orchestration.impl.LuceneBatchedWorkProcessor
- All Implemented Interfaces:
BatchedWorkProcessor
A thread-safe component responsible for applying write works to an index writer.
Ported from Search 5's LuceneBackendQueueTask, in particular.
-
Constructor Summary
ConstructorsConstructorDescriptionLuceneBatchedWorkProcessor(EventContext eventContext, IndexAccessor indexAccessor) -
Method Summary
Modifier and TypeMethodDescriptionvoidInitializes internal state before works are submitted.voidcomplete()Executes any outstanding operation, or schedule their execution.endBatch()Ensures all works submitted since the last call toBatchedWorkProcessor.beginBatch()will actually be executed, along with any finishing task (commit, ...).voidvoid<T> Tsubmit(IndexingWork<T> work)
-
Constructor Details
-
LuceneBatchedWorkProcessor
-
-
Method Details
-
beginBatch
public void beginBatch()Description copied from interface:BatchedWorkProcessorInitializes internal state before works are submitted.- Specified by:
beginBatchin interfaceBatchedWorkProcessor
-
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
-
forceCommit
public void forceCommit() -
forceRefresh
public void forceRefresh()
-