hama-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chui-Hui Chiu <cch...@tigers.lsu.edu>
Subject SSSP Sample code
Date Fri, 28 Jun 2013 20:04:48 GMT
Hello, all,

Here's the "compute" function is the SSSP sample.

@Override
    public void compute(Iterable<IntWritable> messages) throws IOException {
      int minDist = isStartVertex() ? 0 : Integer.MAX_VALUE;

      for (IntWritable msg : messages) {
        if (msg.get() < minDist) {
          minDist = msg.get();
        }
      }

      if (minDist < this.getValue().get()) {
        this.setValue(new IntWritable(minDist));
        for (Edge<Text, IntWritable> e : this.getEdges()) {
          sendMessage(e, new IntWritable(minDist + e.getValue().get()));
        }
      } else {
        voteToHalt();
      }
    }

Why does it fall through the end of the compute() without explicitly
calling the voteToHalt() after sending out all messages?  Does reaching the
end of the compute() imply calling the voteToHalt()?


Thanks,
Chui-hui

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message