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

Hamed Madani commented on HBASE-8852:
-------------------------------------

I found most of our scan calls to thrift usually involves opening a scanner , 
getting results and closing the scanner immediately. This could be very 
specific to our use case but I ended up adding a new function to thrift2 server 
to open scanner , get results and close the scanner all in one function. so 
Instead of 3 calls to thrift (openScanner , getScannerRows, closeScanner), we 
just call a new function "getScannerResults" to open scanner , get x number of 
rows, then close scanner all with only one call to thrift server.

If you also think, others might find a new function like this useful , I can 
make a patch. 
 
                
> Close scanners when at end in Thrift 2
> --------------------------------------
>
>                 Key: HBASE-8852
>                 URL: https://issues.apache.org/jira/browse/HBASE-8852
>             Project: HBase
>          Issue Type: Sub-task
>          Components: Thrift
>            Reporter: Lars George
>              Labels: thrift2
>
> HBASE-6073 adds the following to the overall patch:
> {code}
> -      return resultsFromHBase(scanner.next(numRows));
> +      List<TResult> results = resultsFromHBase(scanner.next(numRows));
> +      if(results.size() < numRows) {
> +        removeScanner(scannerId);
> +      }
> +      return results;
> {code}
> We need to see if we have to add this to Thrift2 as separate patch.

--
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