hadoop-common-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Keren Ouaknine <ker...@gmail.com>
Subject RecordReader
Date Wed, 23 Mar 2011 20:51:33 GMT
Hello,

I have a specific RecordReder, named XRR. I would like iterate on split and
create records. Thus, need to position its start attribute. I dont have
enough info from InputSplit. Interface for inputsplit had only getLength and
getLocations.

public class XRecordReader implements RecordReader<Text, XRecord> {

    private long end;
    private long start;
    private long index;

    public XRecordReader(InputSplit split) {
        try {
            // open the file and look for </metadata>
            //Missing split.getPath
            // position 'start' to 0 + first byte after the above tag
            end = start + split.getLength();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

Thanks,
Keren

-- 
Keren Ouaknine
Cell: +972 54 2565404
Web: www.kereno.com

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message