hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sun...@apache.org
Subject hadoop git commit: YARN-5650. Render Application Timeout value in web UI. Contributed by Akhil PB.
Date Tue, 20 Dec 2016 05:34:09 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2 e9ce2df1f -> 238863c11


YARN-5650. Render Application Timeout value in web UI. Contributed by Akhil PB.


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

Branch: refs/heads/branch-2
Commit: 238863c11b7481c52cbd09e8b2d1fbcf94592c7a
Parents: e9ce2df
Author: Sunil G <sunilg@apache.org>
Authored: Tue Dec 20 11:03:57 2016 +0530
Committer: Sunil G <sunilg@apache.org>
Committed: Tue Dec 20 11:03:57 2016 +0530

----------------------------------------------------------------------
 .../java/org/apache/hadoop/yarn/server/webapp/AppBlock.java | 9 +++++++++
 .../yarn/server/resourcemanager/webapp/dao/AppInfo.java     | 8 ++++++--
 2 files changed, 15 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/238863c1/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/webapp/AppBlock.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/webapp/AppBlock.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/webapp/AppBlock.java
index 69beef2..349a98c 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/webapp/AppBlock.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/webapp/AppBlock.java
@@ -40,6 +40,7 @@ import org.apache.hadoop.yarn.api.protocolrecords.GetContainerReportRequest;
 import org.apache.hadoop.yarn.api.records.ApplicationAttemptReport;
 import org.apache.hadoop.yarn.api.records.ApplicationId;
 import org.apache.hadoop.yarn.api.records.ApplicationReport;
+import org.apache.hadoop.yarn.api.records.ApplicationTimeoutType;
 import org.apache.hadoop.yarn.api.records.ContainerReport;
 import org.apache.hadoop.yarn.api.records.FinalApplicationStatus;
 import org.apache.hadoop.yarn.api.records.LogAggregationStatus;
@@ -207,6 +208,14 @@ public class AppBlock extends HtmlBlock {
         overviewTable._("Log Aggregation Status:",
             root_url("logaggregationstatus", app.getAppId()), status.name());
       }
+      long timeout = appReport.getApplicationTimeouts()
+          .get(ApplicationTimeoutType.LIFETIME).getRemainingTime();
+      if (timeout < 0) {
+        overviewTable._("Application Timeout (Remaining Time):", "Unlimited");
+      } else {
+        overviewTable._("Application Timeout (Remaining Time):",
+            String.format("%d seconds", timeout));
+      }
     }
     overviewTable._("Diagnostics:",
         app.getDiagnosticsInfo() == null ? "" : app.getDiagnosticsInfo());

http://git-wip-us.apache.org/repos/asf/hadoop/blob/238863c1/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/dao/AppInfo.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/dao/AppInfo.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/dao/AppInfo.java
index 2d364f4..4e85b67 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/dao/AppInfo.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/dao/AppInfo.java
@@ -259,8 +259,12 @@ public class AppInfo {
           timeout.setTimeoutType(entry.getKey());
           long timeoutInMillis = entry.getValue().longValue();
           timeout.setExpiryTime(Times.formatISO8601(timeoutInMillis));
-          timeout.setRemainingTime(Math
-              .max((timeoutInMillis - System.currentTimeMillis()) / 1000, 0));
+          if (app.isAppInCompletedStates()) {
+            timeout.setRemainingTime(0);
+          } else {
+            timeout.setRemainingTime(Math
+                .max((timeoutInMillis - System.currentTimeMillis()) / 1000, 0));
+          }
           timeouts.add(timeout);
         }
       }


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