This is an automated email from the ASF dual-hosted git repository.

sunilg pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/hadoop.git


The following commit(s) were added to refs/heads/trunk by this push:
     new c726445  YARN-8961. [UI2] Flow Run End Time shows 'Invalid date'. 
Contributed by Akhil PB
c726445 is described below

commit c7264459901e59021e180228cea3a6ae334a339f
Author: Sunil G <[email protected]>
AuthorDate: Thu Jan 24 15:01:43 2019 +0530

    YARN-8961. [UI2] Flow Run End Time shows 'Invalid date'. Contributed by 
Akhil PB
---
 .../src/main/webapp/app/serializers/yarn-flowrun-brief.js     | 11 +++++++++--
 .../src/main/webapp/app/serializers/yarn-flowrun.js           | 11 +++++++++--
 2 files changed, 18 insertions(+), 4 deletions(-)

diff --git 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-flowrun-brief.js
 
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-flowrun-brief.js
index 67603bb..89dc85a 100644
--- 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-flowrun-brief.js
+++ 
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-flowrun-brief.js
@@ -37,9 +37,9 @@ export default DS.JSONAPISerializer.extend({
           runid: payload.info.SYSTEM_INFO_FLOW_RUN_ID,
           shownid: payload.id,
           type: payload.type,
-          createTime: Converter.timeStampToDate(payload.createdtime),
+          createTime: this.checkDateValidity(payload.createdtime),
           createTimeRaw: payload.createdtime,
-          endTime: 
Converter.timeStampToDate(payload.info.SYSTEM_INFO_FLOW_RUN_END_TIME),
+          endTime: 
this.checkDateValidity(payload.info.SYSTEM_INFO_FLOW_RUN_END_TIME),
           endTimeRaw: payload.info.SYSTEM_INFO_FLOW_RUN_END_TIME || 0,
           user: payload.info.SYSTEM_INFO_USER,
           uid: payload.info.UID,
@@ -51,6 +51,13 @@ export default DS.JSONAPISerializer.extend({
       return this._super(store, primaryModelClass, fixedPayload, id, 
requestType);
     },
 
+    checkDateValidity(timestamp) {
+      if (timestamp && timestamp > 0) {
+        return Converter.timeStampToDate(timestamp);
+      }
+      return 'N/A';
+    },
+
     normalizeArrayResponse(store, primaryModelClass, payload, id, requestType) 
{
       var normalizedArrayResponse = {data: []};
 
diff --git 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-flowrun.js
 
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-flowrun.js
index 931d134..97dde35 100644
--- 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-flowrun.js
+++ 
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-flowrun.js
@@ -34,8 +34,8 @@ export default DS.JSONAPISerializer.extend({
           runid: payload.info.SYSTEM_INFO_FLOW_RUN_ID,
           shownid: payload.id,
           type: payload.type,
-          createTime: Converter.timeStampToDate(payload.createdtime),
-          endTime: 
Converter.timeStampToDate(payload.info.SYSTEM_INFO_FLOW_RUN_END_TIME),
+          createTime: this.checkDateValidity(payload.createdtime),
+          endTime: 
this.checkDateValidity(payload.info.SYSTEM_INFO_FLOW_RUN_END_TIME),
           user: payload.info.SYSTEM_INFO_USER,
           metrics: payload.metrics,
         }
@@ -44,6 +44,13 @@ export default DS.JSONAPISerializer.extend({
       return fixedPayload;
     },
 
+    checkDateValidity(timestamp) {
+      if (timestamp && timestamp > 0) {
+        return Converter.timeStampToDate(timestamp);
+      }
+      return 'N/A';
+    },
+
     normalizeSingleResponse(store, primaryModelClass, payload, id/*, 
requestType*/) {
       var p = this.internalNormalizeSingleResponse(store,
         primaryModelClass, payload, id);


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to