Class NAKACK4

All Implemented Interfaces:
Lifecycle, DiagnosticsHandler.ProbeHandler

public class NAKACK4 extends ReliableMulticast
New multicast protocol based on fixed-size xmit windows and message ACKs
Details: https://issues.redhat.com/browse/JGRP-2780
Since:
5.4
Author:
Bela Ban
  • Field Details

    • ack_table

      protected final AckTable ack_table
    • capacity

      protected int capacity
    • ack_threshold

      protected int ack_threshold
    • dynamic_buffers

      protected boolean dynamic_buffers
    • acks_received

      protected final LongAdder acks_received
    • add_acks

      protected final IntBinaryOperator add_acks
  • Constructor Details

    • NAKACK4

      public NAKACK4()
  • Method Details

    • capacity

      public int capacity()
    • capacity

      public NAKACK4 capacity(int c)
    • ackThreshold

      public int ackThreshold()
    • ackThreshold

      public NAKACK4 ackThreshold(int t)
    • dynamicBuffers

      public boolean dynamicBuffers()
    • getNumUnackedMessages

      public long getNumUnackedMessages()
    • getNumUnackedMessages

      public long getNumUnackedMessages(Address dest)
    • getNumBlockings

      public long getNumBlockings()
    • getNumDroppedMessages

      public long getNumDroppedMessages()
    • getAvgTimeBlocked

      public AverageMinMax getAvgTimeBlocked()
    • createXmitWindow

      protected Buffer<Message> createXmitWindow(long initial_seqno)
      Specified by:
      createXmitWindow in class ReliableMulticast
    • sendBufferCanBlock

      public boolean sendBufferCanBlock()
      Description copied from class: ReliableMulticast
      Whether addition of a message to the send buffer can block
      Overrides:
      sendBufferCanBlock in class ReliableMulticast
    • resetStats

      public void resetStats()
      Overrides:
      resetStats in class ReliableMulticast
    • init

      public void init() throws 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:
      Exception - Thrown if protocol cannot be initialized successfully. This will cause the ProtocolStack to fail, so the the channel constructor will throw an exception
    • destroy

      public void destroy()
      Description copied from class: Protocol
      This method is called on a JChannel.close(). Does some cleanup; after the call, the VM will terminate
      Specified by:
      destroy in interface Lifecycle
      Overrides:
      destroy in class Protocol
    • printAckTable

      public String printAckTable()
    • sendAcks

      public void sendAcks()
    • sendPendingAcks

      public void sendPendingAcks()
    • sendAcks

      protected void sendAcks(boolean always_send)
    • 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(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
    • reset

      protected void reset()
      Overrides:
      reset 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
    • handleAck

      protected void handleAck(Address sender, long ack)
      Overrides:
      handleAck in class ReliableMulticast
    • needToSendAck

      protected boolean needToSendAck(ReliableMulticast.Entry e)
      Overrides:
      needToSendAck in class ReliableMulticast
    • needToSendAck

      protected boolean needToSendAck(ReliableMulticast.Entry e, int num_acks)
      Overrides:
      needToSendAck in class ReliableMulticast
    • sendAck

      protected void sendAck(Address to, Buffer<Message> win)
      Overrides:
      sendAck in class ReliableMulticast
    • addToSendBuffer

      protected boolean addToSendBuffer(Buffer<Message> win, long seq, Message msg, Predicate<Message> filter)
      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