/** * Called when this application already has an existing reservation on the * given node. Sees whether we can turn the reservation into an allocation. * Also checks whether the application needs the reservation anymore, and * releases it if not. * * @param node * Node that the application has an existing reservation on */ public Resource assignReservedContainer(FSSchedulerNode node) { RMContainer rmContainer = node.getReservedContainer(); Priority priority = rmContainer.getReservedPriority(); // Make sure the application still needs requests at this priority if (getTotalRequiredResources(priority) == 0) { unreserve(priority, node); return Resources.none(); } // Fail early if the reserved container won't fit. // Note that we have an assumption here that there's only one container size // per priority. if (!Resources.fitsIn(node.getReservedContainer().getReservedResource(), node.getAvailableResource())) { return Resources.none(); } return assignContainer(node, true); }
/** * Called when this application already has an existing reservation on the * given node. Sees whether we can turn the reservation into an allocation. * Also checks whether the application needs the reservation anymore, and * releases it if not. * * @param node * Node that the application has an existing reservation on */ public Resource assignReservedContainer(FSSchedulerNode node) { RMContainer rmContainer = node.getReservedContainer(); Priority priority = rmContainer.getReservedPriority(); // Make sure the application still needs requests at this priority if (getTotalRequiredResources(priority) == 0) { unreserve(priority, node); return Resources.none(); } // Fail early if the reserved container won't fit. // Note that we have an assumption here that there's only one container size // per priority. if (!Resources.fitsIn(node.getReservedContainer().getReservedResource(), node.getAvailableResource())) { return Resources.none(); } return assignContainer(node, true); }
if (getTotalRequiredResources(priority) <= 0) { return null;
if (getTotalRequiredResources(priority) <= 0) { return null;
if (getTotalRequiredResources(priority) <= 0 || !hasContainerForNode(priority, node)) { continue;
if (getTotalRequiredResources(priority) <= 0 || !hasContainerForNode(priority, node)) { continue;