@Test public void submitCancelTaskCommand() { long jobId = 0L; int taskId = 1; long workerId = 2L; mManager.submitCancelTaskCommand(jobId, taskId, workerId); List<JobCommand> commands = mManager.pollAllPendingCommands(workerId); Assert.assertEquals(1, commands.size()); JobCommand command = commands.get(0); Assert.assertEquals(jobId, command.getCancelTaskCommand().getJobId()); Assert.assertEquals(taskId, command.getCancelTaskCommand().getTaskId()); }
public synchronized void submitCancelTaskCommand(long jobId, long taskId, long workerId) { CancelTaskCommand.Builder cancelTaskCommand = CancelTaskCommand.newBuilder(); cancelTaskCommand.setJobId(jobId); cancelTaskCommand.setTaskId(taskId); JobCommand.Builder command = JobCommand.newBuilder(); command.setCancelTaskCommand(cancelTaskCommand); submit(workerId, command); }
CommandManager { public synchronized void submitCancelTaskCommand(long jobId, long taskId, long workerId) { CancelTaskCommand.Builder cancelTaskCommand = CancelTaskCommand.newBuilder(); cancelTaskCommand.setJobId(jobId); cancelTaskCommand.setTaskId(taskId); JobCommand.Builder command = JobCommand.newBuilder(); command.setCancelTaskCommand(cancelTaskCommand); submit(workerId, command); } }
CommandManager { public synchronized void submitCancelTaskCommand(long jobId, long taskId, long workerId) { CancelTaskCommand.Builder cancelTaskCommand = CancelTaskCommand.newBuilder(); cancelTaskCommand.setJobId(jobId); cancelTaskCommand.setTaskId(taskId); JobCommand.Builder command = JobCommand.newBuilder(); command.setCancelTaskCommand(cancelTaskCommand); submit(workerId, command); } CommandManager(); }
CommandManager { public synchronized void submitCancelTaskCommand(long jobId, long taskId, long workerId) { CancelTaskCommand.Builder cancelTaskCommand = CancelTaskCommand.newBuilder(); cancelTaskCommand.setJobId(jobId); cancelTaskCommand.setTaskId(taskId); JobCommand.Builder command = JobCommand.newBuilder(); command.setCancelTaskCommand(cancelTaskCommand); submit(workerId, command); } CommandManager(); synchronized void submitRunTaskCommand(long jobId, long taskId, JobConfig jobConfig,
      Object taskArgs, long workerId); synchronized void submitCancelTaskCommand(long jobId, long taskId, long workerId); synchronized void submitSetTaskPoolSizeCommand(long workerId, int taskPoolSize); synchronized List<alluxio.grpc.JobCommand> pollAllPendingCommands(long workerId); }
CommandManager { public synchronized void submitCancelTaskCommand(long jobId, long taskId, long workerId) { CancelTaskCommand.Builder cancelTaskCommand = CancelTaskCommand.newBuilder(); cancelTaskCommand.setJobId(jobId); cancelTaskCommand.setTaskId(taskId); JobCommand.Builder command = JobCommand.newBuilder(); command.setCancelTaskCommand(cancelTaskCommand); submit(workerId, command); } CommandManager(); synchronized void submitRunTaskCommand(long jobId, long taskId, JobConfig jobConfig,
      Object taskArgs, long workerId); synchronized void submitCancelTaskCommand(long jobId, long taskId, long workerId); synchronized void submitSetTaskPoolSizeCommand(long workerId, int taskPoolSize); synchronized List<alluxio.grpc.JobCommand> pollAllPendingCommands(long workerId);  }