Search in sources :

Example 1 with SchedulingPlacementSet

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();
    }
}
Also used : LocalitySchedulingPlacementSet(org.apache.hadoop.yarn.server.resourcemanager.scheduler.placement.LocalitySchedulingPlacementSet) SchedulingPlacementSet(org.apache.hadoop.yarn.server.resourcemanager.scheduler.placement.SchedulingPlacementSet)

Example 2 with SchedulingPlacementSet

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();
    }
}
Also used : LocalitySchedulingPlacementSet(org.apache.hadoop.yarn.server.resourcemanager.scheduler.placement.LocalitySchedulingPlacementSet) SchedulingPlacementSet(org.apache.hadoop.yarn.server.resourcemanager.scheduler.placement.SchedulingPlacementSet)

Example 3 with SchedulingPlacementSet

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();
        }
    }
}
Also used : SchedulingPlacementSet(org.apache.hadoop.yarn.server.resourcemanager.scheduler.placement.SchedulingPlacementSet) SchedulerRequestKey(org.apache.hadoop.yarn.server.scheduler.SchedulerRequestKey)

Example 4 with SchedulingPlacementSet

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();
    }
}
Also used : LocalitySchedulingPlacementSet(org.apache.hadoop.yarn.server.resourcemanager.scheduler.placement.LocalitySchedulingPlacementSet) SchedulingPlacementSet(org.apache.hadoop.yarn.server.resourcemanager.scheduler.placement.SchedulingPlacementSet)

Example 5 with SchedulingPlacementSet

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();
    }
}
Also used : LocalitySchedulingPlacementSet(org.apache.hadoop.yarn.server.resourcemanager.scheduler.placement.LocalitySchedulingPlacementSet) SchedulingPlacementSet(org.apache.hadoop.yarn.server.resourcemanager.scheduler.placement.SchedulingPlacementSet)

Aggregations

SchedulingPlacementSet (org.apache.hadoop.yarn.server.resourcemanager.scheduler.placement.SchedulingPlacementSet)8 LocalitySchedulingPlacementSet (org.apache.hadoop.yarn.server.resourcemanager.scheduler.placement.LocalitySchedulingPlacementSet)6 PendingAsk (org.apache.hadoop.yarn.server.resourcemanager.scheduler.common.PendingAsk)2 Resource (org.apache.hadoop.yarn.api.records.Resource)1 SchedulerRequestKey (org.apache.hadoop.yarn.server.scheduler.SchedulerRequestKey)1