You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by mx...@apache.org on 2015/11/18 18:57:12 UTC
[3/3] flink git commit: [FLINK-2989] job cancel button doesn't work
on YARN
[FLINK-2989] job cancel button doesn't work on YARN
In addition to the REST-compliant "DELETE /jobs/<jobid>", allows
cancellation also via a special GET request of the form
"GET /jobs/<jobid>/yarn-cancel".
That enables us to cancel jobs from the web frontend on YARN while
keeping a REST-compliant DELETE alternative.
Project: http://git-wip-us.apache.org/repos/asf/flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/a7e799b9
Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/a7e799b9
Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/a7e799b9
Branch: refs/heads/release-0.10
Commit: a7e799b9f728d2ea9854fd971bb0967e052b9b11
Parents: f5f6750
Author: Maximilian Michels <mx...@apache.org>
Authored: Tue Nov 10 13:35:58 2015 +0100
Committer: Maximilian Michels <mx...@apache.org>
Committed: Wed Nov 18 18:56:28 2015 +0100
----------------------------------------------------------------------
.../runtime/webmonitor/WebRuntimeMonitor.java | 9 +-
.../app/scripts/modules/jobs/jobs.svc.coffee | 4 +-
flink-runtime-web/web-dashboard/web/js/index.js | 4 +-
.../web-dashboard/web/js/vendor.js | 312 ++++++++-----------
4 files changed, 144 insertions(+), 185 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flink/blob/a7e799b9/flink-runtime-web/src/main/java/org/apache/flink/runtime/webmonitor/WebRuntimeMonitor.java
----------------------------------------------------------------------
diff --git a/flink-runtime-web/src/main/java/org/apache/flink/runtime/webmonitor/WebRuntimeMonitor.java b/flink-runtime-web/src/main/java/org/apache/flink/runtime/webmonitor/WebRuntimeMonitor.java
index eed781e..03a25a2 100644
--- a/flink-runtime-web/src/main/java/org/apache/flink/runtime/webmonitor/WebRuntimeMonitor.java
+++ b/flink-runtime-web/src/main/java/org/apache/flink/runtime/webmonitor/WebRuntimeMonitor.java
@@ -186,11 +186,14 @@ public class WebRuntimeMonitor implements WebMonitor {
.GET("/jobmanager/log", new StaticFileServerHandler(retriever, jobManagerAddressPromise.future(), timeout, logFiles.logFile))
.GET("/jobmanager/stdout", new StaticFileServerHandler(retriever, jobManagerAddressPromise.future(), timeout, logFiles.stdOutFile))
+ // Cancel a job via GET (for proper integration with YARN this has to be performed via GET)
+ .GET("/jobs/:jobid/yarn-cancel", handler(new JobCancellationHandler()))
+ // DELETE is the preferred way of cancelling a job (Rest-conform)
+ .DELETE("/jobs/:jobid", handler(new JobCancellationHandler()))
+
// this handler serves all the static contents
- .GET("/:*", new StaticFileServerHandler(retriever, jobManagerAddressPromise.future(), timeout, webRootDir))
+ .GET("/:*", new StaticFileServerHandler(retriever, jobManagerAddressPromise.future(), timeout, webRootDir));
- // cancel a job
- .DELETE("/jobs/:jobid", handler(new JobCancellationHandler()));
synchronized (startupShutdownLock) {
http://git-wip-us.apache.org/repos/asf/flink/blob/a7e799b9/flink-runtime-web/web-dashboard/app/scripts/modules/jobs/jobs.svc.coffee
----------------------------------------------------------------------
diff --git a/flink-runtime-web/web-dashboard/app/scripts/modules/jobs/jobs.svc.coffee b/flink-runtime-web/web-dashboard/app/scripts/modules/jobs/jobs.svc.coffee
index 698437f..703950e 100644
--- a/flink-runtime-web/web-dashboard/app/scripts/modules/jobs/jobs.svc.coffee
+++ b/flink-runtime-web/web-dashboard/app/scripts/modules/jobs/jobs.svc.coffee
@@ -212,6 +212,8 @@ angular.module('flinkApp')
deferred.promise
@cancelJob = (jobid) ->
- $http.delete "jobs/" + jobid
+ # uses the non REST-compliant GET yarn-cancel handler which is available in addition to the
+ # proper "DELETE jobs/<jobid>/"
+ $http.get "jobs/" + jobid + "/yarn-cancel"
@