HBASE-18994 Decide if META/System tables should use Compacting Memstore or

Default Memstore (Ram)
This commit is contained in:
Ramkrishna 2017-10-26 10:44:59 +05:30
parent 5dadfdaa58
commit 015db0a7aa
1 changed files with 21 additions and 15 deletions

View File

@ -264,18 +264,24 @@ public class HStore implements Store, HeapSize, StoreConfigInformation, Propagat
// Why not just pass a HColumnDescriptor in here altogether? Even if have
// to clone it?
scanInfo = new ScanInfo(conf, family, ttl, timeToPurgeDeletes, this.comparator);
MemoryCompactionPolicy inMemoryCompaction = family.getInMemoryCompaction();
MemoryCompactionPolicy inMemoryCompaction = null;
if (this.getTableName().isSystemTable()) {
inMemoryCompaction = MemoryCompactionPolicy
.valueOf(conf.get("hbase.systemtables.compacting.memstore.type", "NONE"));
} else {
inMemoryCompaction = family.getInMemoryCompaction();
}
if (inMemoryCompaction == null) {
inMemoryCompaction = MemoryCompactionPolicy.valueOf(
conf.get(CompactingMemStore.COMPACTING_MEMSTORE_TYPE_KEY,
inMemoryCompaction =
MemoryCompactionPolicy.valueOf(conf.get(CompactingMemStore.COMPACTING_MEMSTORE_TYPE_KEY,
CompactingMemStore.COMPACTING_MEMSTORE_TYPE_DEFAULT));
}
String className;
switch (inMemoryCompaction) {
case BASIC:
case EAGER:
Class<? extends CompactingMemStore> clz = conf.getClass(MEMSTORE_CLASS_NAME,
CompactingMemStore.class, CompactingMemStore.class);
Class<? extends CompactingMemStore> clz =
conf.getClass(MEMSTORE_CLASS_NAME, CompactingMemStore.class, CompactingMemStore.class);
className = clz.getName();
this.memstore = ReflectionUtils.newInstance(clz, new Object[] { conf, this.comparator, this,
this.getHRegion().getRegionServicesForStores(), inMemoryCompaction });