You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ak...@apache.org on 2014/05/05 18:31:14 UTC

git commit: AMBARI-5668. JobsDiagnostic|2.1.1: No job status and end time is shown for interrupted job. (akovalenko)

Repository: ambari
Updated Branches:
  refs/heads/trunk d361930fa -> c2d8a9a85


AMBARI-5668. JobsDiagnostic|2.1.1: No job status and end time is shown for interrupted job. (akovalenko)


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

Branch: refs/heads/trunk
Commit: c2d8a9a856e62837c3ce9d44a74a326e7bd4123a
Parents: d361930
Author: Aleksandr Kovalenko <ak...@hortonworks.com>
Authored: Mon May 5 19:27:38 2014 +0300
Committer: Aleksandr Kovalenko <ak...@hortonworks.com>
Committed: Mon May 5 19:27:38 2014 +0300

----------------------------------------------------------------------
 ambari-web/app/mappers/jobs/hive_job_mapper.js    | 12 +++++++++++-
 ambari-web/app/messages.js                        |  1 +
 ambari-web/app/models/jobs/tez_dag.js             |  3 ++-
 ambari-web/app/utils/jobs.js                      | 18 +++++++++++++++---
 .../main/jobs/hive_job_details_tez_dag_view.js    |  9 ++++++++-
 5 files changed, 37 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/c2d8a9a8/ambari-web/app/mappers/jobs/hive_job_mapper.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mappers/jobs/hive_job_mapper.js b/ambari-web/app/mappers/jobs/hive_job_mapper.js
index 5bb2f05..3026d08 100644
--- a/ambari-web/app/mappers/jobs/hive_job_mapper.js
+++ b/ambari-web/app/mappers/jobs/hive_job_mapper.js
@@ -47,7 +47,17 @@ App.hiveJobMapper = App.QuickDataMapper.create({
       hiveJob.id = json.entity;
       hiveJob.name = hiveJob.id;
       hiveJob.startTime = json.starttime;
-      hiveJob.endTime = json.endtime;
+      if (json.endtime == undefined) {
+        var i = 0;
+        while (hiveJob.endTime == undefined && json.events[i]) {
+          if (json.events[i].eventtype == 'QUERY_COMPLETED') {
+            hiveJob.endTime = json.events[i].timestamp;
+          };
+          i++;
+        };
+      } else {
+        hiveJob.endTime = json.endtime;
+      };
       json.otherinfo.query = $.parseJSON(json.otherinfo.query);
       if (json.otherinfo.query && json.otherinfo.query.queryText) {
         hiveJob.query_text = json.otherinfo.query.queryText;

http://git-wip-us.apache.org/repos/asf/ambari/blob/c2d8a9a8/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index b8d5ffe..13270a9 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -1998,6 +1998,7 @@ Em.I18n.translations = {
   'jobs.customDateFilter.error.date.order':'End Date must be after Start Date',
   'jobs.customDateFilter.startTime':'Start Time',
   'jobs.customDateFilter.endTime':'End Time',
+  'jobs.hive.failed':'JOB FAILED',
   'jobs.hive.more':'show more',
   'jobs.hive.less':'show less',
   'jobs.hive.query':'Hive Query',

http://git-wip-us.apache.org/repos/asf/ambari/blob/c2d8a9a8/ambari-web/app/models/jobs/tez_dag.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/jobs/tez_dag.js b/ambari-web/app/models/jobs/tez_dag.js
index cc11b49..461c227 100644
--- a/ambari-web/app/models/jobs/tez_dag.js
+++ b/ambari-web/app/models/jobs/tez_dag.js
@@ -168,7 +168,8 @@ App.TezDagVertexState = {
   FAILED : "FAILED",
   KILLED : "KILLED",
   ERROR : "ERROR",
-  TERMINATING : "TERMINATING"
+  TERMINATING : "TERMINATING",
+  JOBFAILED: "JOB FAILED"
 };
 
 App.TezDagVertexType = {

http://git-wip-us.apache.org/repos/asf/ambari/blob/c2d8a9a8/ambari-web/app/utils/jobs.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/jobs.js b/ambari-web/app/utils/jobs.js
index 3ae9e43..ca1c379 100644
--- a/ambari-web/app/utils/jobs.js
+++ b/ambari-web/app/utils/jobs.js
@@ -59,7 +59,7 @@ module.exports = {
     var hiveJobId = hiveJob.get('id');
     // First refresh query
     var hiveQueriesUrl = App.testMode ? "/data/jobs/hive-query-2.json" : "/proxy?url=http://" + historyServerHostName
-        + ":" + ahsWebPort + "/ws/v1/timeline/HIVE_QUERY_ID/" + hiveJob.get('id') + "?fields=otherinfo";
+        + ":" + ahsWebPort + "/ws/v1/timeline/HIVE_QUERY_ID/" + hiveJob.get('id') + "?fields=events,otherinfo";
     App.HttpClient.get(hiveQueriesUrl, App.hiveJobMapper, {
       complete : function(jqXHR, textStatus) {
         // Now get the Tez DAG ID from the DAG name
@@ -177,15 +177,27 @@ module.exports = {
     var yarnService = App.YARNService.find().objectAt(0);
     var ahsWebPort = yarnService.get('ahsWebPort');
     var historyServerHostName = yarnService.get('appTimelineServerNode.hostName');
+    var tezDag = App.TezDag.find(tezDagId);
+    var hiveJob = App.HiveJob.find().findProperty('tezDag', tezDag);
+    var hiveJobFailed = hiveJob.get('failed');
+    var hiveJobEndTime = hiveJob.get('endTime');
     var sender = {
       loadTezDagVertexSuccess : function(data) {
         if (data && data.otherinfo) {
           var vertexRecord = App.TezDagVertex.find(tezDagId + "/" + data.otherinfo.vertexName);
           if (vertexRecord != null) {
             vertexRecord.set('startTime', data.otherinfo.startTime);
-            vertexRecord.set('endTime', data.otherinfo.endTime);
+            if (data.otherinfo.endTime == undefined && hiveJobFailed) {
+              vertexRecord.set('endTime', hiveJobEndTime);
+            } else {
+              vertexRecord.set('endTime', data.otherinfo.endTime);
+            };
             vertexRecord.set('tasksCount', data.otherinfo.numTasks);
-            vertexRecord.set('state', data.otherinfo.status);
+            if (data.otherinfo.status == null && hiveJobFailed) {
+              vertexRecord.set('state', Em.I18n.t('jobs.hive.failed'));
+            } else {
+              vertexRecord.set('state', data.otherinfo.status);
+            };
             if (data.otherinfo.counters && data.otherinfo.counters.counterGroups) {
               data.otherinfo.counters.counterGroups.forEach(function(cGroup) {
                 var cNameToPropetyMap = {};

http://git-wip-us.apache.org/repos/asf/ambari/blob/c2d8a9a8/ambari-web/app/views/main/jobs/hive_job_details_tez_dag_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/jobs/hive_job_details_tez_dag_view.js b/ambari-web/app/views/main/jobs/hive_job_details_tez_dag_view.js
index 9d18559..be61ca1 100644
--- a/ambari-web/app/views/main/jobs/hive_job_details_tez_dag_view.js
+++ b/ambari-web/app/views/main/jobs/hive_job_details_tez_dag_view.js
@@ -868,8 +868,12 @@ App.MainHiveJobDetailsTezDagView = Em.View.extend({
       }).attr('class', function(n) {
         var classes = 'vertex-icon-text ';
         if (n.state != null) {
+          if (n.state == App.TezDagVertexState.JOBFAILED) {
+            classes += App.TezDagVertexState.FAILED.toLowerCase();
+          } else {
           classes += n.state.toLowerCase();
-        }
+          };
+        };
         return classes;
       });
     }
@@ -896,6 +900,9 @@ App.MainHiveJobDetailsTezDagView = Em.View.extend({
     case App.TezDagVertexState.TERMINATING:
       icon = '\uF141'; //icon-ellipsis-horizontal
       break;
+    case App.TezDagVertexState.JOBFAILED:
+      icon = '\uF05C'; //icon-remove-circle
+      break;
     }
     return icon;
   },