HBASE-20539 Disable IMC; part 2

Set default for in-memory compaction to NONE. PE was using
this value creating its table. Add test to ensure expected
default.
This commit is contained in:
Michael Stack 2018-05-08 10:08:40 -07:00
parent f8281aa208
commit 4f2dfd3877
2 changed files with 15 additions and 1 deletions

View File

@ -40,6 +40,7 @@ import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.hbase.PerformanceEvaluation.RandomReadTest;
import org.apache.hadoop.hbase.PerformanceEvaluation.TestOptions;
import org.apache.hadoop.hbase.regionserver.CompactingMemStore;
import org.apache.hadoop.hbase.testclassification.MiscTests;
import org.apache.hadoop.hbase.testclassification.SmallTests;
import org.junit.ClassRule;
@ -56,6 +57,19 @@ public class TestPerformanceEvaluation {
private static final HBaseTestingUtility HTU = new HBaseTestingUtility();
@Test
public void testDefaultInMemoryCompaction() {
PerformanceEvaluation.TestOptions defaultOpts =
new PerformanceEvaluation.TestOptions();
assertEquals(CompactingMemStore.COMPACTING_MEMSTORE_TYPE_DEFAULT.toString(),
defaultOpts.getInMemoryCompaction().toString());
HTableDescriptor htd = PerformanceEvaluation.getTableDescriptor(defaultOpts);
for (HColumnDescriptor hcd: htd.getFamilies()) {
assertEquals(CompactingMemStore.COMPACTING_MEMSTORE_TYPE_DEFAULT.toString(),
hcd.getInMemoryCompaction().toString());
}
}
@Test
public void testSerialization()
throws JsonGenerationException, JsonMappingException, IOException {

View File

@ -58,7 +58,7 @@ public class CompactingMemStore extends AbstractMemStore {
public static final String COMPACTING_MEMSTORE_TYPE_KEY =
"hbase.hregion.compacting.memstore.type";
public static final String COMPACTING_MEMSTORE_TYPE_DEFAULT =
String.valueOf(MemoryCompactionPolicy.BASIC);
String.valueOf(MemoryCompactionPolicy.NONE);
// Default fraction of in-memory-flush size w.r.t. flush-to-disk size
public static final String IN_MEMORY_FLUSH_THRESHOLD_FACTOR_KEY =
"hbase.memstore.inmemoryflush.threshold.factor";