我们如何知道 SimpleShortestPathsComputation 中 message.get() 的值?
如果我们有Vertex<DoubleWritable, DoubleWritable, DoubleWritable> vertex
而不是
Vertex<LongWritable, DoubleWritable, FloatWritable> vertex
我们如何知道 Messages 的值是 MinDist 而不是 VertextID 或 EdgeValue?
@Override public void compute(
Vertex<LongWritable, DoubleWritable, FloatWritable> vertex,
Iterable<DoubleWritable> messages) throws IOException {
if (getSuperstep() == 0) {
vertex.setValue(new DoubleWritable(Double.MAX_VALUE));
}
double minDist = isSource(vertex) ? 0d : Double.MAX_VALUE;
for (DoubleWritable message : messages) {
minDist = Math.min(minDist, message.get());
}
谢谢