// expensive. If this type of iterator is not available, fall back to
// deserializing/serializing the messages
if (vertexIdMessageBytesIterator != null) {
while (vertexIdMessageBytesIterator.hasNext()) {
vertexIdMessageBytesIterator.next();
ExtendedDataOutput extendedDataOutput =
getExtendedDataOutput(partitionMap, vertexIdMessageBytesIterator);
synchronized (extendedDataOutput) {
vertexIdMessageBytesIterator.writeCurrentMessageBytes(
extendedDataOutput);
}
}
} else {
ByteArrayVertexIdMessages<I, M>.VertexIdMessageIterator
vertexIdMessageIterator = messages.getVertexIdMessageIterator();
while (vertexIdMessageIterator.hasNext()) {
vertexIdMessageIterator.next();
ExtendedDataOutput extendedDataOutput =
getExtendedDataOutput(partitionMap, vertexIdMessageIterator);
synchronized (extendedDataOutput) {
vertexIdMessageIterator.getCurrentMessage().write(
extendedDataOutput);