You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@accumulo.apache.org by "Billie Rinaldi (Commented) (JIRA)" <ji...@apache.org> on 2012/01/03 17:42:39 UTC

[jira] [Commented] (ACCUMULO-226) BatchScanner iterator implementation erroneously returns true for hasNext upon subsequent hasNext calls

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

Billie Rinaldi commented on ACCUMULO-226:
-----------------------------------------

Please resubmit the patch with the "Grant license to ASF" box checked.
                
> BatchScanner iterator implementation erroneously returns true for hasNext upon subsequent hasNext calls
> -------------------------------------------------------------------------------------------------------
>
>                 Key: ACCUMULO-226
>                 URL: https://issues.apache.org/jira/browse/ACCUMULO-226
>             Project: Accumulo
>          Issue Type: Bug
>          Components: client
>    Affects Versions: 1.3.5
>         Environment: Platform independent 
>            Reporter: Matthew Kirkley
>            Assignee: Keith Turner
>              Labels: accumulo, batchscanner
>             Fix For: 1.4.0, 1.5.0
>
>         Attachments: accumulo_TabletServerBatchReaderIterator.patch
>
>
> If you open a batch scanner and iterate through its contents, after hasNext has returned false, subsequent calls to hasNext will return true. Below is a testcase which shows the issue.
>         Connector conn = new Connector(new ZooKeeperInstance("accumulo","localhost"),"root","password".getBytes());
>         BatchScanner scanner = conn.createBatchScanner("test", Constants.NO_AUTHS, 1);
>         scanner.setRanges(Collections.singletonList(new Range()));
>         
>         //exhaust the iterator
>         Iterator it = scanner.iterator();
>         while (it.hasNext()){
>             it.next();
>         }
>         assertFalse("hasNext should be false", it.hasNext());
> I found this issue when wrapping a BatchScanner in a IteratorChain which subsequently seems to call hasNext twice in it's hasNext method.  I will attach a patch which resolves the issue.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira