final Channel channel = entry.getKey();
final Iterator<BACKUP> iter = entry.getValue();
for (int i = 0; i < 10; i++) {
if (iter.hasNext()) {
final BACKUP backup = iter.next();
LOG.debug("Replicating {} to channel {}", backup, channel);
channel.write(backup);
} else {
channel.write(Message.BACKUP(-1, -1, null)); // marks the end of the stream
LOG.debug("Finished replicating to channel {}", channel);