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

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/
-----------------------------------------------------------

Review request for hbase, Jonathan Gray and Mingjie Lai.


Summary
-------

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 patch 
allows observers to 1) keep any subsequently chained observer from executing, 
or 2) prevent default behavior from executing. This latter option allows a 
preXXX hook to completely reimplement something.

I also found and fixed some logic bugs in coprocessor framework integration in 
HRegion.

I will squelch the added extraneous whitespace upon commit.


This addresses bug HBASE-3348.
    http://issues.apache.org/jira/browse/HBASE-3348


Diffs
-----

  
src/main/java/org/apache/hadoop/hbase/coprocessor/BaseRegionObserverCoprocessor.java
 134ed2f 
  src/main/java/org/apache/hadoop/hbase/coprocessor/CoprocessorEnvironment.java 
654b179 
  src/main/java/org/apache/hadoop/hbase/coprocessor/RegionObserver.java 10dfff4 
  src/main/java/org/apache/hadoop/hbase/regionserver/CoprocessorHost.java 
c57ca0c 
  src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java cf9cad0 
  src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java 8248f5f 
  src/test/java/org/apache/hadoop/hbase/coprocessor/SimpleRegionObserver.java 
345790f 
  
src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionObserverStacking.java
 9ef3562 

Diff: http://review.cloudera.org/r/1295/diff


Testing
-------

All coprocessor unit tests pass. No failures of other unit tests observed that 
might be related to these changes.


Thanks,

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.

Reply via email to