Package akka.remote

Class AckedReceiveBuffer<T extends HasSequenceNumber>

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

    public final class AckedReceiveBuffer<T extends HasSequenceNumber>
    extends java.lang.Object
    implements scala.Product, scala.Serializable
    Implements an immutable receive buffer that buffers incoming messages until they can be safely delivered. This buffer works together with a AckedSendBuffer on the sender() side.

    param: lastDelivered Sequence number of the last message that has been delivered. param: cumulativeAck The highest sequence number received so far. param: buf Buffer of messages that are waiting for delivery

    See Also:
    Serialized Form
    • Constructor Detail

      • AckedReceiveBuffer

        public AckedReceiveBuffer​(SeqNo lastDelivered,
                                  SeqNo cumulativeAck,
                                  scala.collection.immutable.SortedSet<T> buf,
                                  scala.math.Ordering<T> seqOrdering)
    • Method Detail

      • $lessinit$greater$default$1

        public static <T extends HasSequenceNumberSeqNo $lessinit$greater$default$1()
      • $lessinit$greater$default$2

        public static <T extends HasSequenceNumberSeqNo $lessinit$greater$default$2()
      • $lessinit$greater$default$3

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

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

        public SeqNo lastDelivered()
      • cumulativeAck

        public SeqNo cumulativeAck()
      • buf

        public scala.collection.immutable.SortedSet<T> buf()
      • seqOrdering

        public scala.math.Ordering<T> seqOrdering()
      • receive

        public AckedReceiveBuffer<T> receive​(T arrivedMsg)
        Puts a sequenced message in the receive buffer returning a new buffer.
        Parameters:
        arrivedMsg - message to be put into the buffer.
        Returns:
        The updated buffer containing the message.
      • extractDeliverable

        public scala.Tuple3<AckedReceiveBuffer<T>,​scala.collection.immutable.Seq<T>,​Ack> extractDeliverable()
        Extract all messages that could be safely delivered, an updated ack to be sent to the sender(), and an updated buffer that has the messages removed that can be delivered.
        Returns:
        Triplet of the updated buffer, messages that can be delivered and the updated acknowledgement.
      • mergeFrom

        public AckedReceiveBuffer<T> mergeFrom​(AckedReceiveBuffer<T> that)
        Merges two receive buffers. Merging preserves sequencing of messages, and drops all messages that has been safely acknowledged by any of the participating buffers. Also updates the expected sequence numbers.
        Parameters:
        that - The receive buffer to merge with
        Returns:
        The merged receive buffer.
      • toString

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

        public <T extends HasSequenceNumber> scala.collection.immutable.SortedSet<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