Buggy code:
public class BayesThetaNormalizerDriver { private static final Logger log = LoggerFactory . getLogger ( BayesThetaNormalizerDriver . class ) ; private BayesThetaNormalizerDriver ( ) { } public static void main ( String [ ] args ) throws IOException { } public static void runJob ( String input , String output ) throws IOException { JobClient client = new JobClient ( ) ; JobConf conf = new JobConf ( BayesThetaNormalizerDriver . class ) ; conf . setOutputKeyClass ( Text . class ) ; conf . setOutputValueClass ( DoubleWritable . class ) ; FileInputFormat . addInputPath ( conf , new Path ( ( output + "//trainer-tfIdf//trainer-tfIdf" ) ) ) ; Path outPath = new Path ( ( output + "//trainer-thetaNormalizer" ) ) ; FileOutputFormat . setOutputPath ( conf , outPath ) ; conf . setNumMapTasks ( 100 ) ; conf . setMapperClass ( BayesThetaNormalizerMapper . class ) ; conf . setInputFormat ( SequenceFileInputFormat . class ) ; conf . setCombinerClass ( BayesThetaNormalizerReducer . class ) ; conf . setReducerClass ( BayesThetaNormalizerReducer . class ) ; conf . setOutputFormat ( SequenceFileOutputFormat . class ) ; conf . set ( "io.serializations" , "org.apache.hadoop.io.serializer.JavaSerialization,org.apache.hadoop.io.serializer.WritableSerialization" ) ; <START_BUG> FileSystem dfs = FileSystem . get ( conf ) ; <END_BUG> if ( dfs . exists ( outPath ) ) dfs . delete ( outPath , true ) ; Path Sigma_kFiles = new Path ( ( output + "//trainer-weights//Sigma_k//*" ) ) ; Map < String , Double > labelWeightSum = SequenceFileModelReader . readLabelSums ( dfs , Sigma_kFiles , conf ) ; DefaultStringifier < Map < String , Double > > mapStringifier = new DefaultStringifier < Map < String , Double > > ( conf , GenericsUtil . getClass ( labelWeightSum ) ) ; String labelWeightSumString = mapStringifier . toString ( labelWeightSum ) ; BayesThetaNormalizerDriver . log . info ( "Sigma_k<seq2seq4repair_space>for<seq2seq4repair_space>Each<seq2seq4repair_space>Label" ) ; Map < String , Double > c = mapStringifier . fromString ( labelWeightSumString ) ; BayesThetaNormalizerDriver . log . info ( "{}" , c ) ; conf . set ( "cnaivebayes.sigma_k" , labelWeightSumString ) ; Path sigma_kSigma_jFile = new Path ( ( output + "//trainer-weights//Sigma_kSigma_j//*" ) ) ; double sigma_jSigma_k = SequenceFileModelReader . readSigma_jSigma_k ( dfs , sigma_kSigma_jFile , conf ) ; DefaultStringifier < Double > stringifier = new DefaultStringifier < Double > ( conf , Double . class ) ; String sigma_jSigma_kString = stringifier . toString ( sigma_jSigma_k ) ; BayesThetaNormalizerDriver . log . info ( "Sigma_kSigma_j<seq2seq4repair_space>for<seq2seq4repair_space>each<seq2seq4repair_space>Label<seq2seq4repair_space>and<seq2seq4repair_space>for<seq2seq4repair_space>each<seq2seq4repair_space>Features" ) ; double retSigma_jSigma_k = stringifier . fromString ( sigma_jSigma_kString ) ; BayesThetaNormalizerDriver . log . info ( "{}" , retSigma_jSigma_k ) ; conf . set ( "cnaivebayes.sigma_jSigma_k" , sigma_jSigma_kString ) ; Path vocabCountFile = new Path ( ( output + "//trainer-tfIdf//trainer-vocabCount//*" ) ) ; double vocabCount = SequenceFileModelReader . readVocabCount ( dfs , vocabCountFile , conf ) ; String vocabCountString = stringifier . toString ( vocabCount ) ; BayesThetaNormalizerDriver . log . info ( "Vocabulary<seq2seq4repair_space>Count" ) ; conf . set ( "cnaivebayes.vocabCount" , vocabCountString ) ; double retvocabCount = stringifier . fromString ( vocabCountString ) ; BayesThetaNormalizerDriver . log . info ( "{}" , retvocabCount ) ; client . setConf ( conf ) ; JobClient . runJob ( conf ) ; } }

Fix:
FileSystem dfs = FileSystem . get ( outPath . toUri ( ) , conf ) ;