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
Fields Modifier and Type Field Description protected ElasticsearchLinklink-
Fields inherited from class org.hibernate.search.engine.backend.orchestration.spi.AbstractWorkOrchestrator
blockingRetryProducer
-
-
Constructor Summary
Constructors Constructor Description ElasticsearchBatchingWorkOrchestrator(String name, BackendThreads threads, ElasticsearchLink link, FailureHandler failureHandler)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected CompletableFuture<?>completion()protected ElasticsearchWorkExecutionContextcreateWorkExecutionContext()protected 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, submit
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.hibernate.search.backend.elasticsearch.orchestration.impl.ElasticsearchSerialWorkOrchestrator
submit, submit
-
-
-
-
Field Detail
-
link
protected final ElasticsearchLink link
-
-
Constructor Detail
-
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 Detail
-
submit
public <T> CompletableFuture<T> submit(IndexingWork<T> work, OperationSubmitter operationSubmitter)
- Specified by:
submitin interfaceElasticsearchSerialWorkOrchestrator
-
doStart
protected void doStart(ConfigurationPropertySource propertySource)
- 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
protected CompletableFuture<?> 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
protected final ElasticsearchWorkExecutionContext createWorkExecutionContext()
-
-