From 8aed374182f22c31e886a9a602fb907bbccc4309 Mon Sep 17 00:00:00 2001 From: Varun Saxena Date: Fri, 19 Aug 2016 16:14:16 +0530 Subject: [PATCH] Revert "YARN-5533. JMX AM Used metrics for queue wrong when app submited to nodelabel partition (Bibin A Chundatt via Varun Saxena)" This reverts commit 59557e85a40fb91c7106e8ff3bfe958ffa244b29. --- .../resourcemanager/scheduler/capacity/LeafQueue.java | 3 +-- .../capacity/TestNodeLabelContainerAllocation.java | 9 --------- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/LeafQueue.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/LeafQueue.java index 636762f19a..6bbe85edc8 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/LeafQueue.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/LeafQueue.java @@ -774,8 +774,7 @@ public synchronized void removeApplicationAttempt( application.getAMResource(partitionName)); user.getResourceUsage().decAMUsed(partitionName, application.getAMResource(partitionName)); - metrics.decAMUsed(application.getUser(), - application.getAMResource(partitionName)); + metrics.decAMUsed(application.getUser(), application.getAMResource()); } applicationAttemptMap.remove(application.getApplicationAttemptId()); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestNodeLabelContainerAllocation.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestNodeLabelContainerAllocation.java index 251e4dc5f8..9070577850 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestNodeLabelContainerAllocation.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestNodeLabelContainerAllocation.java @@ -41,7 +41,6 @@ import org.apache.hadoop.yarn.server.resourcemanager.nodelabels.NullRMNodeLabelsManager; import org.apache.hadoop.yarn.server.resourcemanager.nodelabels.RMNodeLabelsManager; import org.apache.hadoop.yarn.server.resourcemanager.rmapp.RMApp; -import org.apache.hadoop.yarn.server.resourcemanager.rmapp.RMAppState; import org.apache.hadoop.yarn.server.resourcemanager.rmapp.attempt.RMAppAttemptState; import org.apache.hadoop.yarn.server.resourcemanager.rmcontainer.RMContainer; import org.apache.hadoop.yarn.server.resourcemanager.rmcontainer.RMContainerState; @@ -1960,14 +1959,6 @@ public RMNodeLabelsManager createNodeLabelManager() { LeafQueue leafQueue = (LeafQueue) cs.getQueue("a"); assertEquals(0 * GB, leafQueue.getMetrics().getAvailableMB()); assertEquals(5 * GB, leafQueue.getMetrics().getAllocatedMB()); - - // Kill all apps in queue a - cs.killAllAppsInQueue("a"); - rm1.waitForState(app1.getApplicationId(), RMAppState.KILLED); - rm1.waitForAppRemovedFromScheduler(app1.getApplicationId()); - - assertEquals(0 * GB, leafQueue.getMetrics().getUsedAMResourceMB()); - assertEquals(0 * GB, leafQueue.getMetrics().getUsedAMResourceVCores()); rm1.close(); }