You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by st...@apache.org on 2015/12/05 23:30:49 UTC

[2/2] hbase git commit: 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.

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 9fb53d07c418002c8a03be1e7e664e094f304ba5.


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/8bf70144
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/8bf70144
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/8bf70144

Branch: refs/heads/master
Commit: 8bf70144e40650ef972f005e2465bd0e2a087c40
Parents: 9fb53d0
Author: stack <st...@apache.org>
Authored: Sat Dec 5 14:30:25 2015 -0800
Committer: stack <st...@apache.org>
Committed: Sat Dec 5 14:30:25 2015 -0800

----------------------------------------------------------------------
 .../hadoop/hbase/JitterScheduledThreadPoolExecutorImpl.java       | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/8bf70144/hbase-common/src/main/java/org/apache/hadoop/hbase/JitterScheduledThreadPoolExecutorImpl.java
----------------------------------------------------------------------
diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/JitterScheduledThreadPoolExecutorImpl.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/JitterScheduledThreadPoolExecutorImpl.java
index ca15286..7e7239e 100644
--- a/hbase-common/src/main/java/org/apache/hadoop/hbase/JitterScheduledThreadPoolExecutorImpl.java
+++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/JitterScheduledThreadPoolExecutorImpl.java
@@ -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;
     }