hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From haiboc...@apache.org
Subject [26/50] [abbrv] hadoop git commit: YARN-7742. [UI2] Duplicated containers are rendered per attempt. (Vasudevan Skm / Sunil G via wangda)
Date Mon, 29 Jan 2018 05:10:44 GMT
YARN-7742. [UI2] Duplicated containers are rendered per attempt. (Vasudevan Skm / Sunil G via
wangda)

Change-Id: Ib2bb3c64d7f09a7c3488f498d0079bcd2e6ac023


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

Branch: refs/heads/YARN-1011
Commit: 8b5b045bd2b5aaf567c289fd34bab4bda216c835
Parents: 75618c0
Author: Wangda Tan <wangda@apache.org>
Authored: Fri Jan 26 15:46:06 2018 +0800
Committer: Wangda Tan <wangda@apache.org>
Committed: Fri Jan 26 15:46:06 2018 +0800

----------------------------------------------------------------------
 .../src/main/webapp/app/components/timeline-view.js |  5 ++++-
 .../app/serializers/yarn-timeline-container.js      | 16 +++++++---------
 .../src/main/webapp/app/utils/date-utils.js         |  2 +-
 3 files changed, 12 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/8b5b045b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/timeline-view.js
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/timeline-view.js
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/timeline-view.js
index 420d793..e23d991 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/timeline-view.js
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/timeline-view.js
@@ -30,6 +30,7 @@ export default Ember.Component.extend({
 
   clusterMetrics: undefined,
   modelArr: [],
+  containerIdArr: [],
   colors: d3.scale.category10().range(),
   _selected: undefined,
   gridColumns: [],
@@ -232,19 +233,21 @@ export default Ember.Component.extend({
     // init tooltip
     this.initTooltip();
     this.modelArr = [];
+    this.containerIdArr = [];
 
     // init model
     if (this.get("rmModel")) {
       this.get("rmModel").forEach(function(o) {
         if(!this.modelArr.contains(o)) {
           this.modelArr.push(o);
+          this.containerIdArr.push(o.id);
         }
       }.bind(this));
     }
 
     if (this.get("tsModel")) {
       this.get("tsModel").forEach(function(o) {
-        if(!this.modelArr.contains(o)) {
+        if(!this.containerIdArr.contains(o.id)) {
           this.modelArr.push(o);
         }
       }.bind(this));

http://git-wip-us.apache.org/repos/asf/hadoop/blob/8b5b045b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-timeline-container.js
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-timeline-container.js
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-timeline-container.js
index f2c60f6..471f910 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-timeline-container.js
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-timeline-container.js
@@ -23,12 +23,10 @@ import Converter from 'yarn-ui/utils/converter';
 export default DS.JSONAPISerializer.extend({
   internalNormalizeSingleResponse(store, primaryModelClass, payload) {
     var payloadEvents = payload.events,
-        createdEvent = payloadEvents.filterBy('id', 'YARN_RM_CONTAINER_CREATED')[0],
+        createdEvent = payloadEvents.filterBy('id', 'YARN_CONTAINER_CREATED')[0],
         startedTime = createdEvent? createdEvent.timestamp : Date.now(),
-        finishedEvent = payloadEvents.filterBy('id', 'YARN_RM_CONTAINER_FINISHED')[0],
-        finishedTime = finishedEvent? finishedEvent.timestamp : Date.now(),
-        containerExitStatus = finishedEvent? finishedEvent.info.YARN_CONTAINER_EXIT_STATUS
: '',
-        containerState = finishedEvent? finishedEvent.info.YARN_CONTAINER_STATE : '';
+        finishedEvent = payloadEvents.filterBy('id', 'YARN_CONTAINER_FINISHED')[0],
+        finishedTime = finishedEvent? finishedEvent.timestamp : Date.now()
 
     var fixedPayload = {
       id: payload.id,
@@ -38,11 +36,11 @@ export default DS.JSONAPISerializer.extend({
         allocatedVCores: payload.info.YARN_CONTAINER_ALLOCATED_VCORE,
         assignedNodeId: payload.info.YARN_CONTAINER_ALLOCATED_HOST,
         priority: payload.info.YARN_CONTAINER_ALLOCATED_PRIORITY,
-        startedTime:  Converter.timeStampToDate(startedTime),
-        finishedTime: Converter.timeStampToDate(finishedTime),
+        startedTime:  Converter.timeStampToDate(payload.createdtime),
+        finishedTime: Converter.timeStampToDate(payload.info.YARN_CONTAINER_FINISHED_TIME),
         nodeHttpAddress: payload.info.YARN_CONTAINER_ALLOCATED_HOST_HTTP_ADDRESS,
-        containerExitStatus: containerExitStatus,
-        containerState: containerState
+        containerExitStatus: payload.info.YARN_CONTAINER_EXIT_STATUS,
+        containerState: payload.info.YARN_CONTAINER_STATE
       }
     };
     return fixedPayload;

http://git-wip-us.apache.org/repos/asf/hadoop/blob/8b5b045b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/utils/date-utils.js
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/utils/date-utils.js
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/utils/date-utils.js
index 83dd200..6a9780c 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/utils/date-utils.js
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/utils/date-utils.js
@@ -24,4 +24,4 @@ const getDefaultTimezone = () => {
 };
 
 export const convertTimestampWithTz = (timestamp, format = "YYYY/MM/DD") =>
-  moment.tz(timestamp, getDefaultTimezone()).format(format);
+  moment.tz(parseInt(timestamp), getDefaultTimezone()).format(format);


---------------------------------------------------------------------
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