flink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmetz...@apache.org
Subject [13/15] git commit: Added configuration subsection in webinterface
Date Wed, 18 Jun 2014 12:00:33 GMT
Added configuration subsection in webinterface

Closes #16 (GitHub pull request)
Also closes FLINK-919


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

Branch: refs/heads/master
Commit: 4b9c71d35fb4a630a4f5024e37c8c1396721ba4e
Parents: 3c15276
Author: Jonathan <Jonathan@Hasenburg.de>
Authored: Mon Jun 9 13:47:52 2014 +0200
Committer: Robert Metzger <metzgerr@web.de>
Committed: Wed Jun 18 11:37:28 2014 +0200

----------------------------------------------------------------------
 .../resources/web-docs-infoserver/analyze.html  |  3 +-
 .../web-docs-infoserver/blank-page.html         |  3 +-
 .../web-docs-infoserver/configuration.html      | 95 ++++++++++++++++++++
 .../resources/web-docs-infoserver/history.html  |  5 +-
 .../resources/web-docs-infoserver/index.html    |  5 +-
 .../web-docs-infoserver/js/configuration.js     | 32 +++++++
 .../jobmanager/web/ConfigurationServlet.java    | 77 ++++++++++++++++
 .../nephele/jobmanager/web/WebInfoServer.java   |  1 +
 8 files changed, 215 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-flink/blob/4b9c71d3/stratosphere-runtime/resources/web-docs-infoserver/analyze.html
----------------------------------------------------------------------
diff --git a/stratosphere-runtime/resources/web-docs-infoserver/analyze.html b/stratosphere-runtime/resources/web-docs-infoserver/analyze.html
index 11d39a9..3fc07b3 100755
--- a/stratosphere-runtime/resources/web-docs-infoserver/analyze.html
+++ b/stratosphere-runtime/resources/web-docs-infoserver/analyze.html
@@ -54,7 +54,8 @@
         <div class="collapse navbar-collapse navbar-ex1-collapse">
           <ul class="nav navbar-nav side-nav">
             <li><a href="index.html"><i class="fa fa-dashboard"></i>
Dashboard</a></li>
-            <li><a href="history.html"><i class="fa fa-bar-chart-o"></i>
History</a></li>
+            <li><a href="history.html"><i class="fa fa-bar-chart-o"></i>
History</a></li>
+            <li><a href="configuration.html"><i class="fa fa-keyboard-o"></i>
Configuration</a></li>
           </ul>
 
           <ul class="nav navbar-nav navbar-right navbar-user">

http://git-wip-us.apache.org/repos/asf/incubator-flink/blob/4b9c71d3/stratosphere-runtime/resources/web-docs-infoserver/blank-page.html
----------------------------------------------------------------------
diff --git a/stratosphere-runtime/resources/web-docs-infoserver/blank-page.html b/stratosphere-runtime/resources/web-docs-infoserver/blank-page.html
index 0e9852f..d250e3a 100755
--- a/stratosphere-runtime/resources/web-docs-infoserver/blank-page.html
+++ b/stratosphere-runtime/resources/web-docs-infoserver/blank-page.html
@@ -50,7 +50,8 @@
         <div class="collapse navbar-collapse navbar-ex1-collapse">
           <ul class="nav navbar-nav side-nav">
             <li class="active"><a href="index.html"><i class="fa fa-dashboard"></i>
Dashboard</a></li>
-            <li><a href="history.html"><i class="fa fa-bar-chart-o"></i>
History</a></li>
+            <li><a href="history.html"><i class="fa fa-bar-chart-o"></i>
History</a></li>
+            <li><a href="configuration.html"><i class="fa fa-keyboard-o"></i>
Configuration</a></li>
           </ul>
 
           <ul class="nav navbar-nav navbar-right navbar-user">

http://git-wip-us.apache.org/repos/asf/incubator-flink/blob/4b9c71d3/stratosphere-runtime/resources/web-docs-infoserver/configuration.html
----------------------------------------------------------------------
diff --git a/stratosphere-runtime/resources/web-docs-infoserver/configuration.html b/stratosphere-runtime/resources/web-docs-infoserver/configuration.html
new file mode 100755
index 0000000..9736c02
--- /dev/null
+++ b/stratosphere-runtime/resources/web-docs-infoserver/configuration.html
@@ -0,0 +1,95 @@
+<!DOCTYPE html>
+<html lang="en">
+  <head>
+    <meta charset="utf-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <meta name="description" content="">
+    <meta name="author" content="">
+
+    <title>Dashboard - Stratosphere</title>
+
+    <!-- Bootstrap core CSS -->
+    <link href="css/bootstrap.css" rel="stylesheet">
+
+    <!-- Add custom CSS here -->
+    <link href="css/sb-admin.css" rel="stylesheet">
+    <link rel="stylesheet" href="font-awesome/css/font-awesome.min.css">
+    
+    <!-- Page Specific CSS -->
+    <link rel="stylesheet" type="text/css" href="css/nephelefrontend.css" />
+    
+    <!-- Scripts from Bootstrap -->
+    <script src="js/jquery-1.10.2.js"></script>
+    <script src="js/bootstrap.js"></script>
+    
+    <!-- Scripts from Stratosphere -->
+	<script type="text/javascript" src="js/jquery.flot.min.js"></script>
+	<script type="text/javascript" src="js/helpers.js"></script>
+	<script type="text/javascript" src="js/configuration.js"></script>
+	<script type="text/javascript" src="js/jcanvas.min.js"></script>
+  </head>
+
+  <body>
+
+    <div id="wrapper">
+
+      <!-- Sidebar -->
+      <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
+        <!-- Brand and toggle get grouped for better mobile display -->
+        <div class="navbar-header">
+          <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
+            <span class="sr-only">Toggle navigation</span>
+            <span class="icon-bar"></span>
+            <span class="icon-bar"></span>
+            <span class="icon-bar"></span>
+          </button>
+          <a class="navbar-brand" href="index.html">Stratosphere</a>
+        </div>
+
+        <!-- Collect the nav links, forms, and other content for toggling -->
+        <div class="collapse navbar-collapse navbar-ex1-collapse">
+          <ul class="nav navbar-nav side-nav">
+            <li><a href="index.html"><i class="fa fa-dashboard"></i>
Dashboard</a></li>
+            <li><a href="history.html"><i class="fa fa-bar-chart-o"></i>
History</a></li>
+            <li class="active"><a href="configuration.html"><i class="fa fa-keyboard-o"></i>
Configuration</a></li>
+          </ul>
+
+          <ul class="nav navbar-nav navbar-right navbar-user">
+            <li class="dropdown user-dropdown">
+              <a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="fa
fa-archive"></i> Log Files<b class="caret"></b></a>
+              <ul class="dropdown-menu">
+                <li><a href="logInfo"><i class="fa fa-keyboard-o"></i>
Log Info</a></li>
+                <li><a href="logInfo?get=stdout"><i class="fa fa-keyboard-o"></i>
Stdout</a></li>
+              </ul>
+            </li>
+          </ul>
+        </div><!-- /.navbar-collapse -->
+      </nav>
+
+      <div id="page-wrapper">
+
+        <div class="row">
+          <div class="col-lg-12">
+            <h1>Configuration <small>Overview about the configuration settings
of stratosphere</small></h1>
+            <ol class="breadcrumb">
+              <li><a href="index.html"><i class="icon-dashboard"></i>
Dashboard</a></li>
+              <li class="active"><i class="icon-file-alt"></i> Configuration</li>
+            </ol>
+          </div>
+          <div class="col-lg-12"><h3>Global Configuration</h2></div>
+		  <div class="col-lg-12">
+	          <div class="table-responsive" id="confTable">
+	          
+	          
+	          
+	          
+	          </div>
+	       </div>
+        </div><!-- /.row -->
+
+      </div><!-- /#page-wrapper -->
+
+    </div><!-- /#wrapper -->
+
+  </body>
+</html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-flink/blob/4b9c71d3/stratosphere-runtime/resources/web-docs-infoserver/history.html
----------------------------------------------------------------------
diff --git a/stratosphere-runtime/resources/web-docs-infoserver/history.html b/stratosphere-runtime/resources/web-docs-infoserver/history.html
index 54fe142..ac20a8f 100755
--- a/stratosphere-runtime/resources/web-docs-infoserver/history.html
+++ b/stratosphere-runtime/resources/web-docs-infoserver/history.html
@@ -50,7 +50,8 @@
         <div class="collapse navbar-collapse navbar-ex1-collapse">
           <ul class="nav navbar-nav side-nav">
             <li><a href="index.html"><i class="fa fa-dashboard"></i>
Dashboard</a></li>
-            <li class="active"><a href="history.html"><i class="fa fa-bar-chart-o"></i>
History</a></li>
+            <li class="active"><a href="history.html"><i class="fa fa-bar-chart-o"></i>
History</a></li>
+            <li><a href="configuration.html"><i class="fa fa-keyboard-o"></i>
Configuration</a></li>
           </ul>
 
           <ul class="nav navbar-nav navbar-right navbar-user">
@@ -58,7 +59,7 @@
               <a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="fa
fa-archive"></i> Log Files<b class="caret"></b></a>
               <ul class="dropdown-menu">
                 <li><a href="logInfo"><i class="fa fa-keyboard-o"></i>
Log Info</a></li>
-                <li><a href="logInfo?get=stdout"><i class="fa fa-keyboard-o"></i>
Stdout</a></li>
+                <li><a href="logInfo?get=stdout"><i class="fa fa-keyboard-o"></i>
Stdout</a></li>
               </ul>
             </li>
           </ul>

http://git-wip-us.apache.org/repos/asf/incubator-flink/blob/4b9c71d3/stratosphere-runtime/resources/web-docs-infoserver/index.html
----------------------------------------------------------------------
diff --git a/stratosphere-runtime/resources/web-docs-infoserver/index.html b/stratosphere-runtime/resources/web-docs-infoserver/index.html
index a18fd30..ada1198 100755
--- a/stratosphere-runtime/resources/web-docs-infoserver/index.html
+++ b/stratosphere-runtime/resources/web-docs-infoserver/index.html
@@ -48,7 +48,8 @@
         <div class="collapse navbar-collapse navbar-ex1-collapse">
           <ul class="nav navbar-nav side-nav">
             <li class="active"><a href="index.html"><i class="fa fa-dashboard"></i>
Dashboard</a></li>
-            <li><a href="history.html"><i class="fa fa-bar-chart-o"></i>
History</a></li>
+            <li><a href="history.html"><i class="fa fa-bar-chart-o"></i>
History</a></li>
+            <li><a href="configuration.html"><i class="fa fa-keyboard-o"></i>
Configuration</a></li>
           </ul>
 
           <ul class="nav navbar-nav navbar-right navbar-user">
@@ -56,7 +57,7 @@
               <a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="fa
fa-archive"></i> Log Files<b class="caret"></b></a>
               <ul class="dropdown-menu">
                 <li><a href="logInfo"><i class="fa fa-keyboard-o"></i>
Log Info</a></li>
-                <li><a href="logInfo?get=stdout"><i class="fa fa-keyboard-o"></i>
Stdout</a></li>
+                <li><a href="logInfo?get=stdout"><i class="fa fa-keyboard-o"></i>
Stdout</a></li>
               </ul>
             </li>
           </ul>

http://git-wip-us.apache.org/repos/asf/incubator-flink/blob/4b9c71d3/stratosphere-runtime/resources/web-docs-infoserver/js/configuration.js
----------------------------------------------------------------------
diff --git a/stratosphere-runtime/resources/web-docs-infoserver/js/configuration.js b/stratosphere-runtime/resources/web-docs-infoserver/js/configuration.js
new file mode 100644
index 0000000..2761408
--- /dev/null
+++ b/stratosphere-runtime/resources/web-docs-infoserver/js/configuration.js
@@ -0,0 +1,32 @@
+
+$(document).ready(function() {
+	loadData();
+	
+});
+
+/*
+ * Load all necessary data
+ */
+function loadData() {
+	$.ajax({ url : "configuration", type : "GET", cache: false, success : function(json) {
+		loadConfigTable(json);
+	}, dataType : "json",
+	});
+}
+
+/*
+ * Initializes global config table
+ */
+function loadConfigTable(json) {
+	console.log(json);
+	$("#confTable").empty();
+	var table = "<table class=\"table table-bordered table-hover table-striped\">";
+	table += "<tr><th>Property</th><th>Value</th></tr>";
+	for (var key in json) {
+		if (json.hasOwnProperty(key)) {
+			table += "<tr><td>"+key+"</td><td>"+json[key]+"</td></tr>";
+		}
+	}
+	table += "</table>";
+	$("#confTable").append(table);
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-flink/blob/4b9c71d3/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/jobmanager/web/ConfigurationServlet.java
----------------------------------------------------------------------
diff --git a/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/jobmanager/web/ConfigurationServlet.java
b/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/jobmanager/web/ConfigurationServlet.java
new file mode 100644
index 0000000..d00b9f0
--- /dev/null
+++ b/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/jobmanager/web/ConfigurationServlet.java
@@ -0,0 +1,77 @@
+/***********************************************************************************************************************
+ * Copyright (C) 2010-2013 by the Stratosphere project (http://stratosphere.eu)
+ *
+ * Licensed 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 eu.stratosphere.nephele.jobmanager.web;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Set;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.codehaus.jettison.json.JSONException;
+import org.codehaus.jettison.json.JSONObject;
+
+import eu.stratosphere.configuration.Configuration;
+import eu.stratosphere.configuration.GlobalConfiguration;
+
+/**
+ * A Servlet that displays the Configruation in the webinterface.
+ *
+ */
+public class ConfigurationServlet extends HttpServlet {
+
+	/**
+	 * Serial UID for serialization interoperability.
+	 */
+	private static final long serialVersionUID = 3704963598772630435L;
+	
+	private Configuration globalC;
+
+	
+	public ConfigurationServlet() {
+		globalC = GlobalConfiguration.getConfiguration();
+	}
+	
+	@Override
+	protected void doGet(HttpServletRequest req, HttpServletResponse resp)
+			throws ServletException, IOException {
+		
+		resp.setStatus(HttpServletResponse.SC_OK);
+		resp.setContentType("application/json");
+		
+		Set<String> keys = globalC.keySet();
+		List<String> list = new ArrayList<String>(keys);
+		Collections.sort(list);
+		
+		JSONObject obj = new JSONObject();
+		for (String k : list) {
+			try {
+				obj.put(k, globalC.getString(k, ""));
+			} catch (JSONException e) {
+				e.printStackTrace();
+			}
+		}
+		
+		PrintWriter w = resp.getWriter();
+		w.write(obj.toString());
+
+	}
+	
+}

http://git-wip-us.apache.org/repos/asf/incubator-flink/blob/4b9c71d3/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/jobmanager/web/WebInfoServer.java
----------------------------------------------------------------------
diff --git a/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/jobmanager/web/WebInfoServer.java
b/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/jobmanager/web/WebInfoServer.java
index d3d3250..851d525 100644
--- a/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/jobmanager/web/WebInfoServer.java
+++ b/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/jobmanager/web/WebInfoServer.java
@@ -114,6 +114,7 @@ public class WebInfoServer {
 		servletContext.setContextPath("/");
 		servletContext.addServlet(new ServletHolder(new JobmanagerInfoServlet(jobmanager)), "/jobsInfo");
 		servletContext.addServlet(new ServletHolder(new LogfileInfoServlet(new File(logDirPath))),
"/logInfo");
+		servletContext.addServlet(new ServletHolder(new ConfigurationServlet()), "/configuration");
 
 
 		// ----- the handler serving all the static files -----


Mime
View raw message