Revert "HBASE-1422 Delayed flush doesn't work causing flush storms; addendum by Lars Hofhansl"
Pushed with wrong JIRA number. Revert to fix.
This reverts commit 7d0c08fbcd
.
This commit is contained in:
parent
7d0c08fbcd
commit
693e1dee4c
|
@ -81,8 +81,7 @@ public class JitterScheduledThreadPoolExecutorImpl extends ScheduledThreadPoolEx
|
||||||
public long getDelay(TimeUnit unit) {
|
public long getDelay(TimeUnit unit) {
|
||||||
long baseDelay = wrapped.getDelay(unit);
|
long baseDelay = wrapped.getDelay(unit);
|
||||||
long spreadTime = (long) (baseDelay * spread);
|
long spreadTime = (long) (baseDelay * spread);
|
||||||
long delay = spreadTime <= 0 ? baseDelay
|
long delay = baseDelay + ThreadLocalRandom.current().nextLong(-spreadTime, spreadTime);
|
||||||
: baseDelay + ThreadLocalRandom.current().nextLong(-spreadTime, spreadTime);
|
|
||||||
// Ensure that we don't roll over for nanoseconds.
|
// Ensure that we don't roll over for nanoseconds.
|
||||||
return (delay < 0) ? baseDelay : delay;
|
return (delay < 0) ? baseDelay : delay;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue