Return-Path: X-Original-To: apmail-incubator-accumulo-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-accumulo-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0F15F79B2 for ; Fri, 23 Dec 2011 16:00:53 +0000 (UTC) Received: (qmail 45613 invoked by uid 500); 23 Dec 2011 16:00:53 -0000 Delivered-To: apmail-incubator-accumulo-dev-archive@incubator.apache.org Received: (qmail 45584 invoked by uid 500); 23 Dec 2011 16:00:52 -0000 Mailing-List: contact accumulo-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: accumulo-dev@incubator.apache.org Delivered-To: mailing list accumulo-dev@incubator.apache.org Received: (qmail 45572 invoked by uid 99); 23 Dec 2011 16:00:52 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 23 Dec 2011 16:00:52 +0000 X-ASF-Spam-Status: No, hits=-2002.5 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 23 Dec 2011 16:00:51 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id EF962125235 for ; Fri, 23 Dec 2011 16:00:30 +0000 (UTC) Date: Fri, 23 Dec 2011 16:00:30 +0000 (UTC) From: "Keith Turner (Updated) (JIRA)" To: accumulo-dev@incubator.apache.org Message-ID: <2141209715.42706.1324656030982.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1552109620.26621.1324311330629.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Updated] (ACCUMULO-226) BatchScanner iterator implementation erroneously returns true for hasNext upon subsequent hasNext calls MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/ACCUMULO-226?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Keith Turner updated ACCUMULO-226: ---------------------------------- Resolution: Fixed Status: Resolved (was: Patch Available) > 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