[
https://issues.apache.org/jira/browse/HBASE-26476?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
chenglei updated HBASE-26476:
-----------------------------
Description:
When {{HStore.memstore}} is {{DefaultMemStore}} , I find that it is
impossible to extend {{DefaultMemStore}} to add some custom logic when I was
work on HBASE-26465, because following code in {{HStore.getMemstore}} and
{{HStore.getMemstore}} is a private method and is called in {{HStore}} ctor :
{code:java}
switch (inMemoryCompaction) {
case NONE:
ms = ReflectionUtils.newInstance(DefaultMemStore.class,
new Object[] { conf, getComparator(),
this.getHRegion().getRegionServicesForStores()});
break;
default:
Class<? extends CompactingMemStore> clz =
conf.getClass(MEMSTORE_CLASS_NAME,
CompactingMemStore.class, CompactingMemStore.class);
ms = ReflectionUtils.newInstance(clz, new Object[]{conf,
getComparator(), this,
this.getHRegion().getRegionServicesForStores(),
inMemoryCompaction});
}
return ms;
}
{code}
was:
When {{HStore.memstore}} is {{DefaultMemStore}} , I find that it is
impossible to extend {{DefaultMemStore}} to add some custom logic when in
HBASE-26465, because following code in {{HStore.getMemstore}} and
{{HStore.getMemstore}} is a private method and is called in {{HStore}} ctor :
{code:java}
switch (inMemoryCompaction) {
case NONE:
ms = ReflectionUtils.newInstance(DefaultMemStore.class,
new Object[] { conf, getComparator(),
this.getHRegion().getRegionServicesForStores()});
break;
default:
Class<? extends CompactingMemStore> clz =
conf.getClass(MEMSTORE_CLASS_NAME,
CompactingMemStore.class, CompactingMemStore.class);
ms = ReflectionUtils.newInstance(clz, new Object[]{conf,
getComparator(), this,
this.getHRegion().getRegionServicesForStores(),
inMemoryCompaction});
}
return ms;
}
{code}
> Make DefaultMemStore extensible for HStore.memstore
> ----------------------------------------------------
>
> Key: HBASE-26476
> URL: https://issues.apache.org/jira/browse/HBASE-26476
> Project: HBase
> Issue Type: Bug
> Affects Versions: 3.0.0-alpha-1, 2.4.8
> Reporter: chenglei
> Assignee: chenglei
> Priority: Major
>
> When {{HStore.memstore}} is {{DefaultMemStore}} , I find that it is
> impossible to extend {{DefaultMemStore}} to add some custom logic when I was
> work on HBASE-26465, because following code in {{HStore.getMemstore}} and
> {{HStore.getMemstore}} is a private method and is called in {{HStore}} ctor :
> {code:java}
> switch (inMemoryCompaction) {
> case NONE:
> ms = ReflectionUtils.newInstance(DefaultMemStore.class,
> new Object[] { conf, getComparator(),
> this.getHRegion().getRegionServicesForStores()});
> break;
> default:
> Class<? extends CompactingMemStore> clz =
> conf.getClass(MEMSTORE_CLASS_NAME,
> CompactingMemStore.class, CompactingMemStore.class);
> ms = ReflectionUtils.newInstance(clz, new Object[]{conf,
> getComparator(), this,
> this.getHRegion().getRegionServicesForStores(),
> inMemoryCompaction});
> }
> return ms;
> }
> {code}
--
This message was sent by Atlassian Jira
(v8.20.1#820001)