hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ecl...@apache.org
Subject [26/50] [abbrv] git commit: [HBASE-11383] Add jitter to HLog rolling period
Date Thu, 31 Jul 2014 22:08:02 GMT
[HBASE-11383] Add jitter to HLog rolling period

Summary: Just in case things go wrong all at once make sure not to ddos the nn by making the
rate limiting jittered.

Test Plan: mvn clean test -Dtest=TestHLog

Reviewers: adela, daviddeng

Reviewed By: daviddeng

Subscribers: hbase-prodeng@, hbase-eng@

Differential Revision: https://phabricator.fb.com/D1393915

Tasks: 4549813

git-svn-id: svn+ssh://tubbs/svnhive/hadoop/branches/titan/VENDOR.hbase/hbase-trunk@43016 e7acf4d4-3532-417f-9e73-7a9ae25a1f51


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

Branch: refs/heads/0.89-fb
Commit: 13c94a30b64ee58e60515129d4dcadae77e37124
Parents: d8ba450
Author: elliott <elliott@e7acf4d4-3532-417f-9e73-7a9ae25a1f51>
Authored: Fri Jun 20 17:28:45 2014 +0000
Committer: Elliott Clark <elliott@fb.com>
Committed: Thu Jul 31 14:44:23 2014 -0700

----------------------------------------------------------------------
 .../java/org/apache/hadoop/hbase/regionserver/LogRoller.java  | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/13c94a30/src/main/java/org/apache/hadoop/hbase/regionserver/LogRoller.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/hadoop/hbase/regionserver/LogRoller.java b/src/main/java/org/apache/hadoop/hbase/regionserver/LogRoller.java
index 1eb0944..92f6cec 100644
--- a/src/main/java/org/apache/hadoop/hbase/regionserver/LogRoller.java
+++ b/src/main/java/org/apache/hadoop/hbase/regionserver/LogRoller.java
@@ -19,6 +19,7 @@
  */
 package org.apache.hadoop.hbase.regionserver;
 
+import org.apache.commons.lang.math.RandomUtils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.hbase.RemoteExceptionHandler;
@@ -67,8 +68,10 @@ public class LogRoller extends HasThread implements LogRollListener {
   public LogRoller(final HRegionServer server, int hlogIndexID) {
     super();
     this.server = server;
-    this.rollperiod =
-      this.server.conf.getLong("hbase.regionserver.logroll.period", 3600000);
+
+    long confRoll = this.server.conf.getLong("hbase.regionserver.logroll.period", 3600000);
+    this.rollperiod = (long) (confRoll + (RandomUtils.nextDouble() * 0.2 * confRoll));
+
     this.timeBetweenRequest = this.server.conf.getLong(LOG_ROLL_REQUEST_PERIOD_KEY,
         LOG_ROLL_REQUEST_PERIOD_DEFAULT);
     this.hlogIndexID = hlogIndexID;


Mime
View raw message