hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anoop Sam John (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-19047) CP exposed Scanner types should not extend Shipper
Date Thu, 26 Oct 2017 07:29:00 GMT

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

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

Well , I thought abt the case u said. That the core scanner been passed in post hook is just
ignored and new Region#getScanner is been called and returned.  There wont be an issue then.
Only thing is we will miss calling shipped in btw.  The shipped () call allows the ref count
on L2 cached blocks to be decremented and so possibly evicted as needed. If not called, we
will delay the eviction untill the scanner is closed.  
May be we should say in doc abt u can only wrap but should not ignore the passed core scanner?
 I believe many using this wrapping of RegionScanner stuff in post hook. Checked Phoenix and
it is having it. Seems lots of logic in these wrapper places.  I dont think just by allowing
changes in Scan we can give all those possibilities.  I tend to keep the post hook behave
as is.

> CP exposed Scanner types should not extend Shipper
> --------------------------------------------------
>
>                 Key: HBASE-19047
>                 URL: https://issues.apache.org/jira/browse/HBASE-19047
>             Project: HBase
>          Issue Type: Sub-task
>          Components: Coprocessors
>            Reporter: Anoop Sam John
>            Assignee: Anoop Sam John
>             Fix For: 2.0.0-alpha-4
>
>         Attachments: HBASE-19047.patch, HBASE-19047_V2.patch, HBASE-19047_V2.patch
>
>
> Shipper is a IA.Private interface and very much internal.. 
> Right now CP exposed RegionScanner is extending this and so exposing the shipped() method.
This by mistake is called, can harm the correctness of the cells in the Results.
> preScannerOpen() allowing to return a new Scanner is also problematic now.  This can
allow users to create a Region scanner from Region and then wrap it and return back (Well
same can be done by postScannerOpen also), it can so happen that the wrapper is not implementing
the shipped() properly.  In any way exposing the shipped () is problematic.
> Solution Steps
> 1. Remove preScannerOpen() , the use case I can think of is wrapping the original scanner.
The original scanner can be created by Region.getScanner way only..  May be no need to remove
this hook.  Just remove the ability for it to return a RegionScanner instance.  Call this
with the Scan object and the CP can change the Scan object if they want.
> 2. Let RegionScanner not extending Shipper but only RegionScannerImpl implements this
> 3. We have ref to the RegionScanner created by core and let that be used by RegionScannerShippedCallBack
when the post hook doing a wrap.



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

Mime
View raw message