FAQ
Hi all,

I came across this strange error where my MapFile is reading data into object that is passed to it and throws an IOException saying

java.io.IOException: <Some Object>@e5b723 read 2628 bytes, should read 2628

When I went thru the code of SequenceFile.java (line no:1796), I could see this snippet of code which is throwing IOException.
if (valIn.read() > 0) {
LOG.info("available bytes: " + valIn.available());
throw new IOException(val+" read "+(valBuffer.getPosition()-keyLength)
+ " bytes, should read " +
(valBuffer.getLength()-keyLength));
}

Can some one please tell me what is this condition doing and what is it for? I am using hadoop-20. This didn't happen in hadoop-0.18.2.

Thanks
Pallavi

Search Discussions

  • Pallavi Palleti at Sep 18, 2009 at 6:43 am
    Hi all,

    I found a fix for this problem. Before, I was using dataout.writeBytes(str) in my class which implements Writable and the problem is resolved when I used dataout.write(str.getBytes()). I was in the assumption that both do the same. But, looks like it is not. I thought of sharing this information with this group so that it can be useful for others. However, I am still puzzled on what is the difference between them.

    Thanks
    Pallavi

    ----- Original Message -----
    From: "Pallavi Palleti" <pallavi.palleti@corp.aol.com>
    To: common-user@hadoop.apache.org
    Cc: core-user@hadoop.apache.org
    Sent: Thursday, September 17, 2009 6:49:11 PM GMT +05:30 Chennai, Kolkata, Mumbai, New Delhi
    Subject: MapFile throwing IOException though reading data properly

    Hi all,

    I came across this strange error where my MapFile is reading data into object that is passed to it and throws an IOException saying

    java.io.IOException: <Some Object>@e5b723 read 2628 bytes, should read 2628

    When I went thru the code of SequenceFile.java (line no:1796), I could see this snippet of code which is throwing IOException.
    if (valIn.read() > 0) {
    LOG.info("available bytes: " + valIn.available());
    throw new IOException(val+" read "+(valBuffer.getPosition()-keyLength)
    + " bytes, should read " +
    (valBuffer.getLength()-keyLength));
    }

    Can some one please tell me what is this condition doing and what is it for? I am using hadoop-20. This didn't happen in hadoop-0.18.2.

    Thanks
    Pallavi

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcommon-user @
categorieshadoop
postedSep 17, '09 at 1:19p
activeSep 18, '09 at 6:43a
posts2
users1
websitehadoop.apache.org...
irc#hadoop

1 user in discussion

Pallavi Palleti: 2 posts

People

Translate

site design / logo © 2022 Grokbase