currentPartition.put(m.getDestinationVertex(), messageList);
}
// once the expected number of messages is met, begins the message sending operation
if (messageCounter >= maxMessages) {
Messages messagesToBeSent = new Messages(messageClass);
// collects the messages associated to each key and adds them to a Messages object to be sent
for (Collection<Message<? extends Writable>> ms : currentPartition.values()) {
for (Message<? extends Writable> message : ms) {
messagesToBeSent.add(message);
}
}
// logger stuff
omqLogger
.info(this.toString() + " Partition: " + Integer.toString(partitionId)
+ "Sending bulk messages. Count: " + messageCounter + ", " + messagesToBeSent.size());
omqLogger.info(messageClass.getName());
// sends the Messages to the partition as specified over RPC, then creates a fresh, empty Map in its
// place
orbClients.get(messageHash).sendMessages(messagesToBeSent);