我对reducer的输入值是一个双数组。
719.000 501.000 -75.000
501.000 508.000 -62.000
-75.000 -62.000 10.000
在我的减速机里我需要打印这个矩阵。所以我做了
public void reduce(IntWritable key,
Iterable<DoubleArrayWritable> values, Context context)
throws IOException, InterruptedException {
System.out.println("in reducer");
for (DoubleArrayWritable c :values) { // TODO - test me
System.out.println("C ="+c.toString());
}
}
doublearraywritable在哪里
public static class DoubleArrayWritable extends TwoDArrayWritable {
public DoubleArrayWritable() {
super(DoubleWritable.class);
}
}
我的输出是 C =edu.Driver$DoubleArrayWritable@32d16fe3
但我需要以可读的格式打印整个矩阵。
1条答案
按热度按时间vjrehmav1#
你需要重写
toString()
的DoubleArrayWritable
: