private MemStore getMemstore() {
    MemStore ms = null;
    // 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").toUpperCase());
    } else {
      inMemoryCompaction = getColumnFamilyDescriptor().getInMemoryCompaction();
    }
    if (inMemoryCompaction == null) {
      inMemoryCompaction =
        MemoryCompactionPolicy.valueOf(conf.get(CompactingMemStore.COMPACTING_MEMSTORE_TYPE_KEY,
          CompactingMemStore.COMPACTING_MEMSTORE_TYPE_DEFAULT).toUpperCase());
    }

    switch (inMemoryCompaction) {
      case NONE:
        Class<? extends MemStore> memStoreClass =
          conf.getClass(MEMSTORE_CLASS_NAME, DefaultMemStore.class, MemStore.class);
        ms = ReflectionUtils.newInstance(memStoreClass,
          new Object[] { conf, getComparator(), this.getHRegion().getRegionServicesForStores() });
        break;
      default:
        Class<? extends CompactingMemStore> compactingMemStoreClass =
          conf.getClass(MEMSTORE_CLASS_NAME, CompactingMemStore.class, CompactingMemStore.class);
        ms =
          ReflectionUtils.newInstance(compactingMemStoreClass, new Object[] { conf, getComparator(),
            this, this.getHRegion().getRegionServicesForStores(), inMemoryCompaction });
    }
    return ms;
  }
Returns MemStore Instance to use in this store.
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java