IOException {
LongWritable reusableVertexId = new LongWritable();
DoubleWritable reusableMessage = new DoubleWritable();
DoubleWritable reusableCurrentMessage = new DoubleWritable();
Long2DoubleOpenHashMap partitionMap = map.get(partitionId);
synchronized (partitionMap) {
VertexIdMessageIterator<LongWritable, DoubleWritable> iterator =
messages.getVertexIdMessageIterator();
while (iterator.hasNext()) {
iterator.next();
long vertexId = iterator.getCurrentVertexId().get();
double message = iterator.getCurrentMessage().get();
if (partitionMap.containsKey(vertexId)) {
reusableVertexId.set(vertexId);
reusableMessage.set(message);
reusableCurrentMessage.set(partitionMap.get(vertexId));
messageCombiner.combine(reusableVertexId, reusableCurrentMessage,
reusableMessage);
message = reusableCurrentMessage.get();
}
partitionMap.put(vertexId, message);
}
}
}