use of org.apache.hadoop.yarn.server.resourcemanager.scheduler.placement.SchedulingPlacementSet in project hadoop by apache.
the class AppSchedulingInfo method checkAllocation.
/*
* In async environment, pending resource request could be updated during
* scheduling, this method checks pending request before allocating
*/
public boolean checkAllocation(NodeType type, SchedulerNode node, SchedulerRequestKey schedulerKey) {
try {
readLock.lock();
SchedulingPlacementSet ps = schedulerKeyToPlacementSets.get(schedulerKey);
if (null == ps) {
return false;
}
return ps.canAllocate(type, node);
} finally {
readLock.unlock();
}
}
use of org.apache.hadoop.yarn.server.resourcemanager.scheduler.placement.SchedulingPlacementSet in project hadoop by apache.
the class AppSchedulingInfo method getPendingAsk.
public PendingAsk getPendingAsk(SchedulerRequestKey schedulerKey, String resourceName) {
try {
this.readLock.lock();
SchedulingPlacementSet ps = schedulerKeyToPlacementSets.get(schedulerKey);
return (ps == null) ? PendingAsk.ZERO : ps.getPendingAsk(resourceName);
} finally {
this.readLock.unlock();
}
}
use of org.apache.hadoop.yarn.server.resourcemanager.scheduler.placement.SchedulingPlacementSet in project hadoop by apache.
the class SchedulerApplicationAttempt method showRequests.
public void showRequests() {
if (LOG.isDebugEnabled()) {
try {
readLock.lock();
for (SchedulerRequestKey schedulerKey : getSchedulerKeys()) {
SchedulingPlacementSet ps = getSchedulingPlacementSet(schedulerKey);
if (ps != null && ps.getOutstandingAsksCount(ResourceRequest.ANY) > 0) {
LOG.debug("showRequests:" + " application=" + getApplicationId() + " headRoom=" + getHeadroom() + " currentConsumption=" + attemptResourceUsage.getUsed().getMemorySize());
ps.showRequests();
}
}
} finally {
readLock.unlock();
}
}
}
use of org.apache.hadoop.yarn.server.resourcemanager.scheduler.placement.SchedulingPlacementSet in project hadoop by apache.
the class AppSchedulingInfo method acceptNodePartition.
public boolean acceptNodePartition(SchedulerRequestKey schedulerKey, String nodePartition, SchedulingMode schedulingMode) {
try {
this.readLock.lock();
SchedulingPlacementSet ps = schedulerKeyToPlacementSets.get(schedulerKey);
return (ps != null) && ps.acceptNodePartition(nodePartition, schedulingMode);
} finally {
this.readLock.unlock();
}
}
use of org.apache.hadoop.yarn.server.resourcemanager.scheduler.placement.SchedulingPlacementSet in project hadoop by apache.
the class AppSchedulingInfo method canDelayTo.
/**
* Can delay to next?.
*
* @param schedulerKey schedulerKey
* @param resourceName resourceName
*
* @return If request exists, return {relaxLocality}
* Otherwise, return true.
*/
public boolean canDelayTo(SchedulerRequestKey schedulerKey, String resourceName) {
try {
this.readLock.lock();
SchedulingPlacementSet ps = schedulerKeyToPlacementSets.get(schedulerKey);
return (ps == null) || ps.canDelayTo(resourceName);
} finally {
this.readLock.unlock();
}
}
Aggregations