/** * Helper method for tests to check if a queue is starved. * @return whether starved for either minshare or fairshare */ @VisibleForTesting boolean isStarved() { return isStarvedForMinShare() || isStarvedForFairShare(); }
/** * Update the preemption fields for the queue, i.e. the times since last was * at its guaranteed share and over its fair share threshold. */ public void updateStarvationStats() { long now = scheduler.getClock().getTime(); if (!isStarvedForMinShare()) { setLastTimeAtMinShare(now); } if (!isStarvedForFairShare()) { setLastTimeAtFairShareThreshold(now); } }
/** * Update the preemption fields for the queue, i.e. the times since last was * at its guaranteed share and over its fair share threshold. */ public void updateStarvationStats() { long now = scheduler.getClock().getTime(); if (!isStarvedForMinShare()) { setLastTimeAtMinShare(now); } if (!isStarvedForFairShare()) { setLastTimeAtFairShareThreshold(now); } }
FSLeafQueue queueB = scheduler.getQueueManager().getLeafQueue("queueB", false); assertFalse(queueA.isStarvedForMinShare()); assertTrue(queueB.isStarvedForMinShare()); assertFalse(queueB.isStarvedForMinShare());