[
https://issues.apache.org/jira/browse/HBASE-3348?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12971602#action_12971602
]
HBase Review Board commented on HBASE-3348:
-------------------------------------------
Message from: "Andrew Purtell" <[email protected]>
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://review.cloudera.org/r/1295/#review2066
-----------------------------------------------------------
src/main/java/org/apache/hadoop/hbase/coprocessor/BaseRegionObserverCoprocessor.java
<http://review.cloudera.org/r/1295/#comment6485>
No need to return something. We are assuming the 'result' object is
sufficiently modifiable by its methods. An empty result is passed in to be
populated.
src/main/java/org/apache/hadoop/hbase/coprocessor/BaseRegionObserverCoprocessor.java
<http://review.cloudera.org/r/1295/#comment6486>
We assume the Get is fully modifiable via its methods. Replacing the query
with something else is not a problem: The coprocessor can do just about
anything from the preXXX hooks, populate the Result object with data, then tell
the framework to return without invoking the base function.
src/main/java/org/apache/hadoop/hbase/coprocessor/RegionObserver.java
<http://review.cloudera.org/r/1295/#comment6487>
Ok
src/main/java/org/apache/hadoop/hbase/coprocessor/RegionObserver.java
<http://review.cloudera.org/r/1295/#comment6488>
Yes, if you play with the result but don't call e.bypass() then there is no
impact. To change the result of an increment you need to use postIncrement.
src/main/java/org/apache/hadoop/hbase/regionserver/CoprocessorHost.java
<http://review.cloudera.org/r/1295/#comment6489>
I'll add a note to the javadoc.
- Andrew
> Allow Observers to completely override base function
> ----------------------------------------------------
>
> Key: HBASE-3348
> URL: https://issues.apache.org/jira/browse/HBASE-3348
> Project: HBase
> Issue Type: Sub-task
> Reporter: Andrew Purtell
> Assignee: Andrew Purtell
> Fix For: 0.92.0
>
> Attachments: HBASE-3348.patch
>
>
> Currently an observer can act as a filter or translator but cannot stop a
> subsequent call down to the base method for get, put, delete, etc. This means
> an observer cannot completely override the base function. To deal with this
> we can:
> - Change the preXXX methods to return the same type as the postXXX methods,
> the same return type of the base method.
> - Extend {{Coprocessor.Environment}} with methods that get/set a "should
> continue" flag.
> The framework should check the "should continue" flag before calling the base
> method. If not, just return what was returned by the preXXX method.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.