Hi Friends,
Trying to run the example of shortest path calculation algorithm from
"ECLIPSE"
my input file value is:
[0,0,[[1,1],[3,3]]]
[1,0,[[0,1],[2,2],[3,1]]]
[2,0,[[1,2],[4,4]]]
[3,0,[[0,3],[1,1],[4,4]]]
[4,0,[[3,4],[2,4]]]
my run argument in eclipse is :
com.rii.giraph.learn.SimpleShortestPathComputation -vif
org.apache.giraph.io.formats.JsonLongDoubleFloatDoubleVertexInputFormat
-vip /home/user/workspace/GiraphProject/input/graph-input
-vof org.apache.giraph.io.formats.IdWithValueTextOutputFormat -op
/home/user/workspace/GiraphProject/output -w 1
But it is not creating any output, but I am getting warning as:
15/01/19 05:33:23 INFO utils.ConfigurationUtils: No edge input format
specified. Ensure your InputFormat does not require one.
15/01/19 05:33:23 INFO utils.ConfigurationUtils: No edge output format
specified. Ensure your OutputFormat does not require one.
My compute method is as follows:
@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());
}
if (LOG.isDebugEnabled()) {
LOG.debug("Vertex " + vertex.getId() + " got minDist = " + minDist +
" vertex value = " + vertex.getValue());
}
if (minDist < vertex.getValue().get()) {
vertex.setValue(new DoubleWritable(minDist));
for (Edge<LongWritable, FloatWritable> edge : vertex.getEdges()) {
double distance = minDist + edge.getValue().get();
if (LOG.isDebugEnabled()) {
LOG.debug("Vertex " + vertex.getId() + " sent to " +
edge.getTargetVertexId() + " = " + distance);
}
sendMessage(edge.getTargetVertexId(), new DoubleWritable(distance));
}
}
vertex.voteToHalt();
}
Please help.
--
*Thanks & Regards*
*Phalguni Mukherjee*