Interface CoordinationStrategy

public interface CoordinationStrategy
The 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.

See Also:
  • Method Details

    • configure

      void configure(CoordinationConfigurationContext context)
      Configures coordination.

      Called once during bootstrap, before anything (mapper, backends, index managers) is started.

      context - The configuration context.
    • start

      Configures this strategy and starts processing events in the background.

      Called once during bootstrap, after configure(CoordinationConfigurationContext).

      context - The start context.
      A future that completes when the strategy is completely started.
    • createMassIndexerAgent

      Creates a PojoMassIndexerAgent, able to exert control over other agents that could perform indexing concurrently (e.g. background processing of entity change events with outbox-polling coordination strategy).
      context - A context with information about the mass indexing that is about to start.
      An agent.
    • completion

      CompletableFuture<?> completion()
      A future that completes when all works submitted to background executors so far are completely executed. Works submitted to the executors after entering this method may delay the wait.
    • preStop

      Prepares for stop(), executing any operations that need to be executed before shutdown.

      Called once on shutdown, before backends and index managers are stopped.

      context - The pre-stop context.
      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.