// expensive. If this type of iterator is not available, fall back to
// deserializing/serializing the messages
if (vertexIdMessageBytesIterator != null) {
while (vertexIdMessageBytesIterator.hasNext()) {
vertexIdMessageBytesIterator.next();
DataInputOutput dataInputOutput =
getDataInputOutput(partitionMap, vertexIdMessageBytesIterator);
synchronized (dataInputOutput) {
vertexIdMessageBytesIterator.writeCurrentMessageBytes(
dataInputOutput.getDataOutput());
}
}
} else {
VertexIdMessageIterator<I, M> vertexIdMessageIterator =
messages.getVertexIdMessageIterator();
while (vertexIdMessageIterator.hasNext()) {
vertexIdMessageIterator.next();
DataInputOutput dataInputOutput =
getDataInputOutput(partitionMap, vertexIdMessageIterator);
synchronized (dataInputOutput) {
VerboseByteStructMessageWrite.verboseWriteCurrentMessage(
vertexIdMessageIterator, dataInputOutput.getDataOutput());
}
}
}
}