我正在尝试在mapper阶段读取rcfiles,我能够在旧的mapredapi中轻松地实现同样的功能。
现在,我重构代码以使用新的mapreduceapi。
使用job而不是jobconf来配置作业属性。但我无法将rcfileinputformat设置为inputformatclass。
下面是我得到的编译错误:
job.setInputFormatClass(RCFileInputFormat.class);
The method setInputFormatClass(Class<? extends InputFormat>) in the type Job is not applicable for the arguments (Class<RCFileInputFormat>)
如何克服这个问题并使用新的mapreduceapi来实现相同的功能。
1条答案
按热度按时间cedebl8k1#
RCFileInputFormat
使用旧的mr api调用mapred
. 你需要用一个mapreduce
应用程序编程接口。环顾四周,你也许可以使用RCFileMapReduceInputFormat
从这里开始它似乎与您尝试使用的密钥/值签名相同: