Class PerDestinationBundler
java.lang.Object
org.jgroups.protocols.BaseBundler
org.jgroups.protocols.PerDestinationBundler
Queues messages per destination ('null' is a special destination). Uses 1 thread per destination to process
queued messages, so it won't scale to many cluster members (unless virtual threads are used).
See https://issues.redhat.com/browse/JGRP-2639 for details.
See https://issues.redhat.com/browse/JGRP-2639 for details.
- Since:
- 5.2.7
- Author:
- Bela Ban
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Map<Address, PerDestinationBundler.SendBuffer> protected Addressprotected final Semaphoreprotected static final Addressprotected Runnerprotected static final StringFields inherited from class BaseBundler
avg_fill_count, avg_remove_queue_size, avg_send_time, capacity, count, drop_when_full, FMT, FUNC, lock, log, max_size, members, msg_processing_policy, msg_stats, msgs, num_batches_sent, num_drops_on_full_queue, num_sends_because_full_queue, num_sends_because_no_msgs, num_single_msgs_sent, output, remove_delay, remove_queue_capacity, suppress_log, suppress_log_timeout, total_msgs_sent, transport, use_ringbuffer, use_single_sender_thread -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionactive()dests()voiddump()intIf 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 bundlerbooleanintprotected voidremoveLeftMembers(List<Address> left_mbrs) voidrun()Blocks on the semaphore until messages are available, then iterates through the send buffers and sends all messages.voidintsize()Returns the total number of messages in the hashmapvoidstart()Called afterBundler.init(TP)voidvoidstop()voidvoidviewChange(View view) Methods inherited from class BaseBundler
addMessage, avgBatchSize, dropWhenFull, dropWhenFull, getCapacity, getMaxSize, loopback, loopback, loopbackUnlessDontLoopbackIsSet, printBuffers, removeDelay, removeDelay, removeQueueCapacity, removeQueueCapacity, resetStats, sendBundledMessages, sendMessageList, sendMultiple, sendSingle, sendSingleMessage, setCapacity, setMaxSize, suppressLogTimeout, suppressLogTimeout, useRingBuffer, useRingBuffer, useSingleSenderThread, useSingleSenderThreadMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Bundler
destroy, renameThread
-
Field Details
-
local_addr
-
dests
-
NULL
-
single_thread_runner
-
THREAD_NAME
- See Also:
-
msgs_available
-
-
Constructor Details
-
PerDestinationBundler
public PerDestinationBundler()
-
-
Method Details
-
isRunning
public boolean isRunning() -
messagesAvailable
public int messagesAvailable() -
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- Overrides:
getQueueSizein classBaseBundler
-
size
public int size()Description copied from class:BaseBundlerReturns the total number of messages in the hashmap- Specified by:
sizein interfaceBundler- Overrides:
sizein classBaseBundler
-
dump
-
active
-
dests
-
init
-
start
public void start()Description copied from interface:BundlerCalled afterBundler.init(TP)- Specified by:
startin interfaceBundler- Overrides:
startin classBaseBundler
-
stop
public void stop()- Specified by:
stopin interfaceBundler- Overrides:
stopin classBaseBundler
-
startSingleThreadRunner
public void startSingleThreadRunner() -
stopSingleThreadRunner
public void stopSingleThreadRunner() -
send
-
doSend
-
run
public void run()Blocks on the semaphore until messages are available, then iterates through the send buffers and sends all messages. When an iteration found no messages to send, the runner calls run() again, blocking on the semaphore until new messages are available in any of the buffers. This is the single_sender_thread (use_single_sender_thread=true) -
viewChange
- Specified by:
viewChangein interfaceBundler- Overrides:
viewChangein classBaseBundler
-
removeLeftMembers
-