/** * This methods to change capacity for a queue and adjusts its * absoluteCapacity * * @param entitlement the new entitlement for the queue (capacity, * maxCapacity, etc..) * @throws SchedulerDynamicEditException */ public synchronized void setEntitlement(QueueEntitlement entitlement) throws SchedulerDynamicEditException { float capacity = entitlement.getCapacity(); if (capacity < 0 || capacity > 1.0f) { throw new SchedulerDynamicEditException( "Capacity demand is not in the [0,1] range: " + capacity); } setCapacity(capacity); setAbsoluteCapacity(getParent().getAbsoluteCapacity() * getCapacity()); // note: we currently set maxCapacity to capacity // this might be revised later setMaxCapacity(entitlement.getMaxCapacity()); if (LOG.isDebugEnabled()) { LOG.debug("successfully changed to " + capacity + " for queue " + this.getQueueName()); } }
/** * This methods to change capacity for a queue and adjusts its * absoluteCapacity * * @param entitlement the new entitlement for the queue (capacity, * maxCapacity, etc..) * @throws SchedulerDynamicEditException */ public synchronized void setEntitlement(QueueEntitlement entitlement) throws SchedulerDynamicEditException { float capacity = entitlement.getCapacity(); if (capacity < 0 || capacity > 1.0f) { throw new SchedulerDynamicEditException( "Capacity demand is not in the [0,1] range: " + capacity); } setCapacity(capacity); setAbsoluteCapacity(getParent().getAbsoluteCapacity() * getCapacity()); // note: we currently set maxCapacity to capacity // this might be revised later setMaxCapacity(entitlement.getMaxCapacity()); if (LOG.isDebugEnabled()) { LOG.debug("successfully changed to " + capacity + " for queue " + this.getQueueName()); } }