[
https://issues.apache.org/jira/browse/HBASE-10311?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13867960#comment-13867960
]
Neil Ferguson commented on HBASE-10311:
---------------------------------------
Just made this patch, then realised that I can accomplish what I want by
mapping RegionScanner -> Scan in postScannerOpen, then looking up this map in
preScannerNext and postScannerNext.
VisibilityController seems to do something similar already using a weak
hashmap.
This approach seems a little brittle, since there's theoretically no guarantee
that the scanner that is passed to postScannerOpen is the same on that is
passed to preScannerNext and postScannerNext. Perhaps we should change the docs
to explicitly specify that this will always be the case.
Anyway, since it doesn't involve changing the coprocessor interface, I'll take
this approach. The patch to modify the coprocessor interface is attached if
anyone wants it. Feel free to close this ticket otherwise.
> Add Scan object to preScannerNext and postScannerNext methods on
> RegionObserver
> -------------------------------------------------------------------------------
>
> Key: HBASE-10311
> URL: https://issues.apache.org/jira/browse/HBASE-10311
> Project: HBase
> Issue Type: New Feature
> Components: Coprocessors
> Affects Versions: 0.96.1.1
> Reporter: Neil Ferguson
> Attachments: HBASE-10311.patch
>
>
> I'd like to be able to access the org.apache.hadoop.hbase.client.Scan that
> was used to create a scanner in the RegionObserver.preScannerNext and
> RegionObserver.postScannerNext methods.
> The Scan object is available in the preScannerOpen method, but not in the
> preScannerNext or postScannerNext methods.
> The reason is that I'd like to access the attributes of the Scan object. I
> want to do some resource management in the coprocessor based on some
> attributes of the Scan object (like, who created it).
> Alternatively, does anybody know of another way to get hold of the Scan
> object in these methods without modifying things?
--
This message was sent by Atlassian JIRA
(v6.1.5#6160)