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

Hamed Madani commented on HBASE-8946:
-------------------------------------

The function never returns scanId, it simply returns the results , so I'm not 
sure what I should use in place of *scanId* in
{code}
 try {
      // close scanner and check that it was indeed closed
      handler.closeScanner(scanId);   <----------------------- scanId is 
undefined
      fail("Scanner id should be invalid");
    } catch (TIllegalArgument e) {
    }
{code}

regarding HBASE-3852, as you mentioned the only time user benefits from closing 
the scanner when it's exhausted, is when the user knows exactly how many rows 
the scanner suppose to return, but doesn't want to get all the results in one 
call (i.e doesn't want to use scannerGetResults). I'm not sure if such a use 
case exists and justifies an additional if statement to all the scanner calls, 
but I could be wrong :)  

                
> 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

Reply via email to