我真的被卡住了。为什么我的 Map/Reducer 类不能显示任何东西?我将以下代码放在我的 Reducer 类中:
@Override
public void reduce(Text key, Iterable<LongWritable> values, Context context)
{
// Standard algorithm for finding the max value
long sum = 0;
for (LongWritable value : values) {
sum++;
}
try
{
context.write(key, new LongWritable(sum));
System.out.println("Reducer exits...");
}
catch (Exception e)
{
System.out.println(e);
}
}
为什么行 "System.out.println("reducer exits...");" 运行 Hadoop 程序时无法在控制台中显示:hadoop jar xxx.jar 输入输出