hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aengin...@apache.org
Subject [22/50] [abbrv] hadoop git commit: YARN-7753. [UI2] Application logs has to be pulled from ATS 1.5 instead of ATS2. Contributed by Sunil G.
Date Wed, 24 Jan 2018 22:35:51 GMT
YARN-7753. [UI2] Application logs has to be pulled from ATS 1.5 instead of ATS2. Contributed
by Sunil G.


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

Branch: refs/heads/HDFS-7240
Commit: c5bbd6418ed1a7b78bf5bd6c1e0fad1dc9fab300
Parents: 9e4f52d
Author: Rohith Sharma K S <rohithsharmaks@apache.org>
Authored: Fri Jan 19 15:48:16 2018 +0530
Committer: Rohith Sharma K S <rohithsharmaks@apache.org>
Committed: Fri Jan 19 15:48:16 2018 +0530

----------------------------------------------------------------------
 .../src/main/webapp/app/adapters/yarn-log.js    |  2 +-
 .../src/main/webapp/app/initializers/loader.js  | 41 +++++++++++++++++++-
 .../src/main/webapp/app/serializers/yarn-log.js |  6 +++
 .../src/main/webapp/app/services/hosts.js       |  4 ++
 .../src/main/webapp/config/default-config.js    |  1 +
 5 files changed, 52 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/c5bbd641/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/yarn-log.js
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/yarn-log.js
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/yarn-log.js
index df29b71..979ec79 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/yarn-log.js
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/yarn-log.js
@@ -19,7 +19,7 @@
 import AbstractAdapter from './abstract';
 
 export default AbstractAdapter.extend({
-  address: "timelineWebAddress",
+  address: "timelineV1WebAddress",
   // restNameSpace: "timelineV2", // Use ATSv2 when it supports log APIs.
   restNameSpace: "timeline", //Using ATSv1.5 now, would be supported by ATSv2 very soon.
   serverName: "ATS",

http://git-wip-us.apache.org/repos/asf/hadoop/blob/c5bbd641/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/initializers/loader.js
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/initializers/loader.js
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/initializers/loader.js
index 9d63de3..58c6354 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/initializers/loader.js
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/initializers/loader.js
@@ -25,7 +25,16 @@ function getTimeLineURL(rmhost) {
     (ENV.hosts.localBaseAddress? ENV.hosts.localBaseAddress + '/' : '') + rmhost;
 
   url += '/conf?name=yarn.timeline-service.reader.webapp.address';
-  Ember.Logger.log("Get Timeline Address URL: " + url);
+  Ember.Logger.log("Get Timeline V2 Address URL: " + url);
+  return url;
+}
+
+function getTimeLineV1URL(rmhost) {
+  var url = window.location.protocol + '//' +
+    (ENV.hosts.localBaseAddress? ENV.hosts.localBaseAddress + '/' : '') + rmhost;
+
+  url += '/conf?name=yarn.timeline-service.webapp.address';
+  Ember.Logger.log("Get Timeline V1 Address URL: " + url);
   return url;
 }
 
@@ -70,6 +79,36 @@ function updateConfigs(application) {
     Ember.Logger.log("Timeline Address: " + ENV.hosts.timelineWebAddress);
     application.advanceReadiness();
   }
+
+  if(!ENV.hosts.timelineV1WebAddress) {
+    var timelinehost = "";
+    $.ajax({
+      type: 'GET',
+      dataType: 'json',
+      async: true,
+      context: this,
+      url: getTimeLineV1URL(rmhost),
+      success: function(data) {
+        timelinehost = data.property.value;
+        ENV.hosts.timelineV1WebAddress = timelinehost;
+
+        var address = timelinehost.split(":")[0];
+        var port = timelinehost.split(":")[1];
+
+        Ember.Logger.log("Timeline V1 Address from RM: " + timelinehost);
+
+        if(address === "0.0.0.0" || address === "localhost") {
+          var updatedAddress =  hostname + ":" + port;
+          ENV.hosts.timelineV1WebAddress = updatedAddress;
+          Ember.Logger.log("Timeline V1 Updated Address: " + updatedAddress);
+        }
+        application.advanceReadiness();
+      }
+    });
+  } else {
+    Ember.Logger.log("Timeline V1 Address: " + ENV.hosts.timelineV1WebAddress);
+    application.advanceReadiness();
+  }
 }
 
 export function initialize( application ) {

http://git-wip-us.apache.org/repos/asf/hadoop/blob/c5bbd641/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-log.js
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-log.js
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-log.js
index 93174d0..c411708 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-log.js
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-log.js
@@ -43,6 +43,12 @@ export default DS.JSONAPISerializer.extend({
           payload.containerLogsInfo.containerId, payload.containerLogsInfo.nodeId);
       });
     }
+    if (payload && payload[0] && payload[0].containerLogInfo) {
+      normalizedArrayResponse.data = payload[0].containerLogInfo.map((paylog) => {
+        return this.internalNormalizeSingleResponse(store, primaryModelClass, paylog,
+          payload[0].containerId, payload[0].nodeId);
+      });
+    }
     return normalizedArrayResponse;
   }
 });

http://git-wip-us.apache.org/repos/asf/hadoop/blob/c5bbd641/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/services/hosts.js
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/services/hosts.js
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/services/hosts.js
index 9359530..738f5f1 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/services/hosts.js
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/services/hosts.js
@@ -72,6 +72,10 @@ export default Ember.Service.extend({
     return this.normalizeURL(this.get("env.app.hosts.timelineWebAddress"));
   }),
 
+  timelineV1WebAddress: Ember.computed(function () {
+    return this.normalizeURL(this.get("env.app.hosts.timelineV1WebAddress"));
+  }),
+
   rmWebAddress: Ember.computed(function () {
     return this.normalizeURL(this.get("env.app.hosts.rmWebAddress"));
   }),

http://git-wip-us.apache.org/repos/asf/hadoop/blob/c5bbd641/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/config/default-config.js
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/config/default-config.js
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/config/default-config.js
index 792f442..e916361 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/config/default-config.js
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/config/default-config.js
@@ -20,6 +20,7 @@ module.exports = { // YARN UI App configurations
     hosts: {
       localBaseAddress: "",
       timelineWebAddress: "localhost:8188",
+      timelineV1WebAddress: "localhost:8188",
       rmWebAddress: "localhost:8088",
       protocolScheme: "http:"
     },


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message