HBASE-21540 when set property "hbase.systemtables.compacting.memstore.type" to "basic" or "eager" will cause an exception
Signed-off-by: Duo Zhang <zhangduo@apache.org>
This commit is contained in:
parent
6f6d331f9f
commit
699fad39a4
|
@ -344,8 +344,8 @@ public class HStore implements Store, HeapSize, StoreConfigInformation, Propagat
|
|||
// Check if in-memory-compaction configured. Note MemoryCompactionPolicy is an enum!
|
||||
MemoryCompactionPolicy inMemoryCompaction = null;
|
||||
if (this.getTableName().isSystemTable()) {
|
||||
inMemoryCompaction = MemoryCompactionPolicy.valueOf(
|
||||
conf.get("hbase.systemtables.compacting.memstore.type", "NONE"));
|
||||
inMemoryCompaction = MemoryCompactionPolicy
|
||||
.valueOf(conf.get("hbase.systemtables.compacting.memstore.type", "NONE").toUpperCase());
|
||||
} else {
|
||||
inMemoryCompaction = family.getInMemoryCompaction();
|
||||
}
|
||||
|
|
|
@ -68,6 +68,7 @@ import org.apache.hadoop.hbase.HBaseTestingUtility;
|
|||
import org.apache.hadoop.hbase.HConstants;
|
||||
import org.apache.hadoop.hbase.KeyValue;
|
||||
import org.apache.hadoop.hbase.MemoryCompactionPolicy;
|
||||
import org.apache.hadoop.hbase.NamespaceDescriptor;
|
||||
import org.apache.hadoop.hbase.PrivateCellUtil;
|
||||
import org.apache.hadoop.hbase.TableName;
|
||||
import org.apache.hadoop.hbase.client.ColumnFamilyDescriptor;
|
||||
|
@ -1662,6 +1663,19 @@ public class TestHStore {
|
|||
assertFalse(heap.equals(heap2));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testInMemoryCompactionTypeWithLowerCase() throws IOException, InterruptedException {
|
||||
Configuration conf = HBaseConfiguration.create();
|
||||
conf.set("hbase.systemtables.compacting.memstore.type", "eager");
|
||||
init(name.getMethodName(), conf,
|
||||
TableDescriptorBuilder.newBuilder(
|
||||
TableName.valueOf(NamespaceDescriptor.SYSTEM_NAMESPACE_NAME, "meta".getBytes())),
|
||||
ColumnFamilyDescriptorBuilder.newBuilder(family)
|
||||
.setInMemoryCompaction(MemoryCompactionPolicy.NONE).build());
|
||||
assertTrue(((MemStoreCompactor) ((CompactingMemStore) store.memstore).compactor).toString()
|
||||
.startsWith("eager".toUpperCase()));
|
||||
}
|
||||
|
||||
private static class MyThread extends Thread {
|
||||
private StoreScanner scanner;
|
||||
private KeyValueHeap heap;
|
||||
|
|
Loading…
Reference in New Issue