Buggy code:
public class CBayesThetaDriver { private static final Logger log = LoggerFactory . getLogger ( CBayesThetaDriver . class ) ; private CBayesThetaDriver ( ) { } 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 ( CBayesThetaDriver . class ) ; conf . setOutputKeyClass ( Text . class ) ; conf . setOutputValueClass ( DoubleWritable . class ) ; FileInputFormat . addInputPath ( conf , new Path ( ( output + "//trainer-weights//Sigma_j" ) ) ) ; FileInputFormat . addInputPath ( conf , new Path ( ( output + "//trainer-tfIdf//trainer-tfIdf" ) ) ) ; Path outPath = new Path ( ( output + "//trainer-theta" ) ) ; FileOutputFormat . setOutputPath ( conf , outPath ) ; conf . setMapperClass ( CBayesThetaMapper . class ) ; conf . setInputFormat ( SequenceFileInputFormat . class ) ; conf . setReducerClass ( CBayesThetaReducer . 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 ) ; CBayesThetaDriver . log . info ( "Sigma_k<seq2seq4repair_space>for<seq2seq4repair_space>Each<seq2seq4repair_space>Label" ) ; Map < String , Double > c = mapStringifier . fromString ( labelWeightSumString ) ; CBayesThetaDriver . 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 ) ; CBayesThetaDriver . 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 ) ; CBayesThetaDriver . 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 ) ; CBayesThetaDriver . log . info ( "Vocabulary<seq2seq4repair_space>Count" ) ; conf . set ( "cnaivebayes.vocabCount" , vocabCountString ) ; double retvocabCount = stringifier . fromString ( vocabCountString ) ; CBayesThetaDriver . log . info ( "{}" , retvocabCount ) ; client . setConf ( conf ) ; JobClient . runJob ( conf ) ; } }

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