Package org.jgroups.protocols
Class PerDestinationBundler
java.lang.Object
org.jgroups.protocols.PerDestinationBundler
- All Implemented Interfaces:
Bundler
Queues messages per destination ('null' is a special destination), sending when the last sender thread to the same
destination returns or max_size has been reached. This uses 1 thread per destination, so it won't scale to many
cluster members (unless virtual threads are used).
See https://issues.redhat.com/browse/JGRP-2639 for details.
- Since:
- 5.2.7
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Map<Address, PerDestinationBundler.SendBuffer> protected Addressprotected Logprotected intMaximum number of bytes for messages to be queued until they are sent.protected static final Addressprotected final LongAdderprotected final LongAdderprotected final LongAdderprotected final LongAdder(package private) final Profiler(package private) final Profiler(package private) final Profilerprotected static final Stringprotected final LongAdderprotected TP -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoubleintMaximum number of bytes for messages to be queued until they are sentintIf the bundler has a queue and it should be managed by a queuing discipline (like Random Early Detection), then return the number of elements in the queue, else -1.voidCalled after creation of the bundlervoidvoidsetMaxSize(int s) intsize()The number of unsent messages in the bundlervoidstart()Called afterBundler.init(TP)voidstop()voidviewChange(View view) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jgroups.protocols.Bundler
getCapacity, renameThread
-
Field Details
-
max_size
protected int max_sizeMaximum number of bytes for messages to be queued until they are sent. This value needs to be smaller than the largest datagram packet size in case of UDP -
total_msgs_sent
-
num_single_msgs_sent
-
num_batches_sent
-
num_send_due_to_no_msgs
-
num_sends_due_to_max_size
-
transport
-
log
-
local_addr
-
dests
-
NULL
-
THREAD_NAME
- See Also:
-
p_send_msg_list
-
p_send_single_msg
-
p_send_msgs
-
-
Constructor Details
-
PerDestinationBundler
public PerDestinationBundler()
-
-
Method Details
-
size
public int size()Description copied from interface:BundlerThe number of unsent messages in the bundler -
getQueueSize
public int getQueueSize()Description copied from interface:BundlerIf the bundler has a queue and it should be managed by a queuing discipline (like Random Early Detection), then return the number of elements in the queue, else -1. In the latter case, the queue won't be managed.This method needs to be fast as it might get called on every message to be sent.
- Specified by:
getQueueSizein interfaceBundler
-
getMaxSize
public int getMaxSize()Description copied from interface:BundlerMaximum number of bytes for messages to be queued until they are sent- Specified by:
getMaxSizein interfaceBundler
-
setMaxSize
- Specified by:
setMaxSizein interfaceBundler
-
avgBatchSize
public double avgBatchSize() -
resetStats
public void resetStats()- Specified by:
resetStatsin interfaceBundler
-
init
Description copied from interface:BundlerCalled after creation of the bundler -
start
public void start()Description copied from interface:BundlerCalled afterBundler.init(TP) -
stop
public void stop() -
send
-
viewChange
- Specified by:
viewChangein interfaceBundler
-