YARN-1381. Same relaxLocality appears twice in exception message of AMRMClientImpl#checkLocalityRelaxationConflict() (Ted Yu via Sandy Ryza)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1537632 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Sanford Ryza 2013-10-31 20:45:49 +00:00
parent 9f4d4e27fb
commit 9a204f8c51
2 changed files with 12 additions and 7 deletions

View File

@ -178,6 +178,9 @@ Release 2.2.1 - UNRELEASED
YARN-1343. NodeManagers additions/restarts are not reported as node updates YARN-1343. NodeManagers additions/restarts are not reported as node updates
in AllocateResponse responses to AMs. (tucu) in AllocateResponse responses to AMs. (tucu)
YARN-1381. Same relaxLocality appears twice in exception message of
AMRMClientImpl#checkLocalityRelaxationConflict() (Ted Yu via Sandy Ryza)
Release 2.2.0 - 2013-10-13 Release 2.2.0 - 2013-10-13
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

@ -499,13 +499,15 @@ private void checkLocalityRelaxationConflict(Priority priority,
for (String location : locations) { for (String location : locations) {
TreeMap<Resource, ResourceRequestInfo> reqs = TreeMap<Resource, ResourceRequestInfo> reqs =
remoteRequests.get(location); remoteRequests.get(location);
if (reqs != null && !reqs.isEmpty() if (reqs != null && !reqs.isEmpty()) {
&& reqs.values().iterator().next().remoteRequest.getRelaxLocality() boolean existingRelaxLocality =
!= relaxLocality) { reqs.values().iterator().next().remoteRequest.getRelaxLocality();
throw new InvalidContainerRequestException("Cannot submit a " if (relaxLocality != existingRelaxLocality) {
+ "ContainerRequest asking for location " + location throw new InvalidContainerRequestException("Cannot submit a "
+ " with locality relaxation " + relaxLocality + " when it has " + "ContainerRequest asking for location " + location
+ "already been requested with locality relaxation " + relaxLocality); + " with locality relaxation " + relaxLocality + " when it has "
+ "already been requested with locality relaxation " + existingRelaxLocality);
}
} }
} }
} }