Package org.jgroups.protocols
Class UFC_NB
java.lang.Object
org.jgroups.stack.Protocol
org.jgroups.protocols.FlowControl
org.jgroups.protocols.UFC
org.jgroups.protocols.UFC_NB
- All Implemented Interfaces:
Lifecycle
Non-blocking alternative to
UFC.JIRA: https://issues.redhat.com/browse/JGRP-2172
- Since:
- 4.0.4
-
Field Summary
FieldsFields inherited from class org.jgroups.protocols.UFC
sent, UFC_CREDIT_REQUEST_HDR, UFC_REPLENISH_HDRFields 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, runningFields 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 -
Method Summary
Modifier and TypeMethodDescriptionprotected <T extends Credit>
TcreateCredit(int initial_credits) intintintintgetQueuedMessagesTo(Address dest) intprotected ObjecthandleDownMessage(Message msg, int length) booleanisQueuingTo(Address dest) protected voidChecks the sent table: if some credits are in queueing mode and credits left are less than min_credits: send a credit requestsetMaxQueueSize(int s) voidstart()This method is called on aJChannel.connect(String); starts work.voidstop()Called on aJChannel.disconnect(); stops work (e.g.Methods inherited from class org.jgroups.protocols.UFC
getAverageTimeBlocked, getCreditRequestHeader, getNumberOfBlockings, getReplenishHeader, getSenderCreditsFor, handleCredit, handleMulticastMessage, handleViewChange, printCredits, printSenderCredits, resetStats, unblockMethods inherited from class org.jgroups.protocols.FlowControl
adjustCredit, down, down, getMaxBlockTime, getMaxCredits, getMinCredits, getMinThreshold, getNumberOfCreditRequestsReceived, getNumberOfCreditRequestsSent, getNumberOfCreditResponsesReceived, getNumberOfCreditResponsesSent, getReceiverCreditsFor, handleConfigEvent, handleCreditRequest, handleUpEvent, init, printMap, printReceiverCredits, sendCredit, sendCreditRequest, setMaxBlockTime, setMaxCredits, setMinCredits, setMinThreshold, up, up, upMethods 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 Details
-
max_queue_size
protected int max_queue_size -
send_function
-
credit_send_task
-
-
Constructor Details
-
UFC_NB
public UFC_NB()
-
-
Method Details
-
getMaxQueueSize
public int getMaxQueueSize() -
setMaxQueueSize
-
getNumberOfQueuedMessages
public int getNumberOfQueuedMessages() -
getQueuedSize
public int getQueuedSize() -
getNumberOfQueuings
public int getNumberOfQueuings() -
isQueuingTo
-
getQueuedMessagesTo
-
start
Description copied from class:ProtocolThis 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:
startin interfaceLifecycle- Overrides:
startin classFlowControl- Throws:
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:ProtocolCalled on aJChannel.disconnect(); stops work (e.g. by closing multicast socket). Will be called from top to bottom. -
handleDownMessage
- Overrides:
handleDownMessagein classUFC
-
createCredit
- Overrides:
createCreditin classUFC
-
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
-