gpt4 book ai didi

java - 在 hadoop reducer 中重写

转载 作者:行者123 更新时间:2023-12-01 13:37:45 25 4
gpt4 key购买 nike

我是 hadoop 的初学者。我决定创建一个情感分析程序。我有一个映射器类。映射器的输出是 LongWritable 和文本格式。这是 reducer 的输入。因此我有一个 reducer 类作为

public class sentreducer extends Reducer<LongWritable,Text,LongWritable,Text>{
@Override
public void reduce(LongWritable key,Iterable<Text>value,Context context){
}

编译器显示错误,指出该方法无法被重写。为什么会这样?

最佳答案

方法签名应该是

public void reduce(LongWritable key, Iterator<Text> values,
OutputCollector<LongWritable, Text> collector, Reporter reporter) throws IOException

关于java - 在 hadoop reducer 中重写,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21137168/

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