package Dijkstra;
import java.util.Hashtable;
import java.util.Map;
import cgl.imr.base.Combiner;
import cgl.imr.base.Key;
import cgl.imr.base.SerializationException;
import cgl.imr.base.TwisterException;
import cgl.imr.base.Value;
import cgl.imr.base.impl.JobConf;
public class AllPairsShortestPathCombiner implements Combiner {
private Hashtable<Integer,Node> results;
public AllPairsShortestPathCombiner(){
this.results = new Hashtable<Integer, Node>();
}
public Hashtable<Integer, Node> getResults() {
return this.results;
}
@Override
public void combine(Map<Key, Value> keyValues) throws TwisterException {
for (Value val : keyValues.values()) {
try {
Node node = new Node(val.getBytes());
node.printNode("Nodes combined!");
results.put(node.getID(), node);
} catch (SerializationException e) {
throw new TwisterException(e);
}
}
}
@Override
public void configure(JobConf arg0) throws TwisterException {
}
}