@Test public void nullThrottlersTest() throws Exception { DiskIOScheduler scheduler = new DiskIOScheduler(null); assertEquals("Unexpected i/o slice availability returned", Long.MAX_VALUE, scheduler.getSlice("jobType", "job", 0)); }
long getSlice(String jobType, String jobId, long usedSinceLastCall) { Throttler throttler = throttlers.get(jobType); if (throttler != null) { try { throttler.maybeThrottle(usedSinceLastCall); } catch (InterruptedException e) { throw new IllegalStateException("Throttler call interrupted", e); } } return Long.MAX_VALUE; }
DiskIOScheduler { long getSlice(String jobType, String jobId, long usedSinceLastCall) { Throttler throttler = throttlers.get(jobType); if (throttler != null) { try { throttler.maybeThrottle(usedSinceLastCall); } catch (InterruptedException e) { throw new IllegalStateException("Throttler call interrupted", e); } } return Long.MAX_VALUE; } }
DiskIOScheduler { long getSlice(String jobType, String jobId, long usedSinceLastCall) { Throttler throttler = throttlers.get(jobType); if (throttler != null) { try { throttler.maybeThrottle(usedSinceLastCall); } catch (InterruptedException e) { throw new IllegalStateException("Throttler call interrupted", e); } } return Long.MAX_VALUE; } DiskIOScheduler(Map<String, Throttler> throttlers); }
DiskIOScheduler { long getSlice(String jobType, String jobId, long usedSinceLastCall) { Throttler throttler = throttlers.get(jobType); if (throttler != null) { try { throttler.maybeThrottle(usedSinceLastCall); } catch (InterruptedException e) { throw new IllegalStateException("Throttler call interrupted", e); } } return Long.MAX_VALUE; } DiskIOScheduler(Map<String, Throttler> throttlers);  }
DiskIOScheduler { long getSlice(String jobType, String jobId, long usedSinceLastCall) { Throttler throttler = throttlers.get(jobType); if (throttler != null) { try { throttler.maybeThrottle(usedSinceLastCall); } catch (InterruptedException e) { throw new IllegalStateException("Throttler call interrupted", e); } } return Long.MAX_VALUE; } DiskIOScheduler(Map<String, Throttler> throttlers);   }