hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject [2/2] hbase git commit: Revert "Revert "HBASE-14922 Delayed flush doesn't work causing flush storms; addendum by Lars Hofhansl""
Date Sat, 05 Dec 2015 22:29:46 GMT
Revert "Revert "HBASE-14922 Delayed flush doesn't work causing flush storms; addendum by Lars
Hofhansl""

This reverts commit 693e1dee4cf46159c6c1e255e40a346985db4115.


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

Branch: refs/heads/branch-1
Commit: d955cb328046cb7efe78486fd0f4b03258ea2f6a
Parents: 693e1de
Author: stack <stack@apache.org>
Authored: Sat Dec 5 14:29:31 2015 -0800
Committer: stack <stack@apache.org>
Committed: Sat Dec 5 14:29:31 2015 -0800

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


http://git-wip-us.apache.org/repos/asf/hbase/blob/d955cb32/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;
     }


Mime
View raw message