YARN-541. getAllocatedContainers() is not returning all the allocated containers (bikas)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1502906 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Bikas Saha 2013-07-13 22:31:02 +00:00
parent a038ec6ceb
commit 2adee63426
2 changed files with 11 additions and 1 deletions

View File

@ -683,6 +683,9 @@ Release 2.1.0-beta - 2013-07-02
from application masters that have not registered (Mayank Bansal & from application masters that have not registered (Mayank Bansal &
Abhishek Kapoor via bikas) Abhishek Kapoor via bikas)
YARN-541. getAllocatedContainers() is not returning all the allocated
containers (bikas)
BREAKDOWN OF HADOOP-8562 SUBTASKS AND RELATED JIRAS BREAKDOWN OF HADOOP-8562 SUBTASKS AND RELATED JIRAS
YARN-158. Yarn creating package-info.java must not depend on sh. YARN-158. Yarn creating package-info.java must not depend on sh.

View File

@ -230,7 +230,14 @@ public AllocateResponse allocate(float progressIndicator)
try { try {
synchronized (this) { synchronized (this) {
askList = new ArrayList<ResourceRequest>(ask); askList = new ArrayList<ResourceRequest>(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<ContainerId>(release); releaseList = new ArrayList<ContainerId>(release);
// optimistically clear this collection assuming no RPC failure // optimistically clear this collection assuming no RPC failure
ask.clear(); ask.clear();