/** * 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); } }
assertFalse(queueB1.isStarvedForFairShare()); assertTrue(queueB2.isStarvedForFairShare()); assertFalse(queueB1.isStarvedForFairShare()); assertFalse(queueB2.isStarvedForFairShare());