flink-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matthias J. Sax" <mj...@informatik.hu-berlin.de>
Subject Re: Canceling a Cluster Job from Java
Date Thu, 02 Apr 2015 12:21:36 GMT
Thanks for the answer. It works! :)

-Matthias

On 04/02/2015 12:27 PM, Robert Metzger wrote:
> Hi Matthias,
> 
> I think there is no utility method right now to cancel a running job. I'll
> file a JIRA for this.
> 
> Have a look at how the CLI frontend is cancelling a job:
> https://github.com/apache/flink/blob/6b0d40764da9dce2e2d21882e9a03a21c6783ff0/flink-clients/src/main/java/org/apache/flink/client/CliFrontend.java#L518
> 
> This is where the message is send:
> 
> ActorRef jobManager = getJobManager(options);
>> Future<Object> response = Patterns.ask(jobManager, new CancelJob(jobId),
>> new Timeout(askTimeout));
> 
> 
> 
> Let me know if this approach is not working for you.
> 
> On Thu, Apr 2, 2015 at 10:57 AM, Matthias J. Sax <
> mjsax@informatik.hu-berlin.de> wrote:
> 
>> Hi,
>>
>> I want to cancel a running job from a Java program. However, I don't
>> know how to do it. The Client class
>> (org.apache.flink.client.program.Client) that is used to submit a job,
>> does not provide a method for it (a "Client.cancel(JobId)" would be nice).
>>
>> There is also the Scala JobClient classm that seems to have the
>> capability to forward a "cancelJob" message to the JobManager. However,
>> there is no method to call, either. I guess, the simplest way would be
>> to add a new method here to the JobClient-object defined there. However,
>> I don't speak Scala...
>>
>> Any suggestions?
>>
>>
>> -Matthias
>>
>>
> 


Mime
View raw message