hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ted Yu (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-9489) Add cp hooks in online merge before and after setting PONR
Date Mon, 25 Nov 2013 19:34:35 GMT

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

Ted Yu commented on HBASE-9489:
-------------------------------

nit:
{code}
+  public void preRollBackMerge(ObserverContext<RegionServerCoprocessorEnvironment>
ctx,
+      HRegion regionA, HRegion regionB) throws IOException { }
+  
+  @Override
+  public void preMergeAfterPONR(ObserverContext<RegionServerCoprocessorEnvironment>
ctx,
+      HRegion regionA, HRegion regionB, HRegion mergedRegion) throws IOException { }
+
+  @Override
+  public void preMergeBeforePONR(ObserverContext<RegionServerCoprocessorEnvironment>
ctx,
+      HRegion regionA, HRegion regionB, List<Mutation> metaEntries) throws IOException
{ }
+  
+  @Override
+  public void postRollBackMerge(ObserverContext<RegionServerCoprocessorEnvironment>
ctx,
+      HRegion regionA, HRegion regionB) throws IOException { }
{code}
Grouping the XXRollBackMerge together would increase readability.
{code}
+   * This will be called after PONR step as part of regions merge transaction Calling
+   * {@link org.apache.hadoop.hbase.coprocessor.ObserverContext#bypass()} has no effect in
this
{code}
A period is missing before 'Calling'. I think wrapping Calling to next line would make the
javadoc more readable.
{code}
+    if (rsCoprocessorHost == null) {
+      rsCoprocessorHost = server != null ? ((HRegionServer) server).getCoprocessorHost()
: null;
+    }
     HRegion mergedRegion = createMergedRegion(server, services);
+    if (rsCoprocessorHost != null) {
+      rsCoprocessorHost.preMergeAfterPONR(this.region_a, this.region_b, mergedRegion);
{code}
rsCoprocessorHost can be created after the call to createMergedRegion().
{code}
+        LOG.error("Row key of mutation from coprossor is not parsable as region name."
+            + "Mutations from coprocessor should only for hbase:meta table.");
{code}
Typo: coprossor
'should only for' -> 'should only be for'
Please include e in the error message.
{code}
+        mergeRegionsAndputMetaEntries(server.getCatalogTracker(), mergedRegion.getRegionInfo(),
region_a
{code}
Make the p in 'put' uppercase.

For CPRegionServerObserver in the test, I see some duplicate code in preMergeBeforePONR().
Can you reuse the code in mergeRegionsAndputMetaEntries() ?

> 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