@Override public long pause(long bytes) throws MergePolicy.MergeAbortedException { totalBytesWritten.addAndGet(bytes); // While loop because we may wake up and check again when our rate limit // is changed while we were pausing: long paused = 0; long delta; while ((delta = maybePause(bytes, System.nanoTime())) >= 0) { // Keep waiting. paused += delta; } return paused; }
@Override public long pause(long bytes) throws MergePolicy.MergeAbortedException { totalBytesWritten.addAndGet(bytes); // While loop because we may wake up and check again when our rate limit // is changed while we were pausing: long paused = 0; long delta; while ((delta = maybePause(bytes, System.nanoTime())) >= 0) { // Keep waiting. paused += delta; } return paused; }
PauseResult result = maybePause(bytes, curNS); if (result == PauseResult.NO) {
PauseResult result = maybePause(bytes, curNS); if (result == PauseResult.NO) {