use of org.jgroups.util.MessageBatch in project JGroups by belaban.
the class SEQUENCER2 method removeAndDeliver.
protected void removeAndDeliver(Table<Message> win, Address sender) {
AtomicInteger adders = win.getAdders();
if (adders.getAndIncrement() != 0)
return;
final MessageBatch batch = new MessageBatch(win.size()).dest(local_addr).sender(sender).multicast(false);
Supplier<MessageBatch> batch_creator = () -> batch;
do {
try {
batch.reset();
win.removeMany(true, 0, null, batch_creator, BATCH_ACCUMULATOR);
} catch (Throwable t) {
log.error("failed removing messages from table for " + sender, t);
}
if (!batch.isEmpty()) {
// batch is guaranteed to NOT contain any OOB messages as the drop_oob_msgs_filter removed them
deliverBatch(batch);
}
} while (adders.decrementAndGet() != 0);
}
Aggregations