Package org.jgroups.protocols
Interface Bundler
-
- All Known Implementing Classes:
AlternatingBundler
,AsyncNoBundler
,BaseBundler
,NoBundler
,RemoveQueueBundler
,RingBufferBundler
,RingBufferBundlerLockless
,RingBufferBundlerLockless2
,SenderSendsBundler
,SimplifiedTransferQueueBundler
,TransferQueueBundler
public interface Bundler
Pluggable way to collect messages and send them as batches- Since:
- 4.0
- Author:
- Bela Ban
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default int
getQueueSize()
If 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.default java.util.Map<java.lang.String,java.lang.Object>
getStats()
Returns stats about the bundler itself.default void
init(TP transport)
Called after creation of the bundlerdefault void
resetStats()
void
send(Message msg)
int
size()
The number of unsent messages in the bundlervoid
start()
Called afterinit(TP)
void
stop()
default void
viewChange(View view)
-
-
-
Method Detail
-
init
default void init(TP transport)
Called after creation of the bundler- Parameters:
transport
- the transport, for further reference
-
start
void start()
Called afterinit(TP)
-
stop
void stop()
-
send
void send(Message msg) throws java.lang.Exception
- Throws:
java.lang.Exception
-
viewChange
default void viewChange(View view)
-
size
int size()
The number of unsent messages in the bundler
-
getQueueSize
default int getQueueSize()
If 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.
-
getStats
default java.util.Map<java.lang.String,java.lang.Object> getStats()
Returns stats about the bundler itself.- Returns:
- Stats, may be null
-
resetStats
default void resetStats()
-
-