Class AbstractWorkOrchestrator<W>
java.lang.Object
org.hibernate.search.engine.backend.orchestration.spi.AbstractWorkOrchestrator<W>
- Type Parameters:
W
- The type of batched works.
An abstract base for orchestrator implementations,
implementing a thread-safe shutdown.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract CompletableFuture<?>
protected abstract void
doStart
(ConfigurationPropertySource propertySource) protected abstract void
doStop()
protected abstract void
doSubmit
(W work, OperationSubmitter operationSubmitter) protected final String
name()
final CompletableFuture<?>
preStop()
Stop accepting works and return a future that completes when all works have been completely executed.final void
start
(ConfigurationPropertySource propertySource) Start any resource necessary to operate the orchestrator at runtime.final void
stop()
Forcibly shut down ongoing work and release any resource necessary to operate the orchestrator at runtime.final void
submit
(W work, OperationSubmitter operationSubmitter)
-
Field Details
-
blockingRetryProducer
-
-
Constructor Details
-
AbstractWorkOrchestrator
-
-
Method Details
-
name
-
start
Start any resource necessary to operate the orchestrator at runtime.Called by the owner of this orchestrator once after bootstrap, before any other method is called.
- Parameters:
propertySource
- The property source to extract configuration from.
-
preStop
Stop accepting works and return a future that completes when all works have been completely executed.Optionally called by the owner of this orchestrator before
stop()
, if it needs to wait for work completion.- Returns:
- A future that completes when all ongoing works have been completely executed.
-
stop
public final void stop()Forcibly shut down ongoing work and release any resource necessary to operate the orchestrator at runtime.Called by the owner of this orchestrator on shutdown.
-
doStart
-
doSubmit
protected abstract void doSubmit(W work, OperationSubmitter operationSubmitter) throws InterruptedException - Throws:
InterruptedException
-
completion
-
doStop
protected abstract void doStop() -
submit
-