Package org.jgroups.protocols
Class MFC_NB
- java.lang.Object
-
- org.jgroups.stack.Protocol
-
- org.jgroups.protocols.FlowControl
-
- org.jgroups.protocols.MFC
-
- org.jgroups.protocols.MFC_NB
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.concurrent.Future<?>
credit_send_task
protected int
max_queue_size
protected java.util.function.Consumer<Message>
send_function
-
Fields inherited from class org.jgroups.protocols.MFC
credits, last_credit_request, MFC_CREDIT_REQUEST_HDR, MFC_REPLENISH_HDR
-
Fields inherited from class org.jgroups.protocols.FlowControl
frag_size, max_block_time, max_credits, min_credits, min_threshold, num_credit_requests_received, num_credit_requests_sent, num_credit_responses_received, num_credit_responses_sent, num_msgs_dropped, received, running
-
Fields inherited from class org.jgroups.stack.Protocol
after_creation_hook, down_prot, ergonomics, id, local_addr, log, policies, stack, stats, up_prot
-
-
Constructor Summary
Constructors Constructor Description MFC_NB()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected CreditMap
createCreditMap(long max_creds)
int
getMaxQueueSize()
int
getNumberOfQueuedMessages()
int
getNumberOfQueuings()
int
getQueuedSize()
protected java.lang.Object
handleDownMessage(Message msg, int length)
boolean
isQueuing()
protected void
sendCreditRequestsIfNeeded()
Checks the sent table: if some credits are in queueing mode and credits left are less than min_credits: send a credit requestMFC_NB
setMaxQueueSize(int s)
void
start()
This method is called on aJChannel.connect(String)
; starts work.void
stop()
Called on aJChannel.disconnect()
; stops work (e.g.-
Methods inherited from class org.jgroups.protocols.MFC
getAverageTimeBlocked, getCreditRequestHeader, getNumberOfBlockings, getReplenishHeader, handleCredit, handleMulticastMessage, handleViewChange, init, needToSendCreditRequest, printCredits, printSenderCredits, replenish, resetStats, unblock
-
Methods inherited from class org.jgroups.protocols.FlowControl
adjustCredit, down, down, getMaxBlockTime, getMaxCredits, getMinCredits, getMinThreshold, getNumberOfCreditRequestsReceived, getNumberOfCreditRequestsSent, getNumberOfCreditResponsesReceived, getNumberOfCreditResponsesSent, getReceiverCreditsFor, handleConfigEvent, handleCreditRequest, handleUpEvent, printMap, printReceiverCredits, sendCredit, sendCreditRequest, setMaxBlockTime, setMaxCredits, setMinCredits, setMinThreshold, up, up, up
-
Methods inherited from class org.jgroups.stack.Protocol
accept, addPolicy, addr, addr, afterCreationHook, destroy, down, enableStats, getAddress, getComponents, getDownProtocol, getDownServices, getId, getIdsAbove, getLevel, getLog, getName, getPolicies, getProtocolStack, getSocketFactory, getThreadFactory, getTransport, getUpProtocol, getUpServices, getValue, isErgonomics, level, parse, policies, providedDownServices, providedUpServices, removePolicy, requiredDownServices, requiredUpServices, resetStatistics, setAddress, setDownProtocol, setErgonomics, setId, setLevel, setPolicies, setProtocolStack, setSocketFactory, setUpProtocol, setValue, statsEnabled, toString
-
-
-
-
Field Detail
-
max_queue_size
protected int max_queue_size
-
send_function
protected final java.util.function.Consumer<Message> send_function
-
credit_send_task
protected java.util.concurrent.Future<?> credit_send_task
-
-
Method Detail
-
getMaxQueueSize
public int getMaxQueueSize()
-
setMaxQueueSize
public MFC_NB setMaxQueueSize(int s)
-
isQueuing
public boolean isQueuing()
-
getNumberOfQueuedMessages
public int getNumberOfQueuedMessages()
-
getQueuedSize
public int getQueuedSize()
-
getNumberOfQueuings
public int getNumberOfQueuings()
-
createCreditMap
protected CreditMap createCreditMap(long max_creds)
- Overrides:
createCreditMap
in classMFC
-
start
public void start() throws java.lang.Exception
Description copied from class:Protocol
This method is called on aJChannel.connect(String)
; starts work. Protocols are connected ready to receive events. Will be called from bottom to top.- Specified by:
start
in interfaceLifecycle
- Overrides:
start
in classFlowControl
- Throws:
java.lang.Exception
- Thrown if protocol cannot be started successfully. This will cause the ProtocolStack to fail, soJChannel.connect(String)
will throw an exception
-
stop
public void stop()
Description copied from class:Protocol
Called on aJChannel.disconnect()
; stops work (e.g. by closing multicast socket). Will be called from top to bottom.
-
handleDownMessage
protected java.lang.Object handleDownMessage(Message msg, int length)
- Overrides:
handleDownMessage
in classMFC
-
sendCreditRequestsIfNeeded
protected void sendCreditRequestsIfNeeded()
Checks the sent table: if some credits are in queueing mode and credits left are less than min_credits: send a credit request
-
-