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 420d793002..e23d9918aa 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)); 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 f2c60f608d..471f9105e9 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; 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 83dd200143..6a9780c18c 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);