@ThreadSafe public class TaskExecutorManager extends Object
Constructor and Description |
---|
TaskExecutorManager(int taskExecutorPoolSize)
Constructs a new instance of
TaskExecutorManager . |
Modifier and Type | Method and Description |
---|---|
void |
cancelTask(long jobId,
int taskId)
Cancels the given task.
|
void |
executeTask(long jobId,
int taskId,
JobConfig jobConfig,
Serializable taskArgs,
RunTaskContext context)
Executes the given task.
|
List<TaskInfo> |
getAndClearTaskUpdates() |
void |
notifyTaskCompletion(long jobId,
int taskId,
Object result)
Notifies the completion of the task.
|
void |
notifyTaskFailure(long jobId,
int taskId,
String errorMessage)
Notifies the failure of the task.
|
void |
restoreTaskUpdates(List<TaskInfo> tasks)
Adds the given tasks to the task updates data structure.
|
public TaskExecutorManager(int taskExecutorPoolSize)
TaskExecutorManager
.taskExecutorPoolSize
- number of task executors in the poolpublic void notifyTaskCompletion(long jobId, int taskId, Object result)
jobId
- the job idtaskId
- the task idresult
- the task execution resultpublic void notifyTaskFailure(long jobId, int taskId, String errorMessage)
jobId
- the job idtaskId
- the task iderrorMessage
- the error messagepublic void executeTask(long jobId, int taskId, JobConfig jobConfig, Serializable taskArgs, RunTaskContext context)
jobId
- the job idtaskId
- the task idjobConfig
- the job configurationtaskArgs
- the argumentscontext
- the context of the workerpublic void cancelTask(long jobId, int taskId)
jobId
- the job idtaskId
- the task idpublic List<TaskInfo> getAndClearTaskUpdates()
Copyright © 2023. All Rights Reserved.