hadoop-common-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From schnitzi <mark.schnitz...@fastsearch.com>
Subject MapFile.Reader and seek
Date Thu, 29 Jan 2009 22:45:51 GMT

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(),
    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(),
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.

View raw message