HBASE-18994 Decide if META/System tables should use Compacting Memstore or
Default Memstore (Ram)
This commit is contained in:
parent
5dadfdaa58
commit
015db0a7aa
|
@ -264,23 +264,29 @@ public class HStore implements Store, HeapSize, StoreConfigInformation, Propagat
|
||||||
// Why not just pass a HColumnDescriptor in here altogether? Even if have
|
// Why not just pass a HColumnDescriptor in here altogether? Even if have
|
||||||
// to clone it?
|
// to clone it?
|
||||||
scanInfo = new ScanInfo(conf, family, ttl, timeToPurgeDeletes, this.comparator);
|
scanInfo = new ScanInfo(conf, family, ttl, timeToPurgeDeletes, this.comparator);
|
||||||
MemoryCompactionPolicy inMemoryCompaction = family.getInMemoryCompaction();
|
MemoryCompactionPolicy inMemoryCompaction = null;
|
||||||
if(inMemoryCompaction == null) {
|
if (this.getTableName().isSystemTable()) {
|
||||||
inMemoryCompaction = MemoryCompactionPolicy.valueOf(
|
inMemoryCompaction = MemoryCompactionPolicy
|
||||||
conf.get(CompactingMemStore.COMPACTING_MEMSTORE_TYPE_KEY,
|
.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,
|
||||||
CompactingMemStore.COMPACTING_MEMSTORE_TYPE_DEFAULT));
|
CompactingMemStore.COMPACTING_MEMSTORE_TYPE_DEFAULT));
|
||||||
}
|
}
|
||||||
String className;
|
String className;
|
||||||
switch (inMemoryCompaction) {
|
switch (inMemoryCompaction) {
|
||||||
case BASIC :
|
case BASIC:
|
||||||
case EAGER :
|
case EAGER:
|
||||||
Class<? extends CompactingMemStore> clz = conf.getClass(MEMSTORE_CLASS_NAME,
|
Class<? extends CompactingMemStore> clz =
|
||||||
CompactingMemStore.class, CompactingMemStore.class);
|
conf.getClass(MEMSTORE_CLASS_NAME, CompactingMemStore.class, CompactingMemStore.class);
|
||||||
className = clz.getName();
|
className = clz.getName();
|
||||||
this.memstore = ReflectionUtils.newInstance(clz, new Object[] { conf, this.comparator, this,
|
this.memstore = ReflectionUtils.newInstance(clz, new Object[] { conf, this.comparator, this,
|
||||||
this.getHRegion().getRegionServicesForStores(), inMemoryCompaction});
|
this.getHRegion().getRegionServicesForStores(), inMemoryCompaction });
|
||||||
break;
|
break;
|
||||||
case NONE :
|
case NONE:
|
||||||
default:
|
default:
|
||||||
className = DefaultMemStore.class.getName();
|
className = DefaultMemStore.class.getName();
|
||||||
this.memstore = ReflectionUtils.newInstance(DefaultMemStore.class,
|
this.memstore = ReflectionUtils.newInstance(DefaultMemStore.class,
|
||||||
|
|
Loading…
Reference in New Issue