[
https://issues.apache.org/jira/browse/HBASE-10750?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13942846#comment-13942846
]
Anoop Sam John commented on HBASE-10750:
----------------------------------------
Thanks for the review and comments Stack.
This is an impl detail only. (Of the DefaultMemStoreImpl as of now) That is
why no traces of the MSLAB in the MemStore interface. The idea of the
interface is that one can use the DefaultMemStore itself but change only the
MSLAB to use an offheap buffer.
bq.Why move the synchronization? Arent' the old and the new equivalent?
Not equivalent. As per the new code
{code}
static MemStoreChunkPool getPool(Configuration conf) {
if (globalInstance != null) return globalInstance;
if (chunkPoolDisabled) return null;
synchronized (MemStoreChunkPool.class) {
...
}
}
{code}
There is a slight diff now.. Previously the MemStore object ,on its create,
created a MemStoreChunkPool object and passing that to MSLAB object creation.
We share the global MemStoreChunkPool any way. As in patch not passing this
MemStoreChunkPool to MSLAB constructor but it calls this getPool() to get the
global object. You can see that after every snapshot op, we have to create
new MSLABs and so the calls to this method will be more and more now (and
possible concurrent also) So tried to avoid the method level synchronization.
As per the new one , outside the synchronization object , checking the global
instance being not null. So 99.99% time there will be no locking happening
with the patch. But without this change, always locking will be needed in this
method call.
bq.Are these implementation details rather than generic across all MSLABs? If
so, should be moved into the implementation:
Let me check Stack.
> Pluggable MemStoreLAB
> ---------------------
>
> Key: HBASE-10750
> URL: https://issues.apache.org/jira/browse/HBASE-10750
> Project: HBase
> Issue Type: Sub-task
> Components: regionserver
> Reporter: Anoop Sam John
> Assignee: Anoop Sam John
> Attachments: HBASE-10750.patch, HBASE-10750_V2.patch
>
>
> This can allow one to have offheap MSLAB also.
> The allocate() returns a byte[] now. This has to be changed to ByteRange so
> that the impl can return on heap byte[] backed BR or offheap buffer backed BR.
--
This message was sent by Atlassian JIRA
(v6.2#6252)