From 6092d913b159e6f6b1582782e32368a28840d427 Mon Sep 17 00:00:00 2001 From: Jonathan Hung Date: Thu, 24 Jan 2019 16:45:05 -0800 Subject: [PATCH] YARN-9222. Print launchTime in ApplicationSummary (cherry picked from commit 6cace58e212d3ee0aec988926a5a17c9cc58e645) (cherry picked from commit bf760e7e81f8e02ad413c470fccf78aaa9cb9f86) --- .../apache/hadoop/yarn/server/resourcemanager/RMAppManager.java | 1 + .../hadoop/yarn/server/resourcemanager/TestAppManager.java | 2 ++ 2 files changed, 3 insertions(+) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/RMAppManager.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/RMAppManager.java index c54051efab4..9369eb2e2f0 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/RMAppManager.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/RMAppManager.java @@ -184,6 +184,7 @@ public class RMAppManager implements EventHandler, .add("appMasterHost", host) .add("submitTime", app.getSubmitTime()) .add("startTime", app.getStartTime()) + .add("launchTime", app.getLaunchTime()) .add("finishTime", app.getFinishTime()) .add("finalStatus", app.getFinalApplicationStatus()) .add("memorySeconds", metrics.getMemorySeconds()) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestAppManager.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestAppManager.java index 0fb5cab509c..dcb1e17133a 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestAppManager.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestAppManager.java @@ -997,6 +997,7 @@ public class TestAppManager{ when(app.getState()).thenReturn(RMAppState.RUNNING); when(app.getApplicationType()).thenReturn("MAPREDUCE"); when(app.getSubmitTime()).thenReturn(1000L); + when(app.getLaunchTime()).thenReturn(2000L); Map resourceSecondsMap = new HashMap<>(); resourceSecondsMap.put(ResourceInformation.MEMORY_MB.getName(), 16384L); resourceSecondsMap.put(ResourceInformation.VCORES.getName(), 64L); @@ -1017,6 +1018,7 @@ public class TestAppManager{ assertTrue(msg.contains("Multiline" + escaped +"UserName")); assertTrue(msg.contains("Multiline" + escaped +"QueueName")); assertTrue(msg.contains("submitTime=1000")); + assertTrue(msg.contains("launchTime=2000")); assertTrue(msg.contains("memorySeconds=16384")); assertTrue(msg.contains("vcoreSeconds=64")); assertTrue(msg.contains("preemptedAMContainers=1"));