0

我正在尝试使用 Hadoop 的 StreamInputFormat 处理 xml 文件。我正在为此使用更新的API(Hadoop-0.20.205.0)。但是,似乎Job不支持StreamInputFormat,因为当我尝试通过“job.setInputFormatClass(StreamInputFormat.class)”设置属性时,它正在显示 -

"The method setInputFormatClass(Class<? extends InputFormat>) in the type Job is not pplicable for the arguments (Class<StreamInputFormat>)"

我什至已经明确下载了“hadoop-streaming-0.20.205.0.jar”并导入了“org.apache.hadoop.streaming”包,仍然没有运气。有什么建议吗??

4

1 回答 1

1

您正在尝试将旧 API InputFormat (mapred) 与新 API 客户端 Job (mapreduce) 一起使用。

Job.setInputFormat()期待一个类扩展o.a.h.mapreduce.InputFormat(新的“mapreduce”API),其中流式 API 全部写在旧 API(“mapred”包)中,并且StreamInputFormatextendso.a.h.mapred.KeyValueTextInputFormat又扩展o.a.h.mapred.FileInputFormat(两者都是旧 API):

于 2012-06-19T16:56:17.320 回答