ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alexantone...@apache.org
Subject git commit: AMBARI-4703. Jobs API calls use hardcoded ATS port value (Denys Buzhor via alexantonenko)
Date Mon, 17 Feb 2014 17:19:30 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 88c2472e5 -> a593a644c


AMBARI-4703. Jobs API calls use hardcoded ATS port value (Denys Buzhor via alexantonenko)


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

Branch: refs/heads/trunk
Commit: a593a644cb502972e5843ba7491c2a54017df0bf
Parents: 88c2472
Author: Alex Antonenko <hiveww@gmail.com>
Authored: Mon Feb 17 19:18:55 2014 +0200
Committer: Alex Antonenko <hiveww@gmail.com>
Committed: Mon Feb 17 19:19:25 2014 +0200

----------------------------------------------------------------------
 ambari-web/app/app.js                           |  4 ++--
 .../global/configuration_controller.js          |  4 ++--
 .../app/controllers/main/jobs_controller.js     |  2 +-
 ambari-web/app/models/service/yarn.js           |  4 ++++
 ambari-web/app/utils/ajax.js                    |  6 ++---
 ambari-web/app/utils/jobs.js                    | 23 ++++++++++++++------
 6 files changed, 28 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/a593a644/ambari-web/app/app.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/app.js b/ambari-web/app/app.js
index 34e979d..c2ac0fa 100644
--- a/ambari-web/app/app.js
+++ b/ambari-web/app/app.js
@@ -177,8 +177,8 @@ module.exports = Em.Application.create({
    * remove/restore related data.
    */
   handleStackDependedComponents: function() {
-    // need for unit testing
-    if (this.get('handleStackDependencyTest')) return;
+    // need for unit testing and test mode
+    if (this.get('handleStackDependencyTest') || this.testMode) return;
     var stackVersion, stackDependedComponents;
     stackVersion = this.get('currentStackVersionNumber');
     stackDependedComponents = [];

http://git-wip-us.apache.org/repos/asf/ambari/blob/a593a644/ambari-web/app/controllers/global/configuration_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/global/configuration_controller.js b/ambari-web/app/controllers/global/configuration_controller.js
index a3ec061..a0c2db3 100644
--- a/ambari-web/app/controllers/global/configuration_controller.js
+++ b/ambari-web/app/controllers/global/configuration_controller.js
@@ -73,8 +73,8 @@ App.ConfigurationController = Em.Controller.extend({
       // Access the Local storage App.db.data.app.configs object only if its defined
       var storedSite = !!storedConfigs && storedConfigs.findProperty('type', loadedSite.type);
       if (storedSite) {
-        storedConfigs.tag = loadedSite.tag;
-        storedConfigs.properties = loadedSite.properties;
+        storedConfigs.findProperty('type', storedSite.type).tag = loadedSite.tag;
+        storedConfigs.findProperty('type', storedSite.type).properties = loadedSite.properties;
       } else {
         // Initialize storedConfigs object if it's undefined
         if (storedConfigs === undefined) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/a593a644/ambari-web/app/controllers/main/jobs_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/jobs_controller.js b/ambari-web/app/controllers/main/jobs_controller.js
index c97b06b..d4b607b 100644
--- a/ambari-web/app/controllers/main/jobs_controller.js
+++ b/ambari-web/app/controllers/main/jobs_controller.js
@@ -243,7 +243,7 @@ App.MainJobsController = Em.ArrayController.extend({
       var historyServerHostName = yarnService.get('resourceManagerNode.hostName');
       var filtersLink = this.get('filterObject').createJobsFiltersLink();
       var hiveQueriesUrl = App.testMode ? "/data/jobs/hive-queries.json" : "/proxy?url=http://"
+ historyServerHostName
-          + ":8188/ws/v1/apptimeline/HIVE_QUERY_ID" + filtersLink;
+          + ":" + yarnService.get('ahsWebPort') + "/ws/v1/apptimeline/HIVE_QUERY_ID" + filtersLink;
       App.HttpClient.get(hiveQueriesUrl, App.hiveJobsMapper, {
         complete : function(jqXHR, textStatus) {
           self.set('loading', false);

http://git-wip-us.apache.org/repos/asf/ambari/blob/a593a644/ambari-web/app/models/service/yarn.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/service/yarn.js b/ambari-web/app/models/service/yarn.js
index 6e688a7..c5bfb3b 100644
--- a/ambari-web/app/models/service/yarn.js
+++ b/ambari-web/app/models/service/yarn.js
@@ -37,6 +37,10 @@ App.YARNService = App.Service.extend({
   appsCompleted: DS.attr('number'),
   appsKilled: DS.attr('number'),
   appsFailed: DS.attr('number'),
+  ahsWebPort: function() {
+    return App.db.getConfigs().findProperty('type', 'yarn-site').properties['yarn.ahs.webapp.address']
+      .match(/:(\d+)/)[1];
+  }.property(),
   yarnClientNodes: function(){
     return this.get('hostComponents').filterProperty('componentName', 'YARN_CLIENT').mapProperty('host');
   }.property('hostComponents.length'),

http://git-wip-us.apache.org/repos/asf/ambari/blob/a593a644/ambari-web/app/utils/ajax.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/ajax.js b/ambari-web/app/utils/ajax.js
index f520189..0823b9b 100644
--- a/ambari-web/app/utils/ajax.js
+++ b/ambari-web/app/utils/ajax.js
@@ -1605,17 +1605,17 @@ var urls = {
   },
 
   'jobs.tezDag.NametoID': {
-    'real': '/proxy?url=http://{historyServerHostName}:8188/ws/v1/apptimeline/TEZ_DAG_ID?primaryFilter=dagName:{tezDagName}',
+    'real': '/proxy?url=http://{historyServerHostName}:{ahsWebPort}/ws/v1/apptimeline/TEZ_DAG_ID?primaryFilter=dagName:{tezDagName}',
     'mock': '/data/jobs/tezDag-name-to-id.json',
     'apiPrefix': ''
   },
   'jobs.tezDag.tezDagId': {
-    'real': '/proxy?url=http://{historyServerHostName}:8188/ws/v1/apptimeline/TEZ_DAG_ID/{tezDagId}?fields=relatedentities',
+    'real': '/proxy?url=http://{historyServerHostName}:{ahsWebPort}/ws/v1/apptimeline/TEZ_DAG_ID/{tezDagId}?fields=relatedentities',
     'mock': '/data/jobs/tezDag.json',
     'apiPrefix': ''
   },
   'jobs.tezDag.tezDagVertexId': {
-    'real': '/proxy?url=http://{historyServerHostName}:8188/ws/v1/apptimeline/TEZ_VERTEX_ID/{tezDagVertexId}?fields=otherinfo',
+    'real': '/proxy?url=http://{historyServerHostName}:{ahsWebPort}/ws/v1/apptimeline/TEZ_VERTEX_ID/{tezDagVertexId}?fields=otherinfo',
     'mock': '/data/jobs/tezDagVertex.json',
     'apiPrefix': ''
   }

http://git-wip-us.apache.org/repos/asf/ambari/blob/a593a644/ambari-web/app/utils/jobs.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/jobs.js b/ambari-web/app/utils/jobs.js
index 7615aa7..a227cc7 100644
--- a/ambari-web/app/utils/jobs.js
+++ b/ambari-web/app/utils/jobs.js
@@ -49,11 +49,13 @@ module.exports = {
   refreshHiveJobDetails : function(hiveJob, successCallback) {
     var self = this;
     // TODO - to be changed to history server when implemented in stack.
-    var historyServerHostName = App.YARNService.find().objectAt(0).get('resourceManagerNode.hostName')
+    var yarnService = App.YARNService.find().objectAt(0);
+    var historyServerHostName = yarnService.get('resourceManagerNode.hostName');
+    var ahsWebPort = yarnService.get('ahsWebPort');
     var hiveJobId = hiveJob.get('id');
     // First refresh query
     var hiveQueriesUrl = App.testMode ? "/data/jobs/hive-query-2.json" : "/proxy?url=http://"
+ historyServerHostName
-        + ":8188/ws/v1/apptimeline/HIVE_QUERY_ID/" + hiveJob.get('id') + "?fields=otherinfo";
+        + ":" + ahsWebPort + "/ws/v1/apptimeline/HIVE_QUERY_ID/" + hiveJob.get('id') + "?fields=otherinfo";
     App.HttpClient.get(hiveQueriesUrl, App.hiveJobMapper, {
       complete : function(jqXHR, textStatus) {
         // Now get the Tez DAG ID from the DAG name
@@ -79,7 +81,8 @@ module.exports = {
             sender : sender,
             data : {
               historyServerHostName : historyServerHostName,
-              tezDagName : tezDagName
+              tezDagName : tezDagName,
+              ahsWebPort: ahsWebPort
             },
             success : 'dagNameToIdSuccess',
             error : 'dagNameToIdError'
@@ -102,7 +105,9 @@ module.exports = {
    */
   refreshTezDagDetails : function(tezDagId, successCallback) {
     var self = this;
-    var historyServerHostName = App.YARNService.find().objectAt(0).get('resourceManagerNode.hostName');
+    var yarnService = App.YARNService.find().objectAt(0);
+    var ahsWebPort = yarnService.get('ahsWebPort');
+    var historyServerHostName = yarnService.get('resourceManagerNode.hostName');
     var tezDag = App.TezDag.find(tezDagId);
     if (tezDag) {
       var tezDagInstanceId = tezDag.get('instanceId');
@@ -129,7 +134,8 @@ module.exports = {
         sender : sender,
         data : {
           historyServerHostName : historyServerHostName,
-          tezDagId : tezDagInstanceId
+          tezDagId : tezDagInstanceId,
+          ahsWebPort: ahsWebPort
         },
         success : 'loadTezDagSuccess',
         error : 'loadTezDagError'
@@ -151,7 +157,9 @@ module.exports = {
    *          successCallback
    */
   refreshTezDagVertex : function(tezDagId, tezVertexInstanceId, successCallback) {
-    var historyServerHostName = App.YARNService.find().objectAt(0).get('resourceManagerNode.hostName');
+    var yarnService = App.YARNService.find().objectAt(0);
+    var ahsWebPort = yarnService.get('ahsWebPort');
+    var historyServerHostName = yarnService.get('resourceManagerNode.hostName');
     var sender = {
       loadTezDagVertexSuccess : function(data) {
         if (data && data.otherinfo) {
@@ -185,7 +193,8 @@ module.exports = {
       sender : sender,
       data : {
         historyServerHostName : historyServerHostName,
-        tezDagVertexId : tezVertexInstanceId
+        tezDagVertexId : tezVertexInstanceId,
+        ahsWebPort: ahsWebPort
       },
       success : 'loadTezDagVertexSuccess',
       error : 'loadTezDagVertexError'


Mime
View raw message