[
https://issues.apache.org/jira/browse/HBASE-8946?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13714406#comment-13714406
]
Lars George commented on HBASE-8946:
------------------------------------
As for the test, we should also add
{code}
try {
// close scanner and check that it was indeed closed
handler.closeScanner(scanId);
fail("Scanner id should be invalid");
} catch (TIllegalArgument e) {
}
{code}
to check that the scanner is indeed closed implicitly.
As for the comment, maybe change it to
{noformat}
/**
* Closes the scanner. Should be called to free server side resources timely.
* Typically close once the scanner is not needed anymore, i.e. after looping
* over it to get all the required rows.
*/
{noformat}
Makes sense? I am a friend of good and explanatory commenting :)
Otherwise the patch and test apply and run fine, if you could put those final
touches on it [~madani], that would be great! And a patch for 0.94 at the same
time? Appreciated :)
> Add a new function to Thrift 2 to open scanner, get results and close scanner
> -----------------------------------------------------------------------------
>
> Key: HBASE-8946
> URL: https://issues.apache.org/jira/browse/HBASE-8946
> Project: HBase
> Issue Type: Sub-task
> Components: Thrift
> Reporter: Hamed Madani
> Labels: thrift2
> Attachments: HBASE-8946.patch, HBASE-8946-V2.patch,
> HBASE-8946-V3.patch
>
>
> We found, very often we open a scanner , get x number of rows , then close
> the scanner immediately. The attached patch , add a new function
> *getScannerResults* that does just that.
> Using getScannerResults function reduce number of calls to thrift server.
> Also since the scanner gets closed immediately, it is less prone to cause
> memory leak.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira