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

hbase git commit: HBASE-13412 ADDENDUM Region split decisions should have jitter

Repository: hbase
Updated Branches:
  refs/heads/0.98 fd77290ac -> 06e0e47ca


HBASE-13412 ADDENDUM Region split decisions should have jitter

Hadoop 1 does not have Configuration#getDouble, use Configuration#getFloat
instead.


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

Branch: refs/heads/0.98
Commit: 06e0e47cab8cab09725dd850a65264f2f2317465
Parents: fd77290
Author: Andrew Purtell <ap...@apache.org>
Authored: Mon May 11 18:09:35 2015 -0700
Committer: Andrew Purtell <ap...@apache.org>
Committed: Mon May 11 18:09:37 2015 -0700

----------------------------------------------------------------------
 .../hadoop/hbase/regionserver/ConstantSizeRegionSplitPolicy.java | 4 ++--
 .../apache/hadoop/hbase/regionserver/TestRegionSplitPolicy.java  | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/06e0e47c/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/ConstantSizeRegionSplitPolicy.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/ConstantSizeRegionSplitPolicy.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/ConstantSizeRegionSplitPolicy.java
index 9ef7a9f..8bf4070 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/ConstantSizeRegionSplitPolicy.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/ConstantSizeRegionSplitPolicy.java
@@ -52,8 +52,8 @@ public class ConstantSizeRegionSplitPolicy extends RegionSplitPolicy {
       this.desiredMaxFileSize = conf.getLong(HConstants.HREGION_MAX_FILESIZE,
         HConstants.DEFAULT_MAX_FILE_SIZE);
     }
-    double jitter = conf.getDouble("hbase.hregion.max.filesize.jitter", Double.NaN);
-    if (!Double.isNaN(jitter)) {
+    float jitter = conf.getFloat("hbase.hregion.max.filesize.jitter", Float.NaN);
+    if (!Float.isNaN(jitter)) {
       this.desiredMaxFileSize += (long)(desiredMaxFileSize * (RANDOM.nextFloat() - 0.5D) * jitter);
     }
   }

http://git-wip-us.apache.org/repos/asf/hbase/blob/06e0e47c/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionSplitPolicy.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionSplitPolicy.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionSplitPolicy.java
index f24b0b8..73c9403 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionSplitPolicy.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionSplitPolicy.java
@@ -67,7 +67,7 @@ public class TestRegionSplitPolicy {
     // Configure IncreasingToUpperBoundRegionSplitPolicy as our split policy
     conf.set(HConstants.HBASE_REGION_SPLIT_POLICY_KEY,
       IncreasingToUpperBoundRegionSplitPolicy.class.getName());
-    conf.setDouble("hbase.hregion.max.filesize.jitter", 0.25D);
+    conf.setFloat("hbase.hregion.max.filesize.jitter", 0.25f);
 
     // Now make it so the mock region has a RegionServerService that will
     // return 'online regions'.
@@ -133,7 +133,7 @@ public class TestRegionSplitPolicy {
   @Test
   public void testCreateDefault() throws IOException {
     conf.setLong(HConstants.HREGION_MAX_FILESIZE, 1234L);
-    conf.setDouble("hbase.hregion.max.filesize.jitter", 0.25D);
+    conf.setFloat("hbase.hregion.max.filesize.jitter", 0.25f);
 
     // Using a default HTD, should pick up the file size from
     // configuration.