You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-user@hadoop.apache.org by Pallavi Palleti <pa...@corp.aol.com> on 2009/09/17 15:19:11 UTC

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