use of org.jgroups.annotations.GuardedBy in project JGroups by belaban.
the class DeliveryManagerImpl method getAndSetView.
@GuardedBy("deliverySet")
private View getAndSetView(View newView) {
View oldView = currentView;
currentView = newView;
return oldView;
}
use of org.jgroups.annotations.GuardedBy in project JGroups by belaban.
the class BaseBundler method sendBundledMessages.
/**
* Sends all messages in the map. Messages for the same destination are bundled into a message list.
* The map will be cleared when done.
*/
@GuardedBy("lock")
protected void sendBundledMessages() {
for (Map.Entry<Address, List<Message>> entry : msgs.entrySet()) {
List<Message> list = entry.getValue();
if (list.isEmpty())
continue;
output.position(0);
if (list.size() == 1)
sendSingleMessage(list.get(0));
else {
Address dst = entry.getKey();
sendMessageList(dst, list.get(0).getSrc(), list);
if (transport.statsEnabled())
transport.incrBatchesSent(1);
}
}
clearMessages();
count = 0;
}
use of org.jgroups.annotations.GuardedBy in project JGroups by belaban.
the class BaseBundler method addMessage.
@GuardedBy("lock")
protected void addMessage(Message msg, long size) {
Address dest = msg.getDest();
List<Message> tmp = msgs.computeIfAbsent(dest, k -> new ArrayList<>(5));
tmp.add(msg);
count += size;
}