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

Lars George commented on HBASE-8852:
------------------------------------

I tried this patch:

{code}
--- 
hbase-server/src/main/java/org/apache/hadoop/hbase/thrift2/ThriftHBaseServiceHandler.java
   (revision 1500028)
+++ 
hbase-server/src/main/java/org/apache/hadoop/hbase/thrift2/ThriftHBaseServiceHandler.java
   (revision )
@@ -328,7 +328,11 @@
     }
 
     try {
-      return resultsFromHBase(scanner.next(numRows));
+      List<TResult> results = resultsFromHBase(scanner.next(numRows));
+      if(results.size() < numRows) {
+        removeScanner(scannerId);
+      }
+      return results;
     } catch (IOException e) {
       throw getTIOError(e);
     }
{code}

but that caused the scan tests of TestThriftHBaseHandler to fail, because the 
closeScanner() call now triggers an TIllegalArgument error, because the scanner 
has been removed implicitly. 

We need a better way I think to handle this implicit closing. Maybe incorporate 
into HBASE-3852 is the better way.
                
> 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