Class JoinTaskExecutor

java.lang.Object
org.elasticsearch.cluster.coordination.JoinTaskExecutor
All Implemented Interfaces:
ClusterStateTaskExecutor<JoinTaskExecutor.Task>

public class JoinTaskExecutor
extends java.lang.Object
implements ClusterStateTaskExecutor<JoinTaskExecutor.Task>
  • Constructor Details

  • Method Details

    • execute

      public ClusterStateTaskExecutor.ClusterTasksResult<JoinTaskExecutor.Task> execute​(ClusterState currentState, java.util.List<JoinTaskExecutor.Task> joiningNodes) throws java.lang.Exception
      Description copied from interface: ClusterStateTaskExecutor
      Update the cluster state based on the current state and the given tasks. Return the *same instance* if no state should be changed.
      Specified by:
      execute in interface ClusterStateTaskExecutor<JoinTaskExecutor.Task>
      Throws:
      java.lang.Exception
    • becomeMasterAndTrimConflictingNodes

      protected ClusterState.Builder becomeMasterAndTrimConflictingNodes​(ClusterState currentState, java.util.List<JoinTaskExecutor.Task> joiningNodes)
    • runOnlyOnMaster

      public boolean runOnlyOnMaster()
      Description copied from interface: ClusterStateTaskExecutor
      indicates whether this executor should only run if the current node is master
      Specified by:
      runOnlyOnMaster in interface ClusterStateTaskExecutor<JoinTaskExecutor.Task>
    • newBecomeMasterTask

      public static JoinTaskExecutor.Task newBecomeMasterTask()
    • newFinishElectionTask

      public static JoinTaskExecutor.Task newFinishElectionTask()
      a task that is used to signal the election is stopped and we should process pending joins. it may be used in combination with newBecomeMasterTask()
    • ensureIndexCompatibility

      public static void ensureIndexCompatibility​(Version nodeVersion, Metadata metadata)
      Ensures that all indices are compatible with the given node version. This will ensure that all indices in the given metadata will not be created with a newer version of elasticsearch as well as that all indices are newer or equal to the minimum index compatibility version.
      Throws:
      java.lang.IllegalStateException - if any index is incompatible with the given version
      See Also:
      Version.minimumIndexCompatibilityVersion()
    • ensureNodesCompatibility

      public static void ensureNodesCompatibility​(Version joiningNodeVersion, DiscoveryNodes currentNodes)
      ensures that the joining node has a version that's compatible with all current nodes
    • ensureNodesCompatibility

      public static void ensureNodesCompatibility​(Version joiningNodeVersion, Version minClusterNodeVersion, Version maxClusterNodeVersion)
      ensures that the joining node has a version that's compatible with a given version range
    • ensureMajorVersionBarrier

      public static void ensureMajorVersionBarrier​(Version joiningNodeVersion, Version minClusterNodeVersion)
      ensures that the joining node's major version is equal or higher to the minClusterNodeVersion. This is needed to ensure that if the master is already fully operating under the new major version, it doesn't go back to mixed version mode
    • addBuiltInJoinValidators

      public static java.util.Collection<java.util.function.BiConsumer<DiscoveryNode,​ClusterState>> addBuiltInJoinValidators​(java.util.Collection<java.util.function.BiConsumer<DiscoveryNode,​ClusterState>> onJoinValidators)