/** * Sends stop RPC call. */ public void stop() { final LogicalSlot slot = assignedResource; if (slot != null) { final TaskManagerGateway taskManagerGateway = slot.getTaskManagerGateway(); CompletableFuture<Acknowledge> stopResultFuture = FutureUtils.retry( () -> taskManagerGateway.stopTask(attemptId, rpcTimeout), NUM_STOP_CALL_TRIES, executor); stopResultFuture.exceptionally( failure -> { LOG.info("Stopping task was not successful.", failure); return null; }); } }
/** * Sends stop RPC call. */ public void stop() { final LogicalSlot slot = assignedResource; if (slot != null) { final TaskManagerGateway taskManagerGateway = slot.getTaskManagerGateway(); CompletableFuture<Acknowledge> stopResultFuture = FutureUtils.retry( () -> taskManagerGateway.stopTask(attemptId, rpcTimeout), NUM_STOP_CALL_TRIES, executor); stopResultFuture.exceptionally( failure -> { LOG.info("Stopping task was not successful.", failure); return null; }); } }
/** * Sends stop RPC call. */ public void stop() { final LogicalSlot slot = assignedResource; if (slot != null) { final TaskManagerGateway taskManagerGateway = slot.getTaskManagerGateway(); CompletableFuture<Acknowledge> stopResultFuture = FutureUtils.retry( () -> taskManagerGateway.stopTask(attemptId, rpcTimeout), NUM_STOP_CALL_TRIES, executor); stopResultFuture.exceptionally( failure -> { LOG.info("Stopping task was not successful.", failure); return null; }); } }
/** * Sends stop RPC call. */ public void stop() { final SimpleSlot slot = assignedResource; if (slot != null) { final TaskManagerGateway taskManagerGateway = slot.getTaskManagerGateway(); Future<Acknowledge> stopResultFuture = FutureUtils.retry( new Callable<Future<Acknowledge>>() { @Override public Future<Acknowledge> call() throws Exception { return taskManagerGateway.stopTask(attemptId, timeout); } }, NUM_STOP_CALL_TRIES, executor); stopResultFuture.exceptionally(new ApplyFunction<Throwable, Void>() { @Override public Void apply(Throwable failure) { LOG.info("Stopping task was not successful.", failure); return null; } }); } }
/** * This method sends a CancelTask message to the instance of the assigned slot. * * The sending is tried up to NUM_CANCEL_CALL_TRIES times. */ private void sendCancelRpcCall() { final SimpleSlot slot = assignedResource; if (slot != null) { final TaskManagerGateway taskManagerGateway = slot.getTaskManagerGateway(); Future<Acknowledge> cancelResultFuture = FutureUtils.retry( new Callable<Future<Acknowledge>>() { @Override public Future<Acknowledge> call() throws Exception { return taskManagerGateway.cancelTask(attemptId, timeout); } }, NUM_CANCEL_CALL_TRIES, executor); cancelResultFuture.exceptionallyAsync(new ApplyFunction<Throwable, Void>() { @Override public Void apply(Throwable failure) { fail(new Exception("Task could not be canceled.", failure)); return null; } }, executor); } }
/** * This method sends a CancelTask message to the instance of the assigned slot. * * <p>The sending is tried up to NUM_CANCEL_CALL_TRIES times. */ private void sendCancelRpcCall() { final LogicalSlot slot = assignedResource; if (slot != null) { final TaskManagerGateway taskManagerGateway = slot.getTaskManagerGateway(); CompletableFuture<Acknowledge> cancelResultFuture = FutureUtils.retry( () -> taskManagerGateway.cancelTask(attemptId, rpcTimeout), NUM_CANCEL_CALL_TRIES, executor); cancelResultFuture.whenCompleteAsync( (ack, failure) -> { if (failure != null) { fail(new Exception("Task could not be canceled.", failure)); } }, executor); } }
/** * This method sends a CancelTask message to the instance of the assigned slot. * * <p>The sending is tried up to NUM_CANCEL_CALL_TRIES times. */ private void sendCancelRpcCall() { final LogicalSlot slot = assignedResource; if (slot != null) { final TaskManagerGateway taskManagerGateway = slot.getTaskManagerGateway(); CompletableFuture<Acknowledge> cancelResultFuture = FutureUtils.retry( () -> taskManagerGateway.cancelTask(attemptId, rpcTimeout), NUM_CANCEL_CALL_TRIES, executor); cancelResultFuture.whenCompleteAsync( (ack, failure) -> { if (failure != null) { fail(new Exception("Task could not be canceled.", failure)); } }, executor); } }
/** * This method sends a CancelTask message to the instance of the assigned slot. * * The sending is tried up to NUM_CANCEL_CALL_TRIES times. */ private void sendCancelRpcCall() { final LogicalSlot slot = assignedResource; if (slot != null) { final TaskManagerGateway taskManagerGateway = slot.getTaskManagerGateway(); CompletableFuture<Acknowledge> cancelResultFuture = FutureUtils.retry( () -> taskManagerGateway.cancelTask(attemptId, rpcTimeout), NUM_CANCEL_CALL_TRIES, executor); cancelResultFuture.whenCompleteAsync( (ack, failure) -> { if (failure != null) { fail(new Exception("Task could not be canceled.", failure)); } }, executor); } }