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 Summary
Modifier and TypeMethodDescriptionbooleanassignTask(TaskId taskId, WorkerNode node) Assign Task to a particular WorkerNode.voidcancelTask(TaskId taskId) Mark task as cancelled.Get task from TaskStore/QueuelistTasks(TaskListRequest taskListRequest) List all tasks applying all the filters present in listTaskRequestvoidupdateTask(Task task) Update task in TaskStore/Queue
-
Method Details
-
getTask
Get task from TaskStore/Queue- Parameters:
taskId- TaskId of the task to be retrieved- Returns:
- Task corresponding to TaskId
-
updateTask
Update task in TaskStore/Queue- Parameters:
task- Task to be updated
-
cancelTask
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 all tasks applying all the filters present in listTaskRequest- Parameters:
taskListRequest- TaskListRequest- Returns:
- list of all the task matching the filters in listTaskRequest
-
assignTask
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 assignednode- WorkerNode task is being assigned to- Returns:
- true if task is assigned successfully, false otherwise
-