Interface CooordinationStrategy
-
public interface CooordinationStrategyThe strategy for coordinating between threads of a single-node application, or between nodes of a distributed application.Advanced implementations may involve an external system to store and asynchronously consume indexing events, ultimately routing them back to Hibernate Search's in-JVM indexing plans.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidconfigureAutomaticIndexing(AutomaticIndexingConfigurationContext context)Configures automatic indexing.CompletableFuture<?>preStop(CoordinationStrategyPreStopContext context)Prepares forstop(), executing any operations that need to be executed before shutdown.CompletableFuture<?>start(CoordinationStrategyStartContext context)Configures this strategy and starts processing events in the background.voidstop()Stops and releases all resources.
-
-
-
Method Detail
-
configureAutomaticIndexing
void configureAutomaticIndexing(AutomaticIndexingConfigurationContext context)
Configures automatic indexing.Called once during bootstrap, after backends and index managers were started.
- Parameters:
context- The configuration context.
-
start
CompletableFuture<?> start(CoordinationStrategyStartContext context)
Configures this strategy and starts processing events in the background.Called once during bootstrap, after
configureAutomaticIndexing(AutomaticIndexingConfigurationContext).- Parameters:
context- The start context.- Returns:
- A future that completes when the strategy is completely started.
-
preStop
CompletableFuture<?> preStop(CoordinationStrategyPreStopContext context)
Prepares forstop(), executing any operations that need to be executed before shutdown.Called once on shutdown, before backends and index managers are stopped.
- Parameters:
context- The pre-stop context.- Returns:
- A future that completes when pre-stop operations complete.
-
stop
void stop()
Stops and releases all resources.Called once on shutdown, after the future returned by
preStop(CoordinationStrategyPreStopContext)completed.
-
-