Interface ClusterStateTaskExecutor<T>

    • Method Detail

      • execute

        ClusterStateTaskExecutor.ClusterTasksResult<T> execute​(ClusterState currentState,
                                                               java.util.List<T> tasks)
                                                        throws java.lang.Exception
        Update the cluster state based on the current state and the given tasks. Return the *same instance* if no state should be changed.
        Throws:
        java.lang.Exception
      • runOnlyOnMaster

        default boolean runOnlyOnMaster()
        indicates whether this executor should only run if the current node is master
      • clusterStatePublished

        default void clusterStatePublished​(ClusterChangedEvent clusterChangedEvent)
        Callback invoked after new cluster state is published. Note that this method is not invoked if the cluster state was not updated. Note that this method will be executed using system context.
        Parameters:
        clusterChangedEvent - the change event for this cluster state change, containing both old and new states
      • describeTasks

        default java.lang.String describeTasks​(java.util.List<T> tasks)
        Builds a concise description of a list of tasks (to be used in logging etc.). Note that the tasks given are not necessarily the same as those that will be passed to execute(ClusterState, List). but are guaranteed to be a subset of them. This method can be called multiple times with different lists before execution. This allows groupd task description but the submitting source.