From c1b0106711c58226ff082f4c31eca669d7bd3319 Mon Sep 17 00:00:00 2001 From: Bikas Saha Date: Sat, 13 Jul 2013 22:42:47 +0000 Subject: [PATCH] Merge r1502906 from trunk to branch-2 for YARN-541. getAllocatedContainers() is not returning all the allocated containers (bikas) git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1502907 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-yarn-project/CHANGES.txt | 3 +++ .../hadoop/yarn/client/api/impl/AMRMClientImpl.java | 9 ++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/hadoop-yarn-project/CHANGES.txt b/hadoop-yarn-project/CHANGES.txt index edc0eb4d896..62323012a8f 100644 --- a/hadoop-yarn-project/CHANGES.txt +++ b/hadoop-yarn-project/CHANGES.txt @@ -666,6 +666,9 @@ Release 2.1.0-beta - 2013-07-02 from application masters that have not registered (Mayank Bansal & Abhishek Kapoor via bikas) + YARN-541. getAllocatedContainers() is not returning all the allocated + containers (bikas) + BREAKDOWN OF HADOOP-8562 SUBTASKS AND RELATED JIRAS YARN-158. Yarn creating package-info.java must not depend on sh. diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/api/impl/AMRMClientImpl.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/api/impl/AMRMClientImpl.java index 68cc2870d3d..467ab31744d 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/api/impl/AMRMClientImpl.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/api/impl/AMRMClientImpl.java @@ -230,7 +230,14 @@ public class AMRMClientImpl extends AMRMClient { try { synchronized (this) { - askList = new ArrayList(ask); + askList = new ArrayList(ask.size()); + for(ResourceRequest r : ask) { + // create a copy of ResourceRequest as we might change it while the + // RPC layer is using it to send info across + askList.add(ResourceRequest.newInstance(r.getPriority(), + r.getResourceName(), r.getCapability(), r.getNumContainers(), + r.getRelaxLocality())); + } releaseList = new ArrayList(release); // optimistically clear this collection assuming no RPC failure ask.clear();