hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gary Helmling (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-9489) Add cp hooks in online merge before and after setting PONR
Date Wed, 27 Nov 2013 17:12:36 GMT

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

Gary Helmling commented on HBASE-9489:
--------------------------------------

I don't understand the API that this patch is adding:
{code}
+  void preMergeBeforePONR(final ObserverContext<RegionServerCoprocessorEnvironment>
ctx,
+      final HRegion regionA, final HRegion regionB, List<Mutation> metaEntries) throws
IOException;

+  void preMergeAfterPONR(final ObserverContext<RegionServerCoprocessorEnvironment>
ctx,
+      final HRegion regionA, final HRegion regionB, final HRegion mergedRegion) throws IOException;
{code}

Generally, "before" and "after" are what the "pre" and "post" hooks are used for respectively.
 Having a "pre...Before" and "pre...After" hook suggests to me that the API is unclear.  It
instead looks to me like these 2 methods are actually a "pre" and "post" hook around a single
action.  Maybe something like preMergeCommit / postMergeCommit would be better?

I'm also not sure I understand the usage of ObserverContext.bypass() related to these two
methods.  bypass() normally means "skip the normal processing".  But in preMergeBeforePONR(),
according to the javadoc, it will actually _abort_ the merge.  It seems like using a return
value to indicate whether to proceed or abort would be more appropriate.  For preMergeAfterPONR(),
the javadoc says that bypass is ignored, which is unusual for a "pre" method.  It would make
more sense for bypass() to be ignored if this were a "post" method (say "postMergeCommit").

> Add cp hooks in online merge before and after setting PONR
> ----------------------------------------------------------
>
>                 Key: HBASE-9489
>                 URL: https://issues.apache.org/jira/browse/HBASE-9489
>             Project: HBase
>          Issue Type: Sub-task
>            Reporter: rajeshbabu
>            Assignee: rajeshbabu
>         Attachments: HBASE-9489.patch, HBASE-9489_v2.patch
>
>
> As we need to merge index region along with user region we need the hooks before and
after setting PONR in region merge transtion.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Mime
View raw message