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>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
JoinTaskExecutor.Task
-
Nested classes/interfaces inherited from interface org.elasticsearch.cluster.ClusterStateTaskExecutor
ClusterStateTaskExecutor.ClusterTasksResult<T>, ClusterStateTaskExecutor.TaskResult
-
-
Constructor Summary
Constructors Constructor Description JoinTaskExecutor(Settings settings, AllocationService allocationService, org.apache.logging.log4j.Logger logger)
-
Method Summary
Modifier and Type Method Description static java.util.Collection<java.util.function.BiConsumer<DiscoveryNode,ClusterState>>
addBuiltInJoinValidators(java.util.Collection<java.util.function.BiConsumer<DiscoveryNode,ClusterState>> onJoinValidators)
protected ClusterState.Builder
becomeMasterAndTrimConflictingNodes(ClusterState currentState, java.util.List<JoinTaskExecutor.Task> joiningNodes)
static void
ensureIndexCompatibility(Version nodeVersion, MetaData metaData)
Ensures that all indices are compatible with the given node version.static void
ensureMajorVersionBarrier(Version joiningNodeVersion, Version minClusterNodeVersion)
ensures that the joining node's major version is equal or higher to the minClusterNodeVersion.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 rangeClusterStateTaskExecutor.ClusterTasksResult<JoinTaskExecutor.Task>
execute(ClusterState currentState, java.util.List<JoinTaskExecutor.Task> joiningNodes)
Update the cluster state based on the current state and the given tasks.static JoinTaskExecutor.Task
newBecomeMasterTask()
static JoinTaskExecutor.Task
newFinishElectionTask()
a task that is used to signal the election is stopped and we should process pending joins.boolean
runOnlyOnMaster()
indicates whether this executor should only run if the current node is master-
Methods 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 Detail
-
JoinTaskExecutor
public JoinTaskExecutor(Settings settings, AllocationService allocationService, org.apache.logging.log4j.Logger logger)
-
-
Method Detail
-
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 interfaceClusterStateTaskExecutor<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 interfaceClusterStateTaskExecutor<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 withnewBecomeMasterTask()
-
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)
-
-