@ThreadSafe public final class CommandManager extends Object
Constructor and Description |
---|
CommandManager()
Constructs a new
CommandManager . |
Modifier and Type | Method and Description |
---|---|
List<JobCommand> |
pollAllPendingCommands(long workerId)
Polls all the pending commands to a worker and removes the commands from the queue.
|
void |
submitCancelTaskCommand(long jobId,
int taskId,
long workerId)
Submits a cancel-task command to a specified worker.
|
void |
submitRunTaskCommand(long jobId,
int taskId,
JobConfig jobConfig,
Object taskArgs,
long workerId)
Submits a run-task command to a specified worker.
|
public CommandManager()
CommandManager
.public void submitRunTaskCommand(long jobId, int taskId, JobConfig jobConfig, Object taskArgs, long workerId)
jobId
- the id of the jobtaskId
- the id of the taskjobConfig
- the job configurationtaskArgs
- the arguments passed to the executor on the workerworkerId
- the id of the workerpublic void submitCancelTaskCommand(long jobId, int taskId, long workerId)
jobId
- the job idtaskId
- the task idworkerId
- the worker idpublic List<JobCommand> pollAllPendingCommands(long workerId)
workerId
- id of the worker to send the commands toCopyright © 2023. All Rights Reserved.