[ 
https://issues.apache.org/jira/browse/HBASE-19095?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16224873#comment-16224873
 ] 

Duo Zhang commented on HBASE-19095:
-----------------------------------

Thanks for the explanation. Skimmed the code again, much easier to understand 
now.

There is a flatten operation which is used to make a segment immutable. And 
then we can do merge/compact. In basic mode, we do merging, so we use 
{{MemStoreMergerSegmentsIterator}}, where we use a KeyValueHeap directly to 
skip the SQM logic. In eager mode, we do compaction, so we use 
{{MemStoreCompactorSegmentsIterator }}, where we use a StoreScanner and will 
drop cells.

Agree that we could provide a preInMemoryCompactScannerOpen method which allow 
users to change the max versions and TTL. And we could also change the 
StoreScanner field in {{MemStoreCompactorSegmentsIterator}} to InternalScanner, 
and add a preInMemoryCompact method which allow users to do filtering.

And seems there is no selection so we do not need 
(pre/post)InMemoryCompactSelection methods, so the only unsure method is 
postInMemoryCompact. For compaction and flush we have a similar method, but I 
do not think it is very useful for in memory compaction? Anyway, no harm to add 
it I think.

Let me provide a patch.

Thanks.

> Add CP hooks in RegionObserver for in memory compaction
> -------------------------------------------------------
>
>                 Key: HBASE-19095
>                 URL: https://issues.apache.org/jira/browse/HBASE-19095
>             Project: HBase
>          Issue Type: Sub-task
>          Components: Coprocessors
>            Reporter: Duo Zhang
>             Fix For: 2.0.0-beta-1
>
>
> This is a hole in our CP hooks.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to