Here is the exception that screwed up me on Saturday night and failed my Mapper task.
- Mapper is reading the lines one by one and tokenize it.
- The last token contains a path of a file in HDFS.
- I need to open the file and read the contents.
For the above task, following is the flow I followed in the Mapper.
Worse, my mapper failed with the following exception.
org.apache.hadoop.mapred.MapTask: Ignoring exception during close for org.apache.hadoop.mapred.MapTask$NewTrackingRecordReader@1cb3ec38
java.io.IOException: Filesystem closed
Filesystem object is suppose to be global. When I close the filesystem, the Mapper input is also closed which breaks the complete flow. So I closed only the filestream, but I didn’t close the file system explicitly which resolved the problem.