Return-Path: Delivered-To: apmail-hadoop-core-user-archive@www.apache.org Received: (qmail 58253 invoked from network); 29 Jan 2009 22:46:28 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 29 Jan 2009 22:46:28 -0000 Received: (qmail 62069 invoked by uid 500); 29 Jan 2009 22:46:22 -0000 Delivered-To: apmail-hadoop-core-user-archive@hadoop.apache.org Received: (qmail 61591 invoked by uid 500); 29 Jan 2009 22:46:21 -0000 Mailing-List: contact core-user-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: core-user@hadoop.apache.org Delivered-To: mailing list core-user@hadoop.apache.org Received: (qmail 61580 invoked by uid 99); 29 Jan 2009 22:46:21 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 29 Jan 2009 14:46:21 -0800 X-ASF-Spam-Status: No, hits=2.6 required=10.0 tests=DNS_FROM_OPENWHOIS,SPF_HELO_PASS,SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 29 Jan 2009 22:46:12 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1LSfdv-0001ym-Vs for core-user@hadoop.apache.org; Thu, 29 Jan 2009 14:45:51 -0800 Message-ID: <21737717.post@talk.nabble.com> Date: Thu, 29 Jan 2009 14:45:51 -0800 (PST) From: schnitzi To: core-user@hadoop.apache.org Subject: MapFile.Reader and seek MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: mark.schnitzius@fastsearch.com X-Virus-Checked: Checked by ClamAV on apache.org Greetings all... I have a situation where I want to read a range of keys and values out of a MapFile. So I have something like this: MapFile.Reader indexReader = new MapFile.Reader(fs, path.toString(), configuration) boolean seekSuccess = indexReader.seek(from); boolean readSuccess = indexReader.next(keyValue, value); while (readSuccess && ...) The problem seems to be that while seekSuccess is returning true, when I call next() to get the value there, it's returning the value *after* the key that I called seek() on. So if, say, my keys are Text("id0") through Text("id9"), and I seek for Text("id3"), calling next() will return Text("id4") and its associated value, not Text("id3"). I would expect next() to return the key/value at the seek location, not the one after it. Am I doing something wrong? Otherwise, what good is seek(), really? -- View this message in context: http://www.nabble.com/MapFile.Reader-and-seek-tp21737717p21737717.html Sent from the Hadoop core-user mailing list archive at Nabble.com.