我有一個輸出格式爲SequenceFileOuputFormat
的作業。未找到Hadoop串行器異常
我設置輸出鍵和值類是這樣的:
conf.setOutputKeyClass(IntWritable.class);
conf.setOutputValueClass(SplitInfo.class);
的SplitInfo
類implements Serializable,Writable
我設置io.serializations
屬性如下:
conf.set("io.serializations","org.apache.hadoop.io.serializer.JavaSerialization,"
+ "org.apache.hadoop.io.serializer.WritableSerialization");
然而,在減速器我得到這個錯誤,告訴我Hadoop找不到序列化程序:
java.lang.NullPointerException
at org.apache.hadoop.io.serializer.SerializationFactory.getSerializer(SerializationFactory.java:73)
at org.apache.hadoop.io.SequenceFile$Writer.init(SequenceFile.java:961)
at org.apache.hadoop.io.SequenceFile$Writer.<init>(SequenceFile.java:892)
at org.apache.hadoop.io.SequenceFile.createWriter(SequenceFile.java:393)
at org.apache.hadoop.io.SequenceFile.createWriter(SequenceFile.java:354)
at org.apache.hadoop.io.SequenceFile.createWriter(SequenceFile.java:476)
at org.apache.hadoop.mapreduce.lib.output.SequenceFileOutputFormat.getRecordWriter(SequenceFileOutputFormat.java:61)
at org.apache.hadoop.mapred.ReduceTask$NewTrackingRecordWriter.<init>(ReduceTask.java:569)
at org.apache.hadoop.mapred.ReduceTask.runNewReducer(ReduceTask.java:638)
at org.apache.hadoop.mapred.ReduceTask.run(ReduceTask.java:417)
任何人都可以幫忙嗎?
我也使用DefaultStringifier,這似乎需要io.serialization集。否則它不起作用! – Razvan
對不起,我沒有關注。你不應該需要任何與io.serializations相關的東西來將自定義的Writable值對象寫入SequenceFileOutputFormat。你爲什麼使用DefaultStringifier? –
DefaultStringifier將某些內容存儲在conf文件中 – Razvan