YARN-1692. ConcurrentModificationException in fair scheduler AppSchedulable (Sangjin Lee via Sandy Ryza)
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1567788 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
ad6bc868b6
commit
bc939f7ae6
@ -266,7 +266,10 @@ Release 2.3.1 - UNRELEASED
|
|||||||
|
|
||||||
OPTIMIZATIONS
|
OPTIMIZATIONS
|
||||||
|
|
||||||
BUG FIXES
|
BUG FIXES
|
||||||
|
|
||||||
|
YARN-1692. ConcurrentModificationException in fair scheduler AppSchedulable
|
||||||
|
(Sangjin Lee via Sandy Ryza)
|
||||||
|
|
||||||
Release 2.3.0 - 2014-02-18
|
Release 2.3.0 - 2014-02-18
|
||||||
|
|
||||||
|
@ -150,7 +150,7 @@ public Collection<Priority> getPriorities() {
|
|||||||
return appSchedulingInfo.getPriorities();
|
return appSchedulingInfo.getPriorities();
|
||||||
}
|
}
|
||||||
|
|
||||||
public ResourceRequest getResourceRequest(Priority priority, String resourceName) {
|
public synchronized ResourceRequest getResourceRequest(Priority priority, String resourceName) {
|
||||||
return this.appSchedulingInfo.getResourceRequest(priority, resourceName);
|
return this.appSchedulingInfo.getResourceRequest(priority, resourceName);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -158,7 +158,7 @@ public synchronized int getTotalRequiredResources(Priority priority) {
|
|||||||
return getResourceRequest(priority, ResourceRequest.ANY).getNumContainers();
|
return getResourceRequest(priority, ResourceRequest.ANY).getNumContainers();
|
||||||
}
|
}
|
||||||
|
|
||||||
public Resource getResource(Priority priority) {
|
public synchronized Resource getResource(Priority priority) {
|
||||||
return appSchedulingInfo.getResource(priority);
|
return appSchedulingInfo.getResource(priority);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -192,7 +192,7 @@ public synchronized float getLocalityWaitFactor(
|
|||||||
return Math.min(((float)requiredResources / clusterNodes), 1.0f);
|
return Math.min(((float)requiredResources / clusterNodes), 1.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Resource getTotalPendingRequests() {
|
public synchronized Resource getTotalPendingRequests() {
|
||||||
Resource ret = Resource.newInstance(0, 0);
|
Resource ret = Resource.newInstance(0, 0);
|
||||||
for (ResourceRequest rr : appSchedulingInfo.getAllResourceRequests()) {
|
for (ResourceRequest rr : appSchedulingInfo.getAllResourceRequests()) {
|
||||||
// to avoid double counting we count only "ANY" resource requests
|
// to avoid double counting we count only "ANY" resource requests
|
||||||
|
@ -82,10 +82,12 @@ public void updateDemand() {
|
|||||||
Resources.addTo(demand, app.getCurrentConsumption());
|
Resources.addTo(demand, app.getCurrentConsumption());
|
||||||
|
|
||||||
// Add up outstanding resource requests
|
// Add up outstanding resource requests
|
||||||
for (Priority p : app.getPriorities()) {
|
synchronized (app) {
|
||||||
for (ResourceRequest r : app.getResourceRequests(p).values()) {
|
for (Priority p : app.getPriorities()) {
|
||||||
Resource total = Resources.multiply(r.getCapability(), r.getNumContainers());
|
for (ResourceRequest r : app.getResourceRequests(p).values()) {
|
||||||
Resources.addTo(demand, total);
|
Resource total = Resources.multiply(r.getCapability(), r.getNumContainers());
|
||||||
|
Resources.addTo(demand, total);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user