hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From te...@apache.org
Subject git commit: HBASE-11439 StripeCompaction may not obey the OffPeak rule to compaction
Date Tue, 01 Jul 2014 16:30:38 GMT
Repository: hbase
Updated Branches:
  refs/heads/0.98 dde62f16d -> c8d1d7cef


HBASE-11439 StripeCompaction may not obey the OffPeak rule to compaction


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

Branch: refs/heads/0.98
Commit: c8d1d7cef8be88304770e6d461b5574039346d9b
Parents: dde62f1
Author: Ted Yu <tedyu@apache.org>
Authored: Tue Jul 1 16:30:21 2014 +0000
Committer: Ted Yu <tedyu@apache.org>
Committed: Tue Jul 1 16:30:21 2014 +0000

----------------------------------------------------------------------
 .../compactions/StripeCompactionPolicy.java         |  2 +-
 .../compactions/TestStripeCompactionPolicy.java     | 16 ++++++++++++++++
 2 files changed, 17 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/c8d1d7ce/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/StripeCompactionPolicy.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/StripeCompactionPolicy.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/StripeCompactionPolicy.java
index 7189d21..22697e9 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/StripeCompactionPolicy.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/StripeCompactionPolicy.java
@@ -266,7 +266,7 @@ public class StripeCompactionPolicy extends CompactionPolicy {
     int minFilesLocal = Math.max(
         allFilesOnly ? sfs.size() : 0, this.config.getStripeCompactMinFiles());
     int maxFilesLocal = Math.max(this.config.getStripeCompactMaxFiles(), minFilesLocal);
-    return stripePolicy.applyCompactionPolicy(sfs, isOffpeak, false, minFilesLocal, maxFilesLocal);
+    return stripePolicy.applyCompactionPolicy(sfs, false, isOffpeak, minFilesLocal, maxFilesLocal);
   }
 
   /**

http://git-wip-us.apache.org/repos/asf/hbase/blob/c8d1d7ce/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/compactions/TestStripeCompactionPolicy.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/compactions/TestStripeCompactionPolicy.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/compactions/TestStripeCompactionPolicy.java
index c80e11b..46e65f5 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/compactions/TestStripeCompactionPolicy.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/compactions/TestStripeCompactionPolicy.java
@@ -279,6 +279,22 @@ public class TestStripeCompactionPolicy {
   }
 
   @Test
+  public void testSplitOffStripeOffPeak() throws Exception {
+    // for HBASE-11439
+    Configuration conf = HBaseConfiguration.create();
+    conf.setInt(StripeStoreConfig.MIN_FILES_KEY, 2);
+    // Select the last 2 files.
+    StripeCompactionPolicy.StripeInformationProvider si =
+        createStripesWithSizes(0, 0, new Long[] { defaultSplitSize - 2, 1L, 1L });
+    assertEquals(2, createPolicy(conf).selectCompaction(si, al(), false).getRequest().getFiles()
+        .size());
+    // Make sure everything is eligible in offpeak.
+    conf.setFloat("hbase.hstore.compaction.ratio.offpeak", 500f);
+    assertEquals(3, createPolicy(conf).selectCompaction(si, al(), true).getRequest().getFiles()
+        .size());
+  }
+
+  @Test
   public void testSplitOffStripeDropDeletes() throws Exception {
     Configuration conf = HBaseConfiguration.create();
     conf.setInt(StripeStoreConfig.MIN_FILES_KEY, 2);


Mime
View raw message