Class NAKACK4

    • Field Detail

      • ack_table

        protected final AckTable ack_table
      • capacity

        protected int capacity
      • ack_threshold

        protected int ack_threshold
      • acks_received

        protected final java.util.concurrent.atomic.LongAdder acks_received
      • add_acks

        protected final java.util.function.IntBinaryOperator add_acks
    • Constructor Detail

      • NAKACK4

        public NAKACK4()
    • Method Detail

      • capacity

        public int capacity()
      • capacity

        public NAKACK4 capacity​(int c)
      • ackThreshold

        public int ackThreshold()
      • ackThreshold

        public NAKACK4 ackThreshold​(int t)
      • getNumBlockings

        public long getNumBlockings()
      • getNumDroppedMessages

        public long getNumDroppedMessages()
      • init

        public void init()
                  throws java.lang.Exception
        Description copied from class: Protocol
        Called after a protocol has been created and before the protocol is started. Attributes are already set. Other protocols are not yet connected and events cannot yet be sent.
        Specified by:
        init in interface Lifecycle
        Overrides:
        init in class ReliableMulticast
        Throws:
        java.lang.Exception - Thrown if protocol cannot be initialized successfully. This will cause the ProtocolStack to fail, so the the channel constructor will throw an exception
      • printAckTable

        public java.lang.String printAckTable()
      • sendPendingAcks

        public void sendPendingAcks()
      • changeCapacity

        public void changeCapacity​(int new_capacity)
        Changes the capacity of the buffer, basically by creating a new buffer and copying the messages from the old one. This method is only supposed to be used by perf testing, so DON'T USE!
      • 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 class ReliableMulticast
      • 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 class ReliableMulticast
      • addToSendBuffer

        protected boolean addToSendBuffer​(Buffer<Message> win,
                                          long seq,
                                          Message msg,
                                          java.util.function.Predicate<Message> filter,
                                          boolean dont_block)
        Description copied from class: ReliableMulticast
        Adds the message to the send buffer. The loop tries to handle temporary OOMEs by retrying if add() failed
        Overrides:
        addToSendBuffer in class ReliableMulticast