Package org.jgroups.protocols
Class SimplifiedTransferQueueBundler
- java.lang.Object
-
- org.jgroups.protocols.BaseBundler
-
- org.jgroups.protocols.TransferQueueBundler
-
- org.jgroups.protocols.SimplifiedTransferQueueBundler
-
- All Implemented Interfaces:
java.lang.Runnable
,Bundler
public class SimplifiedTransferQueueBundler extends TransferQueueBundler
This bundler uses the same logic asTransferQueueBundler
but does not allocate memory except for the buffer itself and does not use complex data structures.- Author:
- Radim Vansa
-
-
Field Summary
Fields Modifier and Type Field Description protected int
curr
protected static int
MSG_BUF_SIZE
protected Message[]
msg_queue
-
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
-
-
Constructor Summary
Constructors Constructor Description SimplifiedTransferQueueBundler()
SimplifiedTransferQueueBundler(int capacity)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
_sendBundledMessages()
protected void
addMessage(Message msg, long size)
protected void
sendBundledMessages()
Sends all messages in the map.int
size()
Returns the total number of messages in the hashmap-
Methods inherited from class org.jgroups.protocols.TransferQueueBundler
_addMessage, addAndSendIfSizeExceeded, assertPositive, drain, getBufferSize, getDropWhenFull, getQueueSize, getStats, getThread, init, removeQueueSize, removeQueueSize, resetStats, run, send, setDropWhenFull, start, stop
-
Methods inherited from class org.jgroups.protocols.BaseBundler
clearMessages, sendMessageList, sendSingleMessage, viewChange
-
-
-
-
Field Detail
-
MSG_BUF_SIZE
protected static final int MSG_BUF_SIZE
- See Also:
- Constant Field Values
-
msg_queue
protected final Message[] msg_queue
-
curr
protected int curr
-
-
Method Detail
-
size
public int size()
Description copied from class:BaseBundler
Returns the total number of messages in the hashmap- Specified by:
size
in interfaceBundler
- Overrides:
size
in classTransferQueueBundler
-
addMessage
protected void addMessage(Message msg, long size)
- Overrides:
addMessage
in classBaseBundler
-
sendBundledMessages
protected void sendBundledMessages()
Description copied from class:BaseBundler
Sends all messages in the map. Messages for the same destination are bundled into a message list. The map will be cleared when done.- Overrides:
sendBundledMessages
in classBaseBundler
-
_sendBundledMessages
protected void _sendBundledMessages()
- Overrides:
_sendBundledMessages
in classTransferQueueBundler
-
-