flink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From u..@apache.org
Subject [3/3] flink git commit: [FLINK-2811] [web-dashboard] Add job manager configuration overview
Date Tue, 06 Oct 2015 09:39:40 GMT
[FLINK-2811] [web-dashboard] Add job manager configuration overview

This closes #1219


Project: http://git-wip-us.apache.org/repos/asf/flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/de14a801
Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/de14a801
Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/de14a801

Branch: refs/heads/master
Commit: de14a80152f092fea661c1105cba87178a9e462c
Parents: 19076b2
Author: Sachin Goel <sachingoel0101@gmail.com>
Authored: Sat Oct 3 14:09:36 2015 +0530
Committer: Ufuk Celebi <uce@apache.org>
Committed: Tue Oct 6 11:39:22 2015 +0200

----------------------------------------------------------------------
 .../runtime/webmonitor/WebRuntimeMonitor.java   |   4 +
 .../handlers/JobManagerConfigHandler.java       |  55 ++++++++
 flink-runtime-web/web-dashboard/app/index.jade  |   7 +-
 .../app/partials/jobmanager/config.jade         |  29 +++++
 .../app/partials/jobmanager/index.jade          |  35 ++++++
 .../app/partials/jobmanager/logfile.jade        |  16 +++
 .../app/partials/jobmanager/stdout.jade         |  16 +++
 .../web-dashboard/app/scripts/index.coffee      |  25 ++++
 .../modules/jobmanager/jobmanager.ctrl.coffee   |  25 ++++
 .../modules/jobmanager/jobmanager.svc.coffee    |  34 +++++
 flink-runtime-web/web-dashboard/web/index.html  |   4 +-
 flink-runtime-web/web-dashboard/web/js/index.js | 125 +++++++++++++------
 .../web/partials/jobmanager/config.html         |  33 +++++
 .../web/partials/jobmanager/index.html          |  33 +++++
 .../web/partials/jobmanager/logfile.html        |  18 +++
 .../web/partials/jobmanager/stdout.html         |  18 +++
 16 files changed, 439 insertions(+), 38 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/de14a801/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 1f10a73..946155a 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
@@ -39,6 +39,7 @@ import org.apache.flink.runtime.akka.AkkaUtils;
 import org.apache.flink.runtime.leaderretrieval.LeaderRetrievalService;
 import org.apache.flink.runtime.webmonitor.files.StaticFileServerHandler;
 import org.apache.flink.runtime.webmonitor.handlers.JobAccumulatorsHandler;
+import org.apache.flink.runtime.webmonitor.handlers.JobManagerConfigHandler;
 import org.apache.flink.runtime.webmonitor.handlers.JobPlanHandler;
 import org.apache.flink.runtime.webmonitor.handlers.JobConfigHandler;
 import org.apache.flink.runtime.webmonitor.handlers.JobExceptionsHandler;
@@ -159,6 +160,9 @@ public class WebRuntimeMonitor implements WebMonitor {
 			// the overview - how many task managers, slots, free slots, ...
 			.GET("/overview", handler(new ClusterOverviewHandler(retriever, DEFAULT_REQUEST_TIMEOUT)))
 
+			// job manager configuration
+			.GET("/jobmanager/config", handler(new JobManagerConfigHandler(config)))
+
 			// overview over jobs
 			.GET("/joboverview", handler(new CurrentJobsOverviewHandler(retriever, DEFAULT_REQUEST_TIMEOUT,
true, true)))
 			.GET("/joboverview/running", handler(new CurrentJobsOverviewHandler(retriever, DEFAULT_REQUEST_TIMEOUT,
true, false)))

http://git-wip-us.apache.org/repos/asf/flink/blob/de14a801/flink-runtime-web/src/main/java/org/apache/flink/runtime/webmonitor/handlers/JobManagerConfigHandler.java
----------------------------------------------------------------------
diff --git a/flink-runtime-web/src/main/java/org/apache/flink/runtime/webmonitor/handlers/JobManagerConfigHandler.java
b/flink-runtime-web/src/main/java/org/apache/flink/runtime/webmonitor/handlers/JobManagerConfigHandler.java
new file mode 100644
index 0000000..77314ec
--- /dev/null
+++ b/flink-runtime-web/src/main/java/org/apache/flink/runtime/webmonitor/handlers/JobManagerConfigHandler.java
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.runtime.webmonitor.handlers;
+
+import com.fasterxml.jackson.core.JsonGenerator;
+import org.apache.flink.configuration.Configuration;
+
+import java.io.StringWriter;
+import java.util.Map;
+
+/**
+ * Returns the Job Manager's configuration.
+ */
+public class JobManagerConfigHandler implements RequestHandler, RequestHandler.JsonResponse
{
+
+	private final Configuration config;
+
+	public JobManagerConfigHandler(Configuration config) {
+		this.config = config;
+	}
+
+	@Override
+	public String handleRequest(Map<String, String> params) throws Exception {
+		StringWriter writer = new StringWriter();
+		JsonGenerator gen = JsonFactory.jacksonFactory.createJsonGenerator(writer);
+
+		gen.writeStartArray();
+		for (String key : config.keySet()) {
+			gen.writeStartObject();
+			gen.writeStringField("key", key);
+			gen.writeStringField("value", config.getString(key, null));
+			gen.writeEndObject();
+		}
+		gen.writeEndArray();
+
+		gen.close();
+		return writer.toString();
+	}
+}

http://git-wip-us.apache.org/repos/asf/flink/blob/de14a801/flink-runtime-web/web-dashboard/app/index.jade
----------------------------------------------------------------------
diff --git a/flink-runtime-web/web-dashboard/app/index.jade b/flink-runtime-web/web-dashboard/app/index.jade
index 4c0d2fc..a5a28ac 100644
--- a/flink-runtime-web/web-dashboard/app/index.jade
+++ b/flink-runtime-web/web-dashboard/app/index.jade
@@ -53,7 +53,7 @@ html(lang='en')
               | Running Jobs
           li
             a(ui-sref="completed-jobs" ui-sref-active='active')
-              i.fa.fa-server.fa-fw
+              i.fa.fa-check-circle.fa-fw
               | 
               | Completed Jobs
           li
@@ -61,6 +61,11 @@ html(lang='en')
               i.fa.fa-sitemap.fa-fw
               | 
               | Task Managers
+          li
+            a(ui-sref="jobmanager.config" ui-sref-active='active')
+              i.fa.fa-server.fa-fw
+              | 
+              | Job Manager
 
     #content(ng-class="{ 'sidebar-visible': sidebarVisible }")
       div(ui-view='main')

http://git-wip-us.apache.org/repos/asf/flink/blob/de14a801/flink-runtime-web/web-dashboard/app/partials/jobmanager/config.jade
----------------------------------------------------------------------
diff --git a/flink-runtime-web/web-dashboard/app/partials/jobmanager/config.jade b/flink-runtime-web/web-dashboard/app/partials/jobmanager/config.jade
new file mode 100644
index 0000000..f151115
--- /dev/null
+++ b/flink-runtime-web/web-dashboard/app/partials/jobmanager/config.jade
@@ -0,0 +1,29 @@
+//
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+ 
+      http://www.apache.org/licenses/LICENSE-2.0
+ 
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+
+table.table.table-properties
+  thead
+    tr
+      th
+        | Key
+      th
+        | Value
+
+  tbody
+    tr(ng-repeat="entry in jobmanager.config | orderBy: 'key'")
+      td {{entry.key}}
+      td {{entry.value}}

http://git-wip-us.apache.org/repos/asf/flink/blob/de14a801/flink-runtime-web/web-dashboard/app/partials/jobmanager/index.jade
----------------------------------------------------------------------
diff --git a/flink-runtime-web/web-dashboard/app/partials/jobmanager/index.jade b/flink-runtime-web/web-dashboard/app/partials/jobmanager/index.jade
new file mode 100644
index 0000000..00ff0fd
--- /dev/null
+++ b/flink-runtime-web/web-dashboard/app/partials/jobmanager/index.jade
@@ -0,0 +1,35 @@
+//
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+ 
+      http://www.apache.org/licenses/LICENSE-2.0
+ 
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+
+nav.navbar.navbar-default.navbar-fixed-top.navbar-main
+  #fold-button.btn.btn-default.navbar-btn.pull-left(ng-click='showSidebar()')
+    i.fa.fa-navicon
+
+  .navbar-title
+    | Job Manager
+
+nav.navbar.navbar-default.navbar-fixed-top.navbar-main-additional
+  ul.nav.nav-tabs
+    li(ui-sref-active='active')
+      a(ui-sref=".config") Configuration
+    li(ui-sref-active='active')
+      a(ui-sref=".logfile") Logs
+    li(ui-sref-active='active')
+      a(ui-sref=".stdout") Stdout
+
+#content-inner.has-navbar-main-additional
+  div(ui-view="details")

http://git-wip-us.apache.org/repos/asf/flink/blob/de14a801/flink-runtime-web/web-dashboard/app/partials/jobmanager/logfile.jade
----------------------------------------------------------------------
diff --git a/flink-runtime-web/web-dashboard/app/partials/jobmanager/logfile.jade b/flink-runtime-web/web-dashboard/app/partials/jobmanager/logfile.jade
new file mode 100644
index 0000000..c0de885
--- /dev/null
+++ b/flink-runtime-web/web-dashboard/app/partials/jobmanager/logfile.jade
@@ -0,0 +1,16 @@
+//
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+ 
+      http://www.apache.org/licenses/LICENSE-2.0
+ 
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.

http://git-wip-us.apache.org/repos/asf/flink/blob/de14a801/flink-runtime-web/web-dashboard/app/partials/jobmanager/stdout.jade
----------------------------------------------------------------------
diff --git a/flink-runtime-web/web-dashboard/app/partials/jobmanager/stdout.jade b/flink-runtime-web/web-dashboard/app/partials/jobmanager/stdout.jade
new file mode 100644
index 0000000..c0de885
--- /dev/null
+++ b/flink-runtime-web/web-dashboard/app/partials/jobmanager/stdout.jade
@@ -0,0 +1,16 @@
+//
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+ 
+      http://www.apache.org/licenses/LICENSE-2.0
+ 
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.

http://git-wip-us.apache.org/repos/asf/flink/blob/de14a801/flink-runtime-web/web-dashboard/app/scripts/index.coffee
----------------------------------------------------------------------
diff --git a/flink-runtime-web/web-dashboard/app/scripts/index.coffee b/flink-runtime-web/web-dashboard/app/scripts/index.coffee
index 7154e14..eaa27f1 100644
--- a/flink-runtime-web/web-dashboard/app/scripts/index.coffee
+++ b/flink-runtime-web/web-dashboard/app/scripts/index.coffee
@@ -150,4 +150,29 @@ angular.module('flinkApp', ['ui.router', 'angularMoment'])
         templateUrl: "partials/taskmanagers/index.html"
         controller: 'TaskManagersController'
 
+  .state "jobmanager",
+      url: "/jobmanager"
+      views:
+        main:
+          templateUrl: "partials/jobmanager/index.html"
+
+  .state "jobmanager.config",
+    url: "/config"
+    views:
+      details:
+        templateUrl: "partials/jobmanager/config.html"
+        controller: 'JobManagerConfigController'
+
+  .state "jobmanager.stdout",
+    url: "/stdout"
+    views:
+      details:
+        templateUrl: "partials/jobmanager/stdout.html"
+
+  .state "jobmanager.logfile",
+    url: "/logfile"
+    views:
+      details:
+        templateUrl: "partials/jobmanager/logfile.html"
+
   $urlRouterProvider.otherwise "/overview"

http://git-wip-us.apache.org/repos/asf/flink/blob/de14a801/flink-runtime-web/web-dashboard/app/scripts/modules/jobmanager/jobmanager.ctrl.coffee
----------------------------------------------------------------------
diff --git a/flink-runtime-web/web-dashboard/app/scripts/modules/jobmanager/jobmanager.ctrl.coffee
b/flink-runtime-web/web-dashboard/app/scripts/modules/jobmanager/jobmanager.ctrl.coffee
new file mode 100644
index 0000000..b3534c2
--- /dev/null
+++ b/flink-runtime-web/web-dashboard/app/scripts/modules/jobmanager/jobmanager.ctrl.coffee
@@ -0,0 +1,25 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+angular.module('flinkApp')
+
+.controller 'JobManagerConfigController', ($scope, JobManagerConfigService) ->
+  JobManagerConfigService.loadConfig().then (data) ->
+    if !$scope.jobmanager?
+      $scope.jobmanager = {}
+    $scope.jobmanager['config'] = data

http://git-wip-us.apache.org/repos/asf/flink/blob/de14a801/flink-runtime-web/web-dashboard/app/scripts/modules/jobmanager/jobmanager.svc.coffee
----------------------------------------------------------------------
diff --git a/flink-runtime-web/web-dashboard/app/scripts/modules/jobmanager/jobmanager.svc.coffee
b/flink-runtime-web/web-dashboard/app/scripts/modules/jobmanager/jobmanager.svc.coffee
new file mode 100644
index 0000000..38411f8
--- /dev/null
+++ b/flink-runtime-web/web-dashboard/app/scripts/modules/jobmanager/jobmanager.svc.coffee
@@ -0,0 +1,34 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+angular.module('flinkApp')
+
+.service 'JobManagerConfigService', ($http, flinkConfig, $q) ->
+  config = {}
+
+  @loadConfig = ->
+    deferred = $q.defer()
+
+    $http.get("/jobmanager/config")
+    .success (data, status, headers, config) ->
+      config = data
+      deferred.resolve(data)
+
+    deferred.promise
+
+  @

http://git-wip-us.apache.org/repos/asf/flink/blob/de14a801/flink-runtime-web/web-dashboard/web/index.html
----------------------------------------------------------------------
diff --git a/flink-runtime-web/web-dashboard/web/index.html b/flink-runtime-web/web-dashboard/web/index.html
index 850aa2b..f06eb80 100644
--- a/flink-runtime-web/web-dashboard/web/index.html
+++ b/flink-runtime-web/web-dashboard/web/index.html
@@ -39,10 +39,12 @@ limitations under the License.
               Overview</a></li>
           <li><a ui-sref="running-jobs" ui-sref-active="active"><i class="fa
fa-tasks fa-fw"></i> 
               Running Jobs</a></li>
-          <li><a ui-sref="completed-jobs" ui-sref-active="active"><i class="fa
fa-server fa-fw"></i> 
+          <li><a ui-sref="completed-jobs" ui-sref-active="active"><i class="fa
fa-check-circle fa-fw"></i> 
               Completed Jobs</a></li>
           <li><a ui-sref="taskmanagers" ui-sref-active="active"><i class="fa
fa-sitemap fa-fw"></i> 
               Task Managers</a></li>
+          <li><a ui-sref="jobmanager.config" ui-sref-active="active"><i class="fa
fa-server fa-fw"></i> 
+              Job Manager</a></li>
         </ul>
       </div>
     </div>


Mime
View raw message