Class ElasticsearchBatchingWorkOrchestrator
java.lang.Object
org.hibernate.search.engine.backend.orchestration.spi.AbstractWorkOrchestrator<W>
org.hibernate.search.backend.elasticsearch.orchestration.impl.ElasticsearchBatchingWorkOrchestrator
- All Implemented Interfaces:
ElasticsearchSerialWorkOrchestrator
public class ElasticsearchBatchingWorkOrchestrator
extends AbstractWorkOrchestrator<W>
implements ElasticsearchSerialWorkOrchestrator
An orchestrator sending works to a queue which is processed periodically
in a separate thread.
Works are processed in the order they are submitted.
Processing works in a single thread means more works can be processed at a time, which is a good thing when using bulk works.
-
Field Summary
FieldsFields inherited from class org.hibernate.search.engine.backend.orchestration.spi.AbstractWorkOrchestrator
blockingRetryProducer -
Constructor Summary
ConstructorsConstructorDescriptionElasticsearchBatchingWorkOrchestrator(String name, BackendThreads threads, ElasticsearchLink link, FailureHandler failureHandler) -
Method Summary
Modifier and TypeMethodDescriptionprotected CompletableFuture<?>protected final ElasticsearchWorkExecutionContextprotected voiddoStart(ConfigurationPropertySource propertySource) protected voiddoStop()protected voiddoSubmit(org.hibernate.search.backend.elasticsearch.orchestration.impl.ElasticsearchBatchedWork<?> work, OperationSubmitter operationSubmitter) <T> CompletableFuture<T>submit(IndexingWork<T> work, OperationSubmitter operationSubmitter) Methods inherited from class org.hibernate.search.engine.backend.orchestration.spi.AbstractWorkOrchestrator
name, preStop, start, stop, submitMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.hibernate.search.backend.elasticsearch.orchestration.impl.ElasticsearchSerialWorkOrchestrator
submit, submit
-
Field Details
-
link
-
-
Constructor Details
-
ElasticsearchBatchingWorkOrchestrator
public ElasticsearchBatchingWorkOrchestrator(String name, BackendThreads threads, ElasticsearchLink link, FailureHandler failureHandler) - Parameters:
name- The name of the orchestrator thread (and of this orchestrator when reporting errors)threads- The threads for this backend.link- The Elasticsearch link for this backend.failureHandler- A failure handler to report failures of the background thread.
-
-
Method Details
-
submit
- Specified by:
submitin interfaceElasticsearchSerialWorkOrchestrator
-
doStart
- Specified by:
doStartin classAbstractWorkOrchestrator<org.hibernate.search.backend.elasticsearch.orchestration.impl.ElasticsearchBatchedWork<?>>
-
doSubmit
protected void doSubmit(org.hibernate.search.backend.elasticsearch.orchestration.impl.ElasticsearchBatchedWork<?> work, OperationSubmitter operationSubmitter) throws InterruptedException - Specified by:
doSubmitin classAbstractWorkOrchestrator<org.hibernate.search.backend.elasticsearch.orchestration.impl.ElasticsearchBatchedWork<?>>- Throws:
InterruptedException
-
completion
- Specified by:
completionin classAbstractWorkOrchestrator<org.hibernate.search.backend.elasticsearch.orchestration.impl.ElasticsearchBatchedWork<?>>
-
doStop
protected void doStop()- Specified by:
doStopin classAbstractWorkOrchestrator<org.hibernate.search.backend.elasticsearch.orchestration.impl.ElasticsearchBatchedWork<?>>
-
createWorkExecutionContext
-