Ver código fonte

YARN-8803. [UI2] Show flow runs in the order of recently created time in graph widgets. Contributed by Akhil PB.

Sunil G 6 anos atrás
pai
commit
c79f139519

+ 1 - 1
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-flow/runs.js

@@ -165,7 +165,7 @@ export default Ember.Controller.extend({
 
   getSortedVizDataInDesc: function(data) {
     return data.sort(function(d1, d2) {
-      return d2.value - d1.value;
+      return d2.createdTs - d1.createdTs;
     });
   },
 

+ 6 - 3
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-flowrun-brief.js

@@ -46,7 +46,8 @@ export default DS.Model.extend({
       label: this.get('runid'),
       value: this.get('runDurationTs'),
       tooltip: this.get("shownid") + "<br>" + Converter.msToElapsedTimeUnit(this.get('runDurationTs')),
-      flowrunUid: this.get('uid')
+      flowrunUid: this.get('uid'),
+      createdTs: this.get('createTimeRaw')
     };
   },
 
@@ -55,7 +56,8 @@ export default DS.Model.extend({
       label: this.get('runid'),
       value: this.get('cpuVCores'),
       tooltip: this.get("shownid") + "<br>" + 'CPU VCores: ' + this.get('cpuVCores'),
-      flowrunUid: this.get('uid')
+      flowrunUid: this.get('uid'),
+      createdTs: this.get('createTimeRaw')
     };
   },
 
@@ -64,7 +66,8 @@ export default DS.Model.extend({
       label: this.get('runid'),
       value: this.get('memoryUsed'),
       tooltip: this.get("shownid") + "<br>" + 'Memory Used: ' + Converter.memoryBytesToMB(this.get('memoryUsed')),
-      flowrunUid: this.get('uid')
+      flowrunUid: this.get('uid'),
+      createdTs: this.get('createTimeRaw')
     };
   }
 });