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 (Victor Xu)
Date Tue, 01 Jul 2014 16:32:13 GMT
Repository: hbase
Updated Branches:
  refs/heads/master ba044f010 -> 5f3c0b7f9


HBASE-11439 StripeCompaction may not obey the OffPeak rule to compaction (Victor Xu)


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

Branch: refs/heads/master
Commit: 5f3c0b7f9be00430e8ea53b7d4afae5f6f3a8b3b
Parents: ba044f0
Author: Ted Yu <tedyu@apache.org>
Authored: Tue Jul 1 16:32:03 2014 +0000
Committer: Ted Yu <tedyu@apache.org>
Committed: Tue Jul 1 16:32:03 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/5f3c0b7f/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/5f3c0b7f/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 64a4147..a4f8f5b 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
@@ -278,6 +278,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