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 asTransferQueueBundlerbut 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 intcurrprotected static intMSG_BUF_SIZEprotected 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 voidaddMessage(Message msg, long size)protected voidsendBundledMessages()Sends all messages in the map.intsize()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:BaseBundlerReturns the total number of messages in the hashmap- Specified by:
sizein interfaceBundler- Overrides:
sizein classTransferQueueBundler
-
addMessage
protected void addMessage(Message msg, long size)
- Overrides:
addMessagein classBaseBundler
-
sendBundledMessages
protected void sendBundledMessages()
Description copied from class:BaseBundlerSends all messages in the map. Messages for the same destination are bundled into a message list. The map will be cleared when done.- Overrides:
sendBundledMessagesin classBaseBundler
-
_sendBundledMessages
protected void _sendBundledMessages()
- Overrides:
_sendBundledMessagesin classTransferQueueBundler
-
-