Class JoinTaskExecutor
java.lang.Object
org.elasticsearch.cluster.coordination.JoinTaskExecutor
- All Implemented Interfaces:
ClusterStateTaskExecutor<JoinTaskExecutor.Task>
public class JoinTaskExecutor
extends Object
implements ClusterStateTaskExecutor<JoinTaskExecutor.Task>
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.cluster.ClusterStateTaskExecutor
ClusterStateTaskExecutor.ClusterTasksResult<T>, ClusterStateTaskExecutor.TaskResult
-
Constructor Summary
ConstructorDescriptionJoinTaskExecutor(Settings settings, AllocationService allocationService, org.apache.logging.log4j.Logger logger, RerouteService rerouteService)
-
Method Summary
Modifier and TypeMethodDescriptionstatic Collection<BiConsumer<DiscoveryNode,ClusterState>>
addBuiltInJoinValidators(Collection<BiConsumer<DiscoveryNode,ClusterState>> onJoinValidators)
protected ClusterState.Builder
becomeMasterAndTrimConflictingNodes(ClusterState currentState, List<JoinTaskExecutor.Task> joiningNodes)
static void
ensureIndexCompatibility(Version nodeVersion, Metadata metadata)
Ensures that all indices are compatible with the given node version.static void
ensureNodesCompatibility(Version joiningNodeVersion, DiscoveryNodes currentNodes)
ensures that the joining node has a version that's compatible with all current nodesstatic void
ensureNodesCompatibility(Version joiningNodeVersion, Version minClusterNodeVersion, Version maxClusterNodeVersion)
ensures that the joining node has a version that's compatible with a given version rangestatic void
ensureVersionBarrier(Version joiningNodeVersion, Version minClusterNodeVersion)
ensures that the joining node's version is equal or higher to the minClusterNodeVersion.execute(ClusterState currentState, List<JoinTaskExecutor.Task> joiningNodes)
Update the cluster state based on the current state and the given tasks.static JoinTaskExecutor.Task
static JoinTaskExecutor.Task
a task that is used to signal the election is stopped and we should process pending joins.boolean
indicates whether this executor should only run if the current node is masterMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.elasticsearch.cluster.ClusterStateTaskExecutor
clusterStatePublished, describeTasks
-
Constructor Details
-
JoinTaskExecutor
public JoinTaskExecutor(Settings settings, AllocationService allocationService, org.apache.logging.log4j.Logger logger, RerouteService rerouteService)
-
-
Method Details
-
execute
public ClusterStateTaskExecutor.ClusterTasksResult<JoinTaskExecutor.Task> execute(ClusterState currentState, List<JoinTaskExecutor.Task> joiningNodes) throws ExceptionDescription 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 interfaceClusterStateTaskExecutor<JoinTaskExecutor.Task>
- Throws:
Exception
-
becomeMasterAndTrimConflictingNodes
protected ClusterState.Builder becomeMasterAndTrimConflictingNodes(ClusterState currentState, 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 interfaceClusterStateTaskExecutor<JoinTaskExecutor.Task>
-
newBecomeMasterTask
-
newFinishElectionTask
a task that is used to signal the election is stopped and we should process pending joins. it may be used in combination withnewBecomeMasterTask()
-
ensureIndexCompatibility
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:
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 -
ensureVersionBarrier
ensures that the joining node's version is equal or higher to the minClusterNodeVersion. This is needed to ensure that if the master is already fully operating under the new version, it doesn't go back to mixed version mode -
addBuiltInJoinValidators
public static Collection<BiConsumer<DiscoveryNode,ClusterState>> addBuiltInJoinValidators(Collection<BiConsumer<DiscoveryNode,ClusterState>> onJoinValidators)
-