Configuration conf = job.getConfiguration();
Properties props = ConfigurationUtil.toProperties(conf);
// since local mode now is implemented as hadoop's local mode
// we can treat either local or hadoop mode as hadoop mode - hence
// we can use HDataStorage and FileLocalizer.openDFSFile below
HDataStorage storage = new HDataStorage(props);
if (!FileLocalizer.fileExists(location, storage)) {
// At compile time in batch mode, the file may not exist
// (such as intermediate file). Just return null - the
// same way as we would if we did not get a valid record
return null;