Bläddra i källkod

AMBARI-1304. When switching jobs in timeline + tasks charts, blank charts show. (Arun Kandregula via yusaku)

git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/trunk@1440767 13f79535-47bb-0310-9956-ffa450edef68
Yusaku Sako 12 år sedan
förälder
incheckning
62cb2ea1d5

+ 3 - 0
CHANGES.txt

@@ -202,6 +202,9 @@ Trunk (unreleased changes):
 
  BUG FIXES
 
+ AMBARI-1304. When switching jobs in timeline + tasks charts, blank charts show.
+ (Arun Kandregula via yusaku) 
+
  AMBARI-1317. Deploy progress returns to deploy screen (momentarily).
  (Arun Kandregula via yusaku) 
 

+ 30 - 0
ambari-web/app/assets/data/apps/jobs/mr_201301280808_0004.json

@@ -1,5 +1,20 @@
 {
   "jobs": [
+    {
+      "jobId": "job_201301280808_0002",
+      "jobName": "oozie:action:T\\=map-reduce:W\\=map-reduce-wf:A\\=mr-node:ID\\=0000000-130128081151371-oozie-oozi-W",
+      "status": "SUCCESS",
+      "userName": "ambari_qa",
+      "submitTime": 1359378922503,
+      "elapsedTime": 27080,
+      "maps": 1,
+      "reduces": 1,
+      "inputBytes": 1550,
+      "outputBytes": 1547,
+      "confPath": "hdfs:\/\/ip-10-83-1-168\\.ec2\\.internal:8020\/user\/ambari_qa\/\\.staging\/job_201301280808_0004\/job\\.xml",
+      "workflowId": "mr_201301280808_0002",
+      "workflowEntityName": "X"
+    },
     {
       "jobId": "job_201301280808_0004",
       "jobName": "oozie:action:T\\=map-reduce:W\\=map-reduce-wf:A\\=mr-node:ID\\=0000000-130128081151371-oozie-oozi-W",
@@ -14,6 +29,21 @@
       "confPath": "hdfs:\/\/ip-10-83-1-168\\.ec2\\.internal:8020\/user\/ambari_qa\/\\.staging\/job_201301280808_0004\/job\\.xml",
       "workflowId": "mr_201301280808_0004",
       "workflowEntityName": "X"
+    },
+    {
+      "jobId": "job_201301280808_0003",
+      "jobName": "oozie:action:T\\=map-reduce:W\\=map-reduce-wf:A\\=mr-node:ID\\=0000000-130128081151371-oozie-oozi-W",
+      "status": "SUCCESS",
+      "userName": "ambari_qa",
+      "submitTime": 1359378922503,
+      "elapsedTime": 27080,
+      "maps": 1,
+      "reduces": 1,
+      "inputBytes": 1550,
+      "outputBytes": 1547,
+      "confPath": "hdfs:\/\/ip-10-83-1-168\\.ec2\\.internal:8020\/user\/ambari_qa\/\\.staging\/job_201301280808_0004\/job\\.xml",
+      "workflowId": "mr_201301280808_0003",
+      "workflowEntityName": "X"
     }
   ]
 }

+ 1 - 1
ambari-web/app/assets/data/apps/runs.json

@@ -59,7 +59,7 @@
       "elapsedTime": 27080,
       "inputBytes": 1550,
       "outputBytes": 1547,
-      "numJobsTotal": 1,
+      "numJobsTotal": 3,
       "numJobsCompleted": 1,
       "workflowContext": {
         "workflowDag": {

+ 13 - 4
ambari-web/app/views/main/apps/item/bar_view.js

@@ -24,9 +24,18 @@ App.MainAppsItemBarView = Em.View.extend({
   templateName:require('templates/main/apps/item/bar'),
   width:300,
   height:210,
-
+  /**
+   * Jobs list. Sorted by job id
+   */
   content:function () {
-    return this.get('controller.content.jobs');
+    return this.get('controller.content.jobs').sort(function(a, b) {
+      var jobIdA = a.get('id').toLowerCase(), jobIdB = b.get('id').toLowerCase();
+      if (jobIdA < jobIdB)
+        return -1;
+      if (jobIdA > jobIdB)
+        return 1;
+      return 0;
+    });
   }.property('controller.content.jobs'),
   firstJob:function () {
     return this.get('content').get('firstObject');
@@ -102,7 +111,7 @@ App.MainAppsItemBarView = Em.View.extend({
     var shuffle = JSON.stringify(this.get('shuffle'));
     var reduce = JSON.stringify(this.get('reduce'));
     if (!this.get('map') || !this.get('shuffle') || !this.get('reduce')) {return;}
-    $('#chart, #legend, #timeline1').html('');
+    $('#chart, #legend, #timeline1, #y-axis').html('');
     graph.drawJobTimeLine(map, shuffle, reduce, this.get('width'), this.get('height'), '#chart', 'legend', 'timeline1');
   }.observes('map', 'shuffle', 'reduce'),
 
@@ -112,7 +121,7 @@ App.MainAppsItemBarView = Em.View.extend({
     var mapOffSwitch = JSON.stringify(this.get('mapOffSwitch'));
     var reduceOffSwitch = JSON.stringify(this.get('reduceOffSwitch'));
     if (!this.get('mapNodeLocal') || !this.get('mapRackLocal') || !this.get('mapOffSwitch') || !this.get('reduceOffSwitch')) {return;}
-    $('#job_tasks, #tasks_legend, #timeline2').html('');
+    $('#job_tasks, #tasks_legend, #timeline2, #y-axis2').html('');
     graph.drawJobTasks(mapNodeLocal, mapRackLocal, mapOffSwitch, reduceOffSwitch, this.get('submit'), this.get('width'), this.get('height'), '#job_tasks', 'tasks_legend', 'timeline2');
   }.observes('mapNodeLocal', 'mapRackLocal', 'mapOffSwitch', 'reduceOffSwitch', 'submit')