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"" Reapply but with right JIRA number by reverting the revert.
Date Sat, 05 Dec 2015 22:28:56 GMT
Revert "Revert "HBASE-14922 Delayed flush doesn't work causing flush storms; addendum by Lars
Hofhansl""
Reapply but with right JIRA number by reverting the revert.

This reverts commit 1633db4747a32e02af7b7df9a316adcbeeebd92d.


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

Branch: refs/heads/branch-1.2
Commit: 1bcb2c66aed24105c02300baf8bc431f81c9e76e
Parents: 1633db4
Author: stack <stack@apache.org>
Authored: Sat Dec 5 14:28:23 2015 -0800
Committer: stack <stack@apache.org>
Committed: Sat Dec 5 14:28:23 2015 -0800

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


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