From a761bf8726cb6285a505f1773ea3403eb985a65f Mon Sep 17 00:00:00 2001 From: Jason Lowe Date: Tue, 3 Feb 2015 14:56:34 +0000 Subject: [PATCH] YARN-3085. Application summary should include the application type. Contributed by Rohith --- hadoop-yarn-project/CHANGES.txt | 3 +++ .../hadoop/yarn/server/resourcemanager/RMAppManager.java | 3 ++- .../hadoop/yarn/server/resourcemanager/TestAppManager.java | 3 ++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/hadoop-yarn-project/CHANGES.txt b/hadoop-yarn-project/CHANGES.txt index 5630908b6b..3ece974ea5 100644 --- a/hadoop-yarn-project/CHANGES.txt +++ b/hadoop-yarn-project/CHANGES.txt @@ -225,6 +225,9 @@ Release 2.7.0 - UNRELEASED YARN-2808. Made YARN CLI list attempt’s finished containers of a running application. (Naganarasimha G R via zjshen) + YARN-3085. Application summary should include the application type (Rohith + via jlowe) + OPTIMIZATIONS BUG FIXES 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 f38e128cfe..8dcfe67996 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 @@ -172,7 +172,8 @@ public static SummaryBuilder createAppSummary(RMApp app) { .add("vcoreSeconds", metrics.getVcoreSeconds()) .add("preemptedAMContainers", metrics.getNumAMContainersPreempted()) .add("preemptedNonAMContainers", metrics.getNumNonAMContainersPreempted()) - .add("preemptedResources", metrics.getResourcePreempted()); + .add("preemptedResources", metrics.getResourcePreempted()) + .add("applicationType", app.getApplicationType()); return summary; } 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 6b3eea20ff..d2ac4efb95 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 @@ -572,7 +572,7 @@ public void testEscapeApplicationSummary() { when(app.getUser()).thenReturn("Multiline\n\n\r\rUserName"); when(app.getQueue()).thenReturn("Multiline\n\n\r\rQueueName"); when(app.getState()).thenReturn(RMAppState.RUNNING); - + when(app.getApplicationType()).thenReturn("MAPREDUCE"); RMAppMetrics metrics = new RMAppMetrics(Resource.newInstance(1234, 56), 10, 1, 16384, 64); when(app.getRMAppMetrics()).thenReturn(metrics); @@ -593,6 +593,7 @@ public void testEscapeApplicationSummary() { Assert.assertTrue(msg.contains("preemptedAMContainers=1")); Assert.assertTrue(msg.contains("preemptedNonAMContainers=10")); Assert.assertTrue(msg.contains("preemptedResources=")); + Assert.assertTrue(msg.contains("applicationType=MAPREDUCE")); } private static ResourceScheduler mockResourceScheduler() {