From bd8ab9c830eb032561ae14876ab905a46e4b2e32 Mon Sep 17 00:00:00 2001 From: guoxiaolong Date: Fri, 25 Aug 2017 13:22:25 +0800 Subject: [PATCH] [WEB-UI]Add the 'master' column to identify the type of resource management for the spark job, in the history server web ui. --- .../apache/spark/ui/static/historypage-template.html | 6 ++++++ .../org/apache/spark/ui/static/historypage.js | 11 +++++++++++ 2 files changed, 17 insertions(+) diff --git a/core/src/main/resources/org/apache/spark/ui/static/historypage-template.html b/core/src/main/resources/org/apache/spark/ui/static/historypage-template.html index 18d921ab67be8..ffcff56e13a0e 100644 --- a/core/src/main/resources/org/apache/spark/ui/static/historypage-template.html +++ b/core/src/main/resources/org/apache/spark/ui/static/historypage-template.html @@ -29,6 +29,11 @@ App Name + + + Master + + {{#hasMultipleAttempts}} @@ -75,6 +80,7 @@ {{id}} {{name}} {{#attempts}} + {{master}} {{#hasMultipleAttempts}} {{attemptId}} {{/hasMultipleAttempts}} diff --git a/core/src/main/resources/org/apache/spark/ui/static/historypage.js b/core/src/main/resources/org/apache/spark/ui/static/historypage.js index aa7e860372553..5bd65cc40953c 100644 --- a/core/src/main/resources/org/apache/spark/ui/static/historypage.js +++ b/core/src/main/resources/org/apache/spark/ui/static/historypage.js @@ -136,6 +136,16 @@ $(document).ready(function() { (attempt.hasOwnProperty("attemptId") ? attempt["attemptId"] + "/" : "") + "logs"; attempt["durationMillisec"] = attempt["duration"]; attempt["duration"] = formatDuration(attempt["duration"]); + var idStr = id.toString(); + if(idStr.indexOf("application_") > -1) { + attempt["master"] = "yarn"; + } else if(idStr.indexOf("app-") > -1) { + attempt["master"] = "standalone"; + } else if(idStr.indexOf("local-") > -1) { + attempt["master"] = "local"; + } else { + attempt["master"] = "mesos"; + } var app_clone = {"id" : id, "name" : name, "num" : num, "attempts" : [attempt]}; array.push(app_clone); } @@ -163,6 +173,7 @@ $(document).ready(function() { "columns": [ {name: 'appId', type: "appid-numeric"}, {name: 'appName'}, + {name: 'master'}, {name: attemptIdColumnName}, {name: startedColumnName}, {name: completedColumnName},