无法在新mapreduce api中将rcfileinputformat设置为inputformatclass

t30tvxxf  于 2021-05-29  发布在  Hadoop
关注(0)|答案(1)|浏览(297)

我正在尝试在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来实现相同的功能。

cedebl8k

cedebl8k1#

RCFileInputFormat 使用旧的mr api调用 mapred . 你需要用一个 mapreduce 应用程序编程接口。环顾四周,你也许可以使用 RCFileMapReduceInputFormat 从这里开始
它似乎与您尝试使用的密钥/值签名相同:

<K extends LongWritable, V extends BytesRefArrayWritable>

相关问题