From 85853f69c88c08db61af7fb6ef3b5432f926e531 Mon Sep 17 00:00:00 2001 From: stack Date: Tue, 29 Jul 2014 19:00:17 -0700 Subject: [PATCH] HBASE-11316 Expand info about compactions beyond HBASE-11120 ADDENDUM TO FIX BROKE TESTS --- .../regionserver/TestDefaultCompactSelection.java | 2 ++ .../compactions/TestStripeCompactionPolicy.java | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestDefaultCompactSelection.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestDefaultCompactSelection.java index 9a195241aa0..67e036f52cd 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestDefaultCompactSelection.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestDefaultCompactSelection.java @@ -77,6 +77,8 @@ public class TestDefaultCompactSelection extends TestCase { this.conf.setLong(HConstants.HREGION_MEMSTORE_FLUSH_SIZE, minSize); this.conf.setLong("hbase.hstore.compaction.max.size", maxSize); this.conf.setFloat("hbase.hstore.compaction.ratio", 1.0F); + // Test depends on this not being set to pass. Default breaks test. TODO: Revisit. + this.conf.unset("hbase.hstore.compaction.min.size"); //Setting up a Store Path basedir = new Path(DIR); 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 a4f8f5bcd0e..540b6d97259 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 @@ -131,6 +131,8 @@ public class TestStripeCompactionPolicy { public void testSingleStripeCompaction() throws Exception { // Create a special policy that only compacts single stripes, using standard methods. Configuration conf = HBaseConfiguration.create(); + // Test depends on this not being set to pass. Default breaks test. TODO: Revisit. + conf.unset("hbase.hstore.compaction.min.size"); conf.setFloat(CompactionConfiguration.HBASE_HSTORE_COMPACTION_RATIO_KEY, 1.0F); conf.setInt(StripeStoreConfig.MIN_FILES_KEY, 3); conf.setInt(StripeStoreConfig.MAX_FILES_KEY, 4); @@ -251,6 +253,8 @@ public class TestStripeCompactionPolicy { @Test public void testSplitOffStripe() throws Exception { Configuration conf = HBaseConfiguration.create(); + // Test depends on this not being set to pass. Default breaks test. TODO: Revisit. + conf.unset("hbase.hstore.compaction.min.size"); // First test everything with default split count of 2, then split into more. conf.setInt(StripeStoreConfig.MIN_FILES_KEY, 2); Long[] toSplit = new Long[] { defaultSplitSize - 2, 1L, 1L }; @@ -281,6 +285,10 @@ public class TestStripeCompactionPolicy { public void testSplitOffStripeOffPeak() throws Exception { // for HBASE-11439 Configuration conf = HBaseConfiguration.create(); + + // Test depends on this not being set to pass. Default breaks test. TODO: Revisit. + conf.unset("hbase.hstore.compaction.min.size"); + conf.setInt(StripeStoreConfig.MIN_FILES_KEY, 2); // Select the last 2 files. StripeCompactionPolicy.StripeInformationProvider si = @@ -391,6 +399,8 @@ public class TestStripeCompactionPolicy { @Test public void testSingleStripeDropDeletes() throws Exception { Configuration conf = HBaseConfiguration.create(); + // Test depends on this not being set to pass. Default breaks test. TODO: Revisit. + conf.unset("hbase.hstore.compaction.min.size"); StripeCompactionPolicy policy = createPolicy(conf); // Verify the deletes can be dropped if there are no L0 files. Long[][] stripes = new Long[][] { new Long[] { 3L, 2L, 2L, 2L }, new Long[] { 6L } };