Package org.jgroups.protocols
Class NAKACK4
- java.lang.Object
-
- org.jgroups.stack.Protocol
-
- org.jgroups.protocols.ReliableMulticast
-
- org.jgroups.protocols.NAKACK4
-
- All Implemented Interfaces:
Lifecycle
,DiagnosticsHandler.ProbeHandler
public class NAKACK4 extends ReliableMulticast
New multicast protocols based on fixed-size xmit windows and message ACKsDetails: https://issues.redhat.com/browse/JGRP-2780 - Since:
- 5.4
- Author:
- Bela Ban
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.jgroups.protocols.ReliableMulticast
ReliableMulticast.LastSeqnoResender, ReliableMulticast.RetransmitTask
-
-
Field Summary
Fields Modifier and Type Field Description protected AckTable
ack_table
protected java.util.concurrent.atomic.LongAdder
acks_received
protected int
capacity
protected boolean
send_atomically
protected static Buffer.Options
SEND_OPTIONS
-
Fields inherited from class org.jgroups.protocols.ReliableMulticast
avg_batch_size, BATCH_ACCUMULATOR, batches, become_server_queue, become_server_queue_size, digest_history, discard_delivered_msgs, DUMMY_OOB_MSG, HAS_HEADER, is_server, is_trace, last_seqno_resender, leaving, local_xmit_table, log_discard_msgs, log_not_found_msgs, max_batch_size, max_xmit_req_size, members, no_dummy_and_no_oob_delivered_msgs_and_no_dont_loopback_msgs, num_messages_received, num_messages_sent, remove_filter, reuse_message_batches, running, sends_can_block, seqno, SEQNO_GETTER, stability_msgs, stable_xmit_map, suppress_log_non_member, suppress_time_non_member_warnings, timer, use_mcast_xmit, use_mcast_xmit_req, view, xmit_from_random_member, xmit_interval, xmit_reqs_received, xmit_reqs_sent, xmit_rsps_received, xmit_rsps_sent, xmit_table, xmit_task, xmit_task_map
-
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 NAKACK4()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
adjustReceivers(java.util.List<Address> members)
Removes old members from xmit-table and adds new members to xmit-table (at seqnos hd=0, hr=0).protected int
capacity()
protected NAKACK4
capacity(int c)
protected Buffer<Message>
createXmitWindow(long initial_seqno)
void
destroy()
This method is called on aJChannel.close()
.AverageMinMax
getAvgTimeBlocked()
long
getNumBlockings()
protected void
handleAck(Address sender, long ack)
java.lang.String
printAckTable()
void
resetStats()
protected void
send(Message msg, Buffer<Message> win)
Adds the message to the sent_msgs table and then passes it down the stack.protected void
sendAck(Address to, Buffer<Message> win)
protected boolean
sendAtomically()
protected NAKACK4
sendAtomically(boolean f)
protected Buffer.Options
sendOptions()
protected void
stable(Digest digest)
Garbage collect messages that have been seen by all members.-
Methods inherited from class org.jgroups.protocols.ReliableMulticast
clearNonMemberCache, deliver, deliverBatch, discardDeliveredMsgs, discardDeliveredMsgs, down, down, flushBecomeServerQueue, getBecomeServerQueueSize, getBecomeServerQueueSizeActual, getCurrentSeqno, getDigest, getDigest, getMaxXmitReqSize, getNonMemberMessages, getNumMessagesReceived, getNumMessagesSent, getSizeOfAllMessages, getSizeOfAllMessagesInclHeaders, getSuppressTimeNonMemberWarnings, getWindow, getXmitInterval, getXmitRequestsReceived, getXmitRequestsSent, getXmitResponsesReceived, getXmitResponsesSent, getXmitTableCapacity, getXmitTableMissingMessages, getXmitTableUndeliveredMsgs, handleHighestSeqno, handleMessage, handleMessageBatch, handleProbe, handleXmitReq, handleXmitRsp, init, isCallerRunsHandler, isTrace, isTrace, isXmitTaskRunning, logDiscardMessages, logDiscardMessages, logNotFoundMessages, logNotFoundMessages, mergeDigest, msgFromXmitRsp, overwriteDigest, printBatches, printDigestHistory, printMessages, printStabilityMessages, providedUpServices, queueMessage, removeAndDeliver, resend, reset, retransmit, retransmit, reuseMessageBatches, reuseMessageBatches, sendBuf, sendsCanBlock, sendsCanBlock, sendXmitRsp, setBecomeServerQueueSize, setDigest, setDigest, setDiscardDeliveredMsgs, setLevel, setMaxXmitReqSize, setNumMessagesReceived, setNumMessagesSent, setSuppressTimeNonMemberWarnings, setTimer, setXmitFromRandomMember, setXmitInterval, sizeOfAllMessages, start, startRetransmitTask, stop, stopRetransmitTask, supportedKeys, triggerXmit, unknownMember, up, up, up, useMcastXmit, useMcastXmit, useMcastXmitReq, useMcastXmitReq, xmitFromRandomMember, xmitFromRandomMember
-
Methods inherited from class org.jgroups.stack.Protocol
accept, addPolicy, addr, addr, afterCreationHook, down, enableStats, getAddress, getComponents, getDownProtocol, getDownServices, getId, getIdsAbove, getLevel, getLog, getName, getPolicies, getProtocolStack, getSocketFactory, getThreadFactory, getTransport, getUpProtocol, getUpServices, getValue, isErgonomics, level, parse, policies, providedDownServices, removePolicy, requiredDownServices, requiredUpServices, resetStatistics, setAddress, setDownProtocol, setErgonomics, setId, setPolicies, setProtocolStack, setSocketFactory, setUpProtocol, setValue, statsEnabled, toString
-
-
-
-
Field Detail
-
ack_table
protected final AckTable ack_table
-
SEND_OPTIONS
protected static final Buffer.Options SEND_OPTIONS
-
capacity
protected int capacity
-
send_atomically
protected boolean send_atomically
-
acks_received
protected final java.util.concurrent.atomic.LongAdder acks_received
-
-
Method Detail
-
capacity
protected int capacity()
-
capacity
protected NAKACK4 capacity(int c)
-
sendAtomically
protected boolean sendAtomically()
-
sendAtomically
protected NAKACK4 sendAtomically(boolean f)
-
sendOptions
protected Buffer.Options sendOptions()
- Overrides:
sendOptions
in classReliableMulticast
-
getNumBlockings
public long getNumBlockings()
-
getAvgTimeBlocked
public AverageMinMax getAvgTimeBlocked()
-
createXmitWindow
protected Buffer<Message> createXmitWindow(long initial_seqno)
- Specified by:
createXmitWindow
in classReliableMulticast
-
resetStats
public void resetStats()
- Overrides:
resetStats
in classReliableMulticast
-
destroy
public void destroy()
Description copied from class:Protocol
This method is called on aJChannel.close()
. Does some cleanup; after the call, the VM will terminate
-
printAckTable
public java.lang.String printAckTable()
-
adjustReceivers
protected void adjustReceivers(java.util.List<Address> members)
Description copied from class:ReliableMulticast
Removes old members from xmit-table and adds new members to xmit-table (at seqnos hd=0, hr=0). This method is not called concurrently- Overrides:
adjustReceivers
in classReliableMulticast
-
stable
protected void stable(Digest digest)
Description copied from class:ReliableMulticast
Garbage collect messages that have been seen by all members. Update sent_msgs: for the sender P in the digest which is equal to the local address, garbage collect all messages <= seqno at digest[P]. Update xmit_table: for each sender P in the digest and its highest seqno seen SEQ, garbage collect all delivered_msgs in the retransmit buffer corresponding to P which are <= seqno at digest[P].- Overrides:
stable
in classReliableMulticast
-
handleAck
protected void handleAck(Address sender, long ack)
- Overrides:
handleAck
in classReliableMulticast
-
sendAck
protected void sendAck(Address to, Buffer<Message> win)
- Overrides:
sendAck
in classReliableMulticast
-
send
protected void send(Message msg, Buffer<Message> win)
Description copied from class:ReliableMulticast
Adds the message to the sent_msgs table and then passes it down the stack. Change Bela Ban May 26 2002: we don't store a copy of the message, but a reference ! This saves us a lot of memory. However, this also means that a message should not be changed after storing it in the sent-table ! See protocols/DESIGN for details. Made seqno increment and adding to sent_msgs atomic, e.g. seqno won't get incremented if adding to sent_msgs fails e.g. due to an OOM (see https://issues.redhat.com/browse/JGRP-179). bela Jan 13 2006- Overrides:
send
in classReliableMulticast
-
-