Class PluginShutdownService

java.lang.Object
org.elasticsearch.shutdown.PluginShutdownService
All Implemented Interfaces:
ClusterStateListener

public class PluginShutdownService extends Object implements ClusterStateListener
The PluginShutdownService is used for the node shutdown infrastructure to signal to plugins that a shutdown is occurring, and to check whether it is safe to shut down.
  • Field Details

  • Constructor Details

  • Method Details

    • shutdownNodes

      public static Set<String> shutdownNodes(ClusterState clusterState)
      Return all nodes shutting down from the given cluster state
    • shutdownTypeNodes

      public static Set<String> shutdownTypeNodes(ClusterState clusterState, SingleNodeShutdownMetadata.Type... shutdownTypes)
      Return all nodes shutting down with the given shutdown types from the given cluster state
    • readyToShutdown

      public boolean readyToShutdown(String nodeId, SingleNodeShutdownMetadata.Type shutdownType)
      Check with registered plugins whether the shutdown is safe for the given node id and type
    • signalShutdown

      public void signalShutdown(ClusterState state)
      Signal to plugins the nodes that are currently shutting down
    • clusterChanged

      public void clusterChanged(ClusterChangedEvent event)
      Description copied from interface: ClusterStateListener
      Called when cluster state changes.

      Cluster states are applied one-by-one which means they can be a performance bottleneck. Implementations of this method should therefore be fast, so please consider forking work into the background rather than doing everything inline.

      Specified by:
      clusterChanged in interface ClusterStateListener