Interface TaskManagerClient


@ExperimentalApi public interface TaskManagerClient
Client used to interact with Task Store/Queue. TODO: TaskManager can be something not running an opensearch process. We need to come up with a way to allow this interface to be used with in and out opensearch as well
Opensearch.experimental:
  • Method Details

    • getTask

      Task getTask(TaskId taskId)
      Get task from TaskStore/Queue
      Parameters:
      taskId - TaskId of the task to be retrieved
      Returns:
      Task corresponding to TaskId
    • updateTask

      void updateTask(Task task)
      Update task in TaskStore/Queue
      Parameters:
      task - Task to be updated
    • cancelTask

      void cancelTask(TaskId taskId)
      Mark task as cancelled. Ongoing Tasks can be cancelled as well if the corresponding worker supports cancellation
      Parameters:
      taskId - TaskId of the task to be cancelled
    • listTasks

      List<Task> listTasks(TaskListRequest taskListRequest)
      List all tasks applying all the filters present in listTaskRequest
      Parameters:
      taskListRequest - TaskListRequest
      Returns:
      list of all the task matching the filters in listTaskRequest
    • assignTask

      boolean assignTask(TaskId taskId, WorkerNode node)
      Assign Task to a particular WorkerNode. This ensures no 2 worker Nodes work on the same task. This API can be used in both pull and push models of task assignment.
      Parameters:
      taskId - TaskId of the task to be assigned
      node - WorkerNode task is being assigned to
      Returns:
      true if task is assigned successfully, false otherwise