Interface MasterServiceTaskQueue<T extends ClusterStateTaskListener>

Type Parameters:
T - The type of task to process.

public interface MasterServiceTaskQueue<T extends ClusterStateTaskListener>
A queue of tasks for the master service to execute. Tasks submitted to the same queue can be processed as a batch, resulting in a single cluster state update. Queues are typically created during initialization using MasterService.createTaskQueue(java.lang.String, org.elasticsearch.common.Priority, org.elasticsearch.cluster.ClusterStateTaskExecutor<T>).
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    submitTask(String source, T task, TimeValue timeout)
    Submit a task to the queue.
  • Method Details

    • submitTask

      void submitTask(String source, T task, @Nullable TimeValue timeout)
      Submit a task to the queue.
      Parameters:
      source - A description of the task.
      task - The task to execute.
      timeout - An optional timeout for the task. If the task is not processed before the timeout elapses, it fails with a ProcessClusterEventTimeoutException (which is passed to ClusterStateTaskListener.onFailure(java.lang.Exception)). Tasks that are directly associated with user actions conventionally use a timeout which comes from the REST parameter ?master_timeout, which is typically available from MasterNodeRequest.masterNodeTimeout(). Tasks that correspond with internal actions should normally have no timeout since it is usually better to wait patiently in the queue until processed rather than to fail, especially if the only reasonable reaction to a failure is to retry.