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

Anoop Sam John commented on HBASE-19356:
----------------------------------------

Good points by Appy. I got what he say abt the diff wrt the RegionObserver kind 
of interface with def impl and issue on delegatee model with RegionScanner. 
We have postScannerOpen hook which takes RegionScanner object which the core 
created and allows the CP User to return a RegionScanner object. This will be 
mostly (or for sure) a wrapper instance.  So CP has to impl all methods and 
delgate calls.
Ya we wont have ref to delegates if give it for CPs. That arg , read it
But for these kind of cp hooks, can we make a change? 
RegionScanner postScannerOpen(ObserverContext<RegionCoprocessorEnvironment> c, 
Scan scan, RegionScanner s)   ->
RegionScannerDelegator 
postScannerOpen(ObserverContext<RegionCoprocessorEnvironment> c, Scan scan, 
RegionScanner s)
The CP itself returns a wrapper/Delegator type which we provide. This takes the 
original RegionScanner and just delegates calls for all APIs.  If user need a 
wrapping, what he can do is create a new wrapper extending the 
RegionScannerWrapper and overriding the needed method. And any way they have to 
call delegatee also in their impl at the appropriate place.
So the CP contact itself says it clearly that the hook allows the user wrap the 
original object. Not create a fresh new RegionScanner impl ignoring the one 
core created.

> Provide delegators and base implementation for Phoenix implemented interfaces
> -----------------------------------------------------------------------------
>
>                 Key: HBASE-19356
>                 URL: https://issues.apache.org/jira/browse/HBASE-19356
>             Project: HBase
>          Issue Type: Improvement
>            Reporter: James Taylor
>
> Many of the changes Phoenix needs to make for various branches to support 
> different versions of HBase are due to new methods being added to interfaces. 
> Often times Phoenix can  use a noop or simply needs to add the new method to 
> it's delegate implementor. It'd be helpful if HBase provided base 
> implementations and delegates that Phoenix could use instead. Here are some 
> that come to mind:
> - RegionScanner
> - HTableInterface (Table interface now?)
> - RegionObserver
> There are likely others that [~rajeshbabu], [[email protected]], and 
> [~elserj] would remember.



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

Reply via email to