我在 hadoop 上运行 WordCount 示例,我想读取文件的全部内容。我使用了这里的示例(WholeFileInputFormat-NewAPI.java 和 WholeFileRecordReader-NewAPI.java)。我在我的 WordCount 类中添加了这个: conf.setInputFormat(WholeFileInputFormat.class);
当我编译程序时,我收到以下错误:
error: method setInputFormat in class JobConf cannot be applied to given types;
conf.setInputFormat(WholeFileInputFormat.class);
^
required: Class<? extends InputFormat>
found: Class<WholeFileInputFormat>
reason: argument mismatch; Class<WholeFileInputFormat> cannot be converted to Class<? extends InputFormat>
谢谢你的帮助。