package com.ibm.giraph.graph.example.sssp;

import java.io.IOException;
import org.apache.giraph.graph.VertexCombiner;
import org.apache.hadoop.io.DoubleWritable;
import org.apache.hadoop.io.LongWritable;

import com.ibm.giraph.utils.UnmodifiableSingleItem;

public class MinCombiner extends VertexCombiner<LongWritable, DoubleWritable>
{
	@Override
	public Iterable<DoubleWritable> combine(LongWritable vertexIndex,
			Iterable<DoubleWritable> messages) throws IOException {
		double sum=Double.MAX_VALUE;
		for (DoubleWritable w : messages)
		{
			sum = Math.min(sum, w.get());
			System.out.println("In minCombiner: " + sum + " " + w.get());
		}
		return (Iterable<DoubleWritable>) new UnmodifiableSingleItem<DoubleWritable>(new DoubleWritable(sum));
	}

}
@@ -577,73 +577,8 @@
 ));%0A
-%09%09%09System.out.println(%22In minCombiner: %22 + sum + %22 %22 + w.get());%0A
 %09%09%7D%0A

debug sssp