Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Hadoop >> mail # user >> RawLocalFileSystem, getPos and NullPointerException

Copy link to this message
RawLocalFileSystem, getPos and NullPointerException
What is the correct behaviour for getPos  in a record reader, and how
should it behave when the underlying stream is null?  It appears this can
happen in the rawlocalfilesystem.  Not sure if its implemented more safely
in DistributedfileSYstem just yet.
   I've found that the getPos in the RawLocalFileSystem's input stream can
throw a null pointer exception if its underlying stream is closed.

I discovered this when playing with a custom record reader.

to patch it, I simply check if a call to "stream.available()" throws an
exception, and if so, I return 0 in the getPos() function.

The existing getPos() implementation is found here:


What should be the correct behaviour of getPos() in the RecordReader?

Jay Vyas