YARN-6501. FSSchedulerNode.java fails to compile with JDK7. Contributed by John Zhuge

This commit is contained in:
Jason Lowe 2017-04-20 09:52:44 -05:00
parent 6865746ea4
commit f5a9287bb1

View File

@ -180,8 +180,13 @@ private synchronized void cleanupPreemptionList() {
void addContainersForPreemption(Collection<RMContainer> containers,
FSAppAttempt app) {
appIdToAppMap.putIfAbsent(app.getApplicationAttemptId(), app);
resourcesPreemptedForApp.putIfAbsent(app, Resource.newInstance(0, 0));
ApplicationAttemptId attempt = app.getApplicationAttemptId();
if (appIdToAppMap.get(attempt) == null) {
appIdToAppMap.put(attempt, app);
}
if (resourcesPreemptedForApp.get(app) == null) {
resourcesPreemptedForApp.put(app, Resource.newInstance(0, 0));
}
Resource appReserved = resourcesPreemptedForApp.get(app);
for(RMContainer container : containers) {