gpt4 book ai didi

java - hadoop上的自定义类FileInputFormat

转载 作者:行者123 更新时间:2023-12-02 21:53:11 25 4
gpt4 key购买 nike

我正在hadoop上运行WordCount示例,我想读取文件的全部内容。我使用了here中的示例(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>

谢谢你的帮助。

最佳答案

也许您正在使用旧的API,而WholeFileInputFormat是新的API。您也应该使用新的API。

关于java - hadoop上的自定义类FileInputFormat,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18172398/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com