@RpcMethod public Acknowledge cancelTask(ExecutionAttemptID executionAttemptID) throws TaskException { final Task task = taskSlotTable.getTask(executionAttemptID); if (task != null) { try { task.cancelExecution(); return Acknowledge.get(); } catch (Throwable t) { throw new TaskException("Cannot cancel task for execution " + executionAttemptID + '.', t); } } else { final String message = "Cannot find task to stop for execution " + executionAttemptID + '.'; log.debug(message); throw new TaskException(message); } }
@RpcMethod public Acknowledge stopTask(ExecutionAttemptID executionAttemptID) throws TaskException { final Task task = taskSlotTable.getTask(executionAttemptID); if (task != null) { try { task.stopExecution(); return Acknowledge.get(); } catch (Throwable t) { throw new TaskException("Cannot stop task for execution " + executionAttemptID + '.', t); } } else { final String message = "Cannot find task to stop for execution " + executionAttemptID + '.'; log.debug(message); throw new TaskException(message); } }
@Override public CompletableFuture<Acknowledge> cancelTask(ExecutionAttemptID executionAttemptID, Time timeout) { final Task task = taskSlotTable.getTask(executionAttemptID); if (task != null) { try { task.cancelExecution(); return CompletableFuture.completedFuture(Acknowledge.get()); } catch (Throwable t) { return FutureUtils.completedExceptionally( new TaskException("Cannot cancel task for execution " + executionAttemptID + '.', t)); } } else { final String message = "Cannot find task to stop for execution " + executionAttemptID + '.'; log.debug(message); return FutureUtils.completedExceptionally(new TaskException(message)); } }
@Override public CompletableFuture<Acknowledge> cancelTask(ExecutionAttemptID executionAttemptID, Time timeout) { final Task task = taskSlotTable.getTask(executionAttemptID); if (task != null) { try { task.cancelExecution(); return CompletableFuture.completedFuture(Acknowledge.get()); } catch (Throwable t) { return FutureUtils.completedExceptionally( new TaskException("Cannot cancel task for execution " + executionAttemptID + '.', t)); } } else { final String message = "Cannot find task to stop for execution " + executionAttemptID + '.'; log.debug(message); return FutureUtils.completedExceptionally(new TaskException(message)); } }
@Override public CompletableFuture<Acknowledge> stopTask(ExecutionAttemptID executionAttemptID, Time timeout) { final Task task = taskSlotTable.getTask(executionAttemptID); if (task != null) { try { task.stopExecution(); return CompletableFuture.completedFuture(Acknowledge.get()); } catch (Throwable t) { return FutureUtils.completedExceptionally(new TaskException("Cannot stop task for execution " + executionAttemptID + '.', t)); } } else { final String message = "Cannot find task to stop for execution " + executionAttemptID + '.'; log.debug(message); return FutureUtils.completedExceptionally(new TaskException(message)); } }
@Override public CompletableFuture<Acknowledge> cancelTask(ExecutionAttemptID executionAttemptID, Time timeout) { final Task task = taskSlotTable.getTask(executionAttemptID); if (task != null) { try { task.cancelExecution(); return CompletableFuture.completedFuture(Acknowledge.get()); } catch (Throwable t) { return FutureUtils.completedExceptionally( new TaskException("Cannot cancel task for execution " + executionAttemptID + '.', t)); } } else { final String message = "Cannot find task to stop for execution " + executionAttemptID + '.'; log.debug(message); return FutureUtils.completedExceptionally(new TaskException(message)); } }
@Override public CompletableFuture<Acknowledge> stopTask(ExecutionAttemptID executionAttemptID, Time timeout) { final Task task = taskSlotTable.getTask(executionAttemptID); if (task != null) { try { task.stopExecution(); return CompletableFuture.completedFuture(Acknowledge.get()); } catch (Throwable t) { return FutureUtils.completedExceptionally(new TaskException("Cannot stop task for execution " + executionAttemptID + '.', t)); } } else { final String message = "Cannot find task to stop for execution " + executionAttemptID + '.'; log.debug(message); return FutureUtils.completedExceptionally(new TaskException(message)); } }
@Override public CompletableFuture<Acknowledge> stopTask(ExecutionAttemptID executionAttemptID, Time timeout) { final Task task = taskSlotTable.getTask(executionAttemptID); if (task != null) { try { task.stopExecution(); return CompletableFuture.completedFuture(Acknowledge.get()); } catch (Throwable t) { return FutureUtils.completedExceptionally(new TaskException("Cannot stop task for execution " + executionAttemptID + '.', t)); } } else { final String message = "Cannot find task to stop for execution " + executionAttemptID + '.'; log.debug(message); return FutureUtils.completedExceptionally(new TaskException(message)); } }