Package org.jgroups.protocols
Class AlternatingBundler
- java.lang.Object
-
- org.jgroups.protocols.BaseBundler
-
- org.jgroups.protocols.TransferQueueBundler
-
- org.jgroups.protocols.AlternatingBundler
-
- All Implemented Interfaces:
java.lang.Runnable
,Bundler
public class AlternatingBundler extends TransferQueueBundler
Bundler implementation which sends message batches (or single messages) as soon as the target destination changes (or max_bundler_size would be exceeded).
Messages are removed from the main queue one by one and processed as follows:
A B B C C A causes the following sends: A -> {CC} -> {BB} -> A
Note that null is also a valid destination (send-to-all).
JIRA: https://issues.redhat.com/browse/JGRP-2171- Since:
- 4.0.4
- Author:
- Bela Ban
-
-
Field Summary
Fields Modifier and Type Field Description protected AverageMinMax
avg_batch_size
protected Address
target_dest
protected java.util.List<Message>
target_list
-
Fields inherited from class org.jgroups.protocols.TransferQueueBundler
avg_fill_count, bundler_thread, drop_when_full, num_drops_on_full_queue, num_sends_because_full_queue, num_sends_because_no_msgs, queue, remove_queue, running, THREAD_NAME
-
Fields inherited from class org.jgroups.protocols.BaseBundler
avg_send_time, capacity, count, lock, log, max_size, msgs, output, transport
-
-
Constructor Summary
Constructors Constructor Description AlternatingBundler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
_sendBundledMessages()
protected void
addMessage(Message msg, int size)
java.lang.String
getAverageBatchSize()
void
resetStats()
void
run()
-
Methods inherited from class org.jgroups.protocols.TransferQueueBundler
addAndSendIfSizeExceeded, drain, dropWhenFull, dropWhenFull, getQueueSize, init, removeQueueSize, renameThread, send, size, start, stop
-
Methods inherited from class org.jgroups.protocols.BaseBundler
getCapacity, getMaxSize, sendBundledMessages, sendMessageList, sendSingleMessage, setCapacity, setMaxSize, viewChange
-
-
-
-
Field Detail
-
target_dest
protected Address target_dest
-
target_list
protected final java.util.List<Message> target_list
-
avg_batch_size
protected final AverageMinMax avg_batch_size
-
-
Method Detail
-
getAverageBatchSize
public java.lang.String getAverageBatchSize()
-
resetStats
public void resetStats()
- Specified by:
resetStats
in interfaceBundler
- Overrides:
resetStats
in classTransferQueueBundler
-
run
public void run()
- Specified by:
run
in interfacejava.lang.Runnable
- Overrides:
run
in classTransferQueueBundler
-
_sendBundledMessages
protected void _sendBundledMessages()
-
addMessage
protected void addMessage(Message msg, int size)
- Overrides:
addMessage
in classBaseBundler
-
-