protected void setQueueEntitlement(String planQueueName, String currResId, float targetCapacity, float maxCapacity) throws YarnException { String reservationQueueName = getReservationQueueName(planQueueName, currResId); scheduler.setEntitlement(reservationQueueName, new QueueEntitlement(targetCapacity, maxCapacity)); }
protected void setQueueEntitlement(String planQueueName, String currResId, float targetCapacity, float maxCapacity) throws YarnException { String reservationQueueName = getReservationQueueName(planQueueName, currResId); scheduler.setEntitlement(reservationQueueName, new QueueEntitlement( targetCapacity, maxCapacity)); }
protected void setQueueEntitlement(String planQueueName, String currResId, float targetCapacity, float maxCapacity) throws YarnException { String reservationQueueName = getReservationQueueName(planQueueName, currResId); scheduler.setEntitlement(reservationQueueName, new QueueEntitlement( targetCapacity, maxCapacity)); }
/** * First sets entitlement of queues to zero to prevent new app submission. * Then move all apps in the set of queues to the parent plan queue's default * reservation queue if move is enabled. Finally cleanups the queue by killing * any apps (if move is disabled or move failed) and removing the queue */ protected void cleanupExpiredQueues(String planQueueName, boolean shouldMove, Set<String> toRemove, String defReservationQueue) { for (String expiredReservationId : toRemove) { try { // reduce entitlement to 0 String expiredReservation = getReservationQueueName(planQueueName, expiredReservationId); setQueueEntitlement(planQueueName, expiredReservation, 0.0f, 0.0f); if (shouldMove) { moveAppsInQueueSync(expiredReservation, defReservationQueue); } if (scheduler.getAppsInQueue(expiredReservation).size() > 0) { scheduler.killAllAppsInQueue(expiredReservation); LOG.info("Killing applications in queue: {}", expiredReservation); } else { scheduler.removeQueue(expiredReservation); LOG.info("Queue: " + expiredReservation + " removed"); } } catch (YarnException e) { LOG.warn("Exception while trying to expire reservation: {}", expiredReservationId, e); } } }
/** * First sets entitlement of queues to zero to prevent new app submission. * Then move all apps in the set of queues to the parent plan queue's default * reservation queue if move is enabled. Finally cleanups the queue by killing * any apps (if move is disabled or move failed) and removing the queue */ protected void cleanupExpiredQueues(String planQueueName, boolean shouldMove, Set<String> toRemove, String defReservationQueue) { for (String expiredReservationId : toRemove) { try { // reduce entitlement to 0 String expiredReservation = getReservationQueueName(planQueueName, expiredReservationId); setQueueEntitlement(planQueueName, expiredReservation, 0.0f, 0.0f); if (shouldMove) { moveAppsInQueueSync(expiredReservation, defReservationQueue); } if (scheduler.getAppsInQueue(expiredReservation).size() > 0) { scheduler.killAllAppsInQueue(expiredReservation); LOG.info("Killing applications in queue: {}", expiredReservation); } else { scheduler.removeQueue(expiredReservation); LOG.info("Queue: " + expiredReservation + " removed"); } } catch (YarnException e) { LOG.warn("Exception while trying to expire reservation: {}", expiredReservationId, e); } } }
getReservationQueueName(planQueueName, expiredReservationId); setQueueEntitlement(planQueueName, expiredReservation, 0.0f, 0.0f); if (shouldMove) {
String defReservationQueue = getReservationQueueName(planQueueName, defReservationId); createDefaultReservationQueue(planQueueName, planQueue,
+ ReservationConstants.DEFAULT_QUEUE_SUFFIX; String defReservationQueue = getReservationQueueName(planQueueName, defReservationId); createDefaultReservationQueue(planQueueName, planQueue, defReservationId); curReservationNames.add(defReservationId);
String defReservationQueue = getReservationQueueName(planQueueName, defReservationId); createDefaultReservationQueue(planQueueName, planQueue,