|
@@ -62,7 +62,6 @@ import org.apache.hadoop.yarn.server.resourcemanager.rmnode.RMNode;
|
|
|
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.ActiveUsersManager;
|
|
|
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.NodeType;
|
|
|
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.QueueMetrics;
|
|
|
-import org.apache.hadoop.yarn.server.resourcemanager.scheduler.SchedulerUtils;
|
|
|
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.common.fica.FiCaSchedulerApp;
|
|
|
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.common.fica.FiCaSchedulerNode;
|
|
|
import org.apache.hadoop.yarn.server.resourcemanager.security.RMContainerTokenSecretManager;
|
|
@@ -781,11 +780,9 @@ public class LeafQueue implements CSQueue {
|
|
|
if (reservedContainer != null) {
|
|
|
FiCaSchedulerApp application =
|
|
|
getApplication(reservedContainer.getApplicationAttemptId());
|
|
|
- return new CSAssignment(
|
|
|
+ return
|
|
|
assignReservedContainer(application, node, reservedContainer,
|
|
|
- clusterResource),
|
|
|
- NodeType.NODE_LOCAL); // Don't care about locality constraints
|
|
|
- // for reserved containers
|
|
|
+ clusterResource);
|
|
|
}
|
|
|
|
|
|
// Try to assign containers to applications in order
|
|
@@ -873,20 +870,14 @@ public class LeafQueue implements CSQueue {
|
|
|
|
|
|
}
|
|
|
|
|
|
- private synchronized Resource assignReservedContainer(FiCaSchedulerApp application,
|
|
|
+ private synchronized CSAssignment
|
|
|
+ assignReservedContainer(FiCaSchedulerApp application,
|
|
|
FiCaSchedulerNode node, RMContainer rmContainer, Resource clusterResource) {
|
|
|
// Do we still need this reservation?
|
|
|
Priority priority = rmContainer.getReservedPriority();
|
|
|
if (application.getTotalRequiredResources(priority) == 0) {
|
|
|
// Release
|
|
|
- Container container = rmContainer.getContainer();
|
|
|
- completedContainer(clusterResource, application, node,
|
|
|
- rmContainer,
|
|
|
- SchedulerUtils.createAbnormalContainerStatus(
|
|
|
- container.getId(),
|
|
|
- SchedulerUtils.UNRESERVED_CONTAINER),
|
|
|
- RMContainerEventType.RELEASED);
|
|
|
- return container.getResource(); // Ugh, return resource to force re-sort
|
|
|
+ return new CSAssignment(application, rmContainer);
|
|
|
}
|
|
|
|
|
|
// Try to assign if we have sufficient resources
|
|
@@ -895,7 +886,7 @@ public class LeafQueue implements CSQueue {
|
|
|
|
|
|
// Doesn't matter... since it's already charged for at time of reservation
|
|
|
// "re-reservation" is *free*
|
|
|
- return Resources.none();
|
|
|
+ return new CSAssignment(Resources.none(), NodeType.NODE_LOCAL);
|
|
|
}
|
|
|
|
|
|
private synchronized boolean assignToQueue(Resource clusterResource,
|