Package akka.remote

Class AckedSendBuffer<T extends HasSequenceNumber>

  • All Implemented Interfaces:
    java.io.Serializable, scala.Equals, scala.Product, scala.Serializable

    public final class AckedSendBuffer<T extends HasSequenceNumber>
    extends java.lang.Object
    implements scala.Product, scala.Serializable
    Implements an immutable resend buffer that buffers messages until they have been acknowledged. Properly removes messages when an ack is received. This buffer works together with AckedReceiveBuffer on the receiving end.

    param: capacity Maximum number of messages the buffer is willing to accept. If reached ResendBufferCapacityReachedException is thrown. param: nonAcked Sequence of messages that has not yet been acknowledged. param: nacked Sequence of messages that has been explicitly negative acknowledged. param: maxSeq The maximum sequence number that has been stored in this buffer. Messages having lower sequence number will be not stored but rejected with IllegalArgumentException

    See Also:
    Serialized Form
    • Constructor Detail

      • AckedSendBuffer

        public AckedSendBuffer​(int capacity,
                               scala.collection.immutable.IndexedSeq<T> nonAcked,
                               scala.collection.immutable.IndexedSeq<T> nacked,
                               SeqNo maxSeq)
    • Method Detail

      • $lessinit$greater$default$2

        public static <T extends HasSequenceNumber> scala.collection.immutable.Vector<T> $lessinit$greater$default$2()
      • $lessinit$greater$default$3

        public static <T extends HasSequenceNumber> scala.collection.immutable.Vector<T> $lessinit$greater$default$3()
      • $lessinit$greater$default$4

        public static <T extends HasSequenceNumberSeqNo $lessinit$greater$default$4()
      • apply

        public static <T extends HasSequenceNumberAckedSendBuffer<T> apply​(int capacity,
                                                                             scala.collection.immutable.IndexedSeq<T> nonAcked,
                                                                             scala.collection.immutable.IndexedSeq<T> nacked,
                                                                             SeqNo maxSeq)
      • apply$default$2

        public static <T extends HasSequenceNumber> scala.collection.immutable.Vector<T> apply$default$2()
      • apply$default$3

        public static <T extends HasSequenceNumber> scala.collection.immutable.Vector<T> apply$default$3()
      • unapply

        public static <T extends HasSequenceNumber> scala.Option<scala.Tuple4<java.lang.Object,​scala.collection.immutable.IndexedSeq<T>,​scala.collection.immutable.IndexedSeq<T>,​SeqNo>> unapply​(AckedSendBuffer<T> x$0)
      • capacity

        public int capacity()
      • nonAcked

        public scala.collection.immutable.IndexedSeq<T> nonAcked()
      • nacked

        public scala.collection.immutable.IndexedSeq<T> nacked()
      • maxSeq

        public SeqNo maxSeq()
      • acknowledge

        public AckedSendBuffer<T> acknowledge​(Ack ack)
        Processes an incoming acknowledgement and returns a new buffer with only unacknowledged elements remaining.
        Parameters:
        ack - The received acknowledgement
        Returns:
        An updated buffer containing the remaining unacknowledged messages
      • buffer

        public AckedSendBuffer<T> buffer​(T msg)
        Puts a new message in the buffer. Throws IllegalArgumentException if an out-of-sequence message is attempted to be stored.
        Parameters:
        msg - The message to be stored for possible future retransmission.
        Returns:
        The updated buffer
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • copy

        public <T extends HasSequenceNumberAckedSendBuffer<T> copy​(int capacity,
                                                                     scala.collection.immutable.IndexedSeq<T> nonAcked,
                                                                     scala.collection.immutable.IndexedSeq<T> nacked,
                                                                     SeqNo maxSeq)
      • copy$default$2

        public <T extends HasSequenceNumber> scala.collection.immutable.IndexedSeq<T> copy$default$2()
      • copy$default$3

        public <T extends HasSequenceNumber> scala.collection.immutable.IndexedSeq<T> copy$default$3()
      • productPrefix

        public java.lang.String productPrefix()
        Specified by:
        productPrefix in interface scala.Product
      • productArity

        public int productArity()
        Specified by:
        productArity in interface scala.Product
      • productElement

        public java.lang.Object productElement​(int x$1)
        Specified by:
        productElement in interface scala.Product
      • productIterator

        public scala.collection.Iterator<java.lang.Object> productIterator()
        Specified by:
        productIterator in interface scala.Product
      • canEqual

        public boolean canEqual​(java.lang.Object x$1)
        Specified by:
        canEqual in interface scala.Equals
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object x$1)
        Specified by:
        equals in interface scala.Equals
        Overrides:
        equals in class java.lang.Object