Class BaseBundler
java.lang.Object
org.jgroups.protocols.BaseBundler
- All Implemented Interfaces:
Bundler
- Direct Known Subclasses:
NoBundler, PerDestinationBundler, TransferQueueBundler
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final AverageMinMaxprotected final AverageMinMaxprotected final AverageMinMaxprotected intprotected longprotected booleanDeprecated, for removal: This API element is subject to removal in a future version.protected static final Stringprotected final ReentrantLockprotected Logprotected intMaximum number of bytes for messages to be queued until they are sent.protected MessageProcessingPolicyprotected MsgStatsKeys are destinations, values are lists of Messagesprotected final LongAdderprotected final LongAdderprotected final LongAdderprotected final LongAdderprotected final LongAdderprotected ByteBufferOutputStreamprotected longprotected intprotected SuppressLog<Address> protected longprotected final LongAdderprotected TPprotected booleanprotected boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddMessage(Message msg, int size) doublebooleandropWhenFull(boolean ignored) intIf the bundler implementation supports a capacity, then return it, else return -1intMaximum 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 bundlerprotected voidprotected voidprotected voidlongremoveDelay(long remove_delay) intremoveQueueCapacity(int c) voidvoidprotected voidSends all messages in the map.protected voidsendMessageList(Address dest, Address src, List<Message> list, ByteBufferOutputStream out) protected voidsendMultiple(Address dst, Address sender, List<Message> list, ByteBufferOutputStream out) protected voidsendSingle(Address dst, Message msg, ByteBufferOutputStream out) protected voidsendSingleMessage(Address dest, Message msg, ByteBufferOutputStream out) setCapacity(int c) setMaxSize(int s) intsize()Returns the total number of messages in the hashmapvoidstart()Called afterBundler.init(TP)voidstop()longvoidsuppressLogTimeout(long s) booleanuseRingBuffer(boolean u) booleanuseSingleSenderThread(boolean u) voidviewChange(View view) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Bundler
destroy, renameThread
-
Field Details
-
msgs
-
FUNC
-
transport
-
msg_processing_policy
-
lock
-
count
protected long count -
output
-
msg_stats
-
log
-
suppress_log
-
FMT
- See Also:
-
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 -
capacity
protected int capacity -
remove_queue_capacity
protected int remove_queue_capacity -
use_ringbuffer
protected boolean use_ringbuffer -
use_single_sender_thread
protected boolean use_single_sender_thread -
drop_when_full
Deprecated, for removal: This API element is subject to removal in a future version. -
suppress_log_timeout
protected long suppress_log_timeout -
remove_delay
protected long remove_delay -
avg_fill_count
-
avg_remove_queue_size
-
avg_send_time
-
total_msgs_sent
-
num_single_msgs_sent
-
num_batches_sent
-
num_sends_because_full_queue
-
num_sends_because_no_msgs
-
num_drops_on_full_queue
-
members
-
-
Constructor Details
-
BaseBundler
public BaseBundler()
-
-
Method Details
-
printBuffers
-
getCapacity
public int getCapacity()Description copied from interface:BundlerIf the bundler implementation supports a capacity, then return it, else return -1- Specified by:
getCapacityin interfaceBundler
-
setCapacity
-
removeQueueCapacity
public int removeQueueCapacity() -
removeQueueCapacity
-
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
-
dropWhenFull
public boolean dropWhenFull() -
dropWhenFull
-
useSingleSenderThread
public boolean useSingleSenderThread() -
useSingleSenderThread
-
useRingBuffer
public boolean useRingBuffer() -
useRingBuffer
-
suppressLogTimeout
public long suppressLogTimeout() -
suppressLogTimeout
public void suppressLogTimeout(long s) -
removeDelay
public long removeDelay() -
removeDelay
-
avgBatchSize
public double avgBatchSize() -
init
-
resetStats
public void resetStats()- Specified by:
resetStatsin interfaceBundler
-
start
-
stop
-
send
-
viewChange
- Specified by:
viewChangein interfaceBundler
-
size
-
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
-
sendBundledMessages
protected void 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. -
sendSingle
- Throws:
Exception
-
sendMultiple
-
loopbackUnlessDontLoopbackIsSet
-
loopback
-
loopback
-
sendSingleMessage
protected void sendSingleMessage(Address dest, Message msg, ByteBufferOutputStream out) throws Exception - Throws:
Exception
-
sendMessageList
-
addMessage
-