-RawLocalFileSystem, getPos and NullPointerException
Jay Vyas 2013-09-10, 00:01
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?