Github user mxm commented on a diff in the pull request:

    https://github.com/apache/flink/pull/642#discussion_r29447805
  
    --- Diff: 
flink-clients/src/main/java/org/apache/flink/client/program/Client.java ---
    @@ -420,6 +428,60 @@ public JobSubmissionResult run(JobGraph jobGraph, 
boolean wait) throws ProgramIn
                }
        }
     
    +
    +   /**
    +    * Executes the CANCEL action.
    +    *
    +    * @param args Command line arguments for the cancel action.
    +    */
    +
    +
    +   protected int cancel(JobID jobId){
    +           LOG.info("Executing 'cancel' command.");
    +
    +           final FiniteDuration timeout = 
AkkaUtils.getTimeout(configuration);
    +
    +           try {
    +                   String address = 
configuration.getString(ConfigConstants.JOB_MANAGER_IPC_ADDRESS_KEY, null);
    +                   Option<Tuple2<String, Object>> remoting =
    +                                   new Some<Tuple2<String, Object>>(new 
Tuple2<String, Object>("", 0));
    +
    +                   // start a remote actor system to listen on an 
arbitrary port
    +                   ActorSystem actorSystem = 
AkkaUtils.createActorSystem(configuration, remoting);
    +
    +
    +                   ActorRef jobManager = 
JobManager.getJobManagerRemoteReference(address, actorSystem, timeout);
    +                   Future<Object> response = Patterns.ask(jobManager, new 
JobManagerMessages.CancelJob(jobId), new Timeout(AkkaUtils.INF_TIMEOUT()));
    +
    +                   try {
    +                           Await.result(response, timeout);
    --- End diff --
    
    You should checked the result here. `Await.result` returns an Object which 
is either `CancellationSuccess` or `CancellationFailure`.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to