ASF GitHub Bot commented on FLINK-4787:

GitHub user uce opened a pull request:


    [FLINK-4787] [runtime-web] Expose cancel-with-savepoint via REST API

    Follow up to #2609, exposing the cancel-with-savepoint command via the REST 
API. The relevant commits are the last two ones.
    The `RequestHandler` now returns a generic `HttpResponse` instead of a 
`String`. This enables handlers to return custom reponses (different http 
codes, etc.). Now most handlers extend thee `AbstractJsonRequestHandler` for 
default JSON responses (which used to be handled by the generic 
    Adds handlers for triggering and monitoring a job cancellation with 
savepoints. Since this operation can take some time, we do this asynchronously. 
According to various online resources, the way to go for REST APIs in such 
cases is to return HTTP 201 accepted with the location of the in-progress 

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/uce/flink 4787-cancel_with_savepoint_rest_api

Alternatively you can review and apply these changes as the patch at:


To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #2626
commit 99a9621383e6a223e39e4ec22d60671a205d958d
Author: Ufuk Celebi <u...@apache.org>
Date:   2016-10-06T14:43:42Z

    [FLINK-4512] [FLIP-10] Add option to persist periodic checkpoints
    [FLINK-4509] [FLIP-10] Specify savepoint directory per savepoint
    [FLINK-4507] [FLIP-10] Deprecate savepoint backend config

commit 25ffc04d7e5d7ef9538447ee5162c0d203e96e89
Author: Ufuk Celebi <u...@apache.org>
Date:   2016-10-07T09:48:47Z

    [FLINK-4717] Add CancelJobWithSavepoint
    - Adds CancelJobWithSavepoint message, which triggers a savepoint
      before cancelling the respective job.
    - Adds -s [targetDirectory] option to CLI cancel command:
        * bin/flink cancel <jobID> (regular cancelling)
        * bin/flink cancel -s <jobID> (cancel with savepoint to default dir)
        * bin/flink cancek -s <targetDir> <jobID> (cancel with savepoint to 

commit bc88dba90a263e80691448e20644e5f126551bb6
Author: Ufuk Celebi <u...@apache.org>
Date:   2016-10-11T08:08:14Z

    [FLINK-4787] [runtime-web] Return generic HttpResponse in RequestHandler
    - Let RequestHandler return a generic HttpResponse instead of a String. This
      enables handlers to return custom reponses (differnt http codes, etc.)
    - Introduce AbstractJsonRequestHandler for default JSON responses

commit ecbcf46f5a9d874dbdd908d48c7035c1cb338c1a
Author: Ufuk Celebi <u...@apache.org>
Date:   2016-10-11T08:09:20Z

    [FLINK-4787] [runtime-web] Add JobCancellationWithSavepointHandlers
    - Add handlers for triggering and monitoring job cancellation with


> Add REST API call for cancel-with-savepoints
> --------------------------------------------
>                 Key: FLINK-4787
>                 URL: https://issues.apache.org/jira/browse/FLINK-4787
>             Project: Flink
>          Issue Type: Improvement
>          Components: Webfrontend
>            Reporter: Ufuk Celebi
> As a follow up to FLINK-4717, expose the cancel-with-savepoint command via 
> the REST API.
> {code}
> /jobs/:jobid/cancel-with-savepoint/
> /jobs/:jobid/cancel-with-savepoint/:targetDirectory
> {code}
> The first command goes to the default savepoint directory, the second one 
> uses the given target directory.
> The calls need to be async, as triggering a savepoint can take some time. For 
> this, the handlers return a {{201 (Accepted)}} response with the location of 
> the status, e.g. {{/jobs/:jobid/cancel-with-savepoint/in-progress/:id}}.
> The user has to check that location until the final savepoint path is 
> returned.

This message was sent by Atlassian JIRA

Reply via email to