Commit 46e243da authored by yorn's avatar yorn

Small robustness fixes

Prevent weight from becoming negative (will just wrap) and limit amount
of supersteps to 64. Both these changes should make no difference.
parent 00a762a0
......@@ -21,7 +21,7 @@ import org.apache.hadoop.io.LongWritable;
public class SpreadRank extends
BasicComputation<LongWritable, IntWritable, LongWritable, LongWritable> {
private static final long MASK_WEIGHT = 0xFFFF000000000000L;
private static final long MASK_WEIGHT = 0x7FFF000000000000L;
private static final long MASK_TIME = 0x000000FFFFFFFFFFFFL;
private static final long STEP_WEIGHT = 0x0001000000000000L;
......@@ -34,6 +34,8 @@ public class SpreadRank extends
sendMessage(e.getTargetVertexId(), new LongWritable(e
.getValue().get()));
}
} else if (this.getSuperstep() == 64) {
vertex.voteToHalt();
} else {
int currentValue = vertex.getValue().get();
for (LongWritable m : messages) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment