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