Return-Path: X-Original-To: apmail-hbase-user-archive@www.apache.org Delivered-To: apmail-hbase-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2D7A110C6C for ; Sat, 20 Jul 2013 22:30:35 +0000 (UTC) Received: (qmail 74146 invoked by uid 500); 20 Jul 2013 22:30:32 -0000 Delivered-To: apmail-hbase-user-archive@hbase.apache.org Received: (qmail 74054 invoked by uid 500); 20 Jul 2013 22:30:32 -0000 Mailing-List: contact user-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@hbase.apache.org Delivered-To: mailing list user@hbase.apache.org Received: (qmail 74046 invoked by uid 99); 20 Jul 2013 22:30:31 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 20 Jul 2013 22:30:31 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of gcjhhu-hbase-user@m.gmane.org designates 80.91.229.3 as permitted sender) Received: from [80.91.229.3] (HELO plane.gmane.org) (80.91.229.3) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 20 Jul 2013 22:30:25 +0000 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1V0ff9-0001wO-0p for user@hbase.apache.org; Sun, 21 Jul 2013 00:30:03 +0200 Received: from c-24-15-218-149.hsd1.il.comcast.net ([24.15.218.149]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 21 Jul 2013 00:30:03 +0200 Received: from jcplerm by c-24-15-218-149.hsd1.il.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 21 Jul 2013 00:30:03 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: user@hbase.apache.org From: Julius Subject: InternalScanner seems in perpetual loop Date: Sat, 20 Jul 2013 22:27:25 +0000 (UTC) Lines: 56 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: sea.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 24.15.218.149 (Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20100101 Firefox/17.0) X-Virus-Checked: Checked by ClamAV on apache.org I'm trying to implement an endpoint coprocessor that among other things, does a scan on region rows. I understand an internalscanner should scan only the rows within its region, and that's what I want. However, the scanner seems to stay in a perpetual loop (the "do/while" below), even though I tried to set start/end keys, max number of versions, etc. If I just leave it running, it never returns. I noticed that when I wrote trace messages to a file, saving just the keys for the scanned rows, the longer I leave it running, the more duplicate records for the same keys I get. Does anyone have any ideas? Thanks, Julius regStartKey = env.getRegion().getStartKey(); regEndKey = env.getRegion().getEndKey(); Scan scan = new Scan(regStartKey,regEndKey); scan.addColumn("cf".getBytes(), "d".getBytes() ); scan.setMaxVersions(1); scan.setBatch(10000); scan.setCaching(10000); scan.setStartRow(regStartKey); scan.setStopRow(regEndKey); InternalScanner scanner = env.getRegion().getScanner(scan); List results = new ArrayList(); results.clear(); scanner.next(results); KeyValue[] resultArray = {}; boolean hasMore = false; do { results.clear(); hasMore = scanner.next(results,1); if (results.size()==0) break; resultArray = results.toArray(resultArray); KeyValue kv = resultArray[0]; byte[] thisKey = kv.getRow(); bw.write( new String(thisKey) + "\n"); nScannedRecs++; } while (hasMore); scanner.close();