Prechádzať zdrojové kódy

AMBARI-5064. Model ATS host name into App.YARNService class (alexantonenko)

Alex Antonenko 11 rokov pred
rodič
commit
244aa3ff0a

+ 1 - 1
ambari-web/app/controllers/main/jobs_controller.js

@@ -249,7 +249,7 @@ App.MainJobsController = Em.ArrayController.extend({
     var yarnService = App.YARNService.find().objectAt(0);
     if (yarnService != null) {
       this.set('loading', true);
-      var historyServerHostName = yarnService.get('resourceManagerNode.hostName');
+      var historyServerHostName = yarnService.get('appTimelineServerNode.hostName');
       var filtersLink = this.get('filterObject').createJobsFiltersLink();
       var hiveQueriesUrl = App.testMode ? "/data/jobs/hive-queries.json" : "/proxy?url=http://" + historyServerHostName
           + ":" + yarnService.get('ahsWebPort') + "/ws/v1/timeline/HIVE_QUERY_ID" + filtersLink;

+ 3 - 0
ambari-web/app/models/service/yarn.js

@@ -21,6 +21,9 @@ var objectUtils = require('utils/object_utils');
 App.YARNService = App.Service.extend({
   version: DS.attr('string'),
   resourceManagerNode: DS.belongsTo('App.Host'),
+  appTimelineServerNode: function() {
+    return this.get('hostComponents').filterProperty('componentName', 'APP_TIMELINE_SERVER').mapProperty('host').objectAt(0);
+  }.property(),
   nodeManagerNodes: function () {
     return this.get('hostComponents').filterProperty('componentName', 'NODEMANAGER');
   }.property('hostComponents.@each'),

+ 3 - 3
ambari-web/app/utils/jobs.js

@@ -54,7 +54,7 @@ module.exports = {
     var self = this;
     // TODO - to be changed to history server when implemented in stack.
     var yarnService = App.YARNService.find().objectAt(0);
-    var historyServerHostName = yarnService.get('resourceManagerNode.hostName');
+    var historyServerHostName = yarnService.get('appTimelineServerNode.hostName');
     var ahsWebPort = yarnService.get('ahsWebPort');
     var hiveJobId = hiveJob.get('id');
     // First refresh query
@@ -117,7 +117,7 @@ module.exports = {
     var self = this;
     var yarnService = App.YARNService.find().objectAt(0);
     var ahsWebPort = yarnService.get('ahsWebPort');
-    var historyServerHostName = yarnService.get('resourceManagerNode.hostName');
+    var historyServerHostName = yarnService.get('appTimelineServerNode.hostName');
     var tezDag = App.TezDag.find(tezDagId);
     if (tezDag) {
       var tezDagInstanceId = tezDag.get('instanceId');
@@ -171,7 +171,7 @@ module.exports = {
   refreshTezDagVertex : function(tezDagId, tezVertexInstanceId, successCallback) {
     var yarnService = App.YARNService.find().objectAt(0);
     var ahsWebPort = yarnService.get('ahsWebPort');
-    var historyServerHostName = yarnService.get('resourceManagerNode.hostName');
+    var historyServerHostName = yarnService.get('appTimelineServerNode.hostName');
     var sender = {
       loadTezDagVertexSuccess : function(data) {
         if (data && data.otherinfo) {