Class Responses

  • All Implemented Interfaces:
    java.lang.Iterable<PingData>

    public class Responses
    extends java.lang.Object
    implements java.lang.Iterable<PingData>
    Manages responses for the discovery protocol. Moved from Discovery into this standalone class. Responses are only added but never removed.
    Since:
    3.5
    Author:
    Bela Ban
    • Field Detail

      • ping_rsps

        protected PingData[] ping_rsps
      • index

        protected int index
      • lock

        protected final java.util.concurrent.locks.Lock lock
      • cond

        protected final CondVar cond
      • num_expected_rsps

        protected final int num_expected_rsps
      • break_on_coord_rsp

        protected final boolean break_on_coord_rsp
      • done

        protected boolean done
    • Constructor Detail

      • Responses

        public Responses​(boolean break_on_coord_rsp)
      • Responses

        public Responses​(int num_expected_rsps,
                         boolean break_on_coord_rsp)
      • Responses

        public Responses​(int num_expected_rsps,
                         boolean break_on_coord_rsp,
                         int initial_capacity)
    • Method Detail

      • isDone

        public boolean isDone()
      • containsResponseFrom

        public boolean containsResponseFrom​(Address mbr)
      • isCoord

        public boolean isCoord​(Address addr)
      • waitFor

        public boolean waitFor​(long timeout)
      • iterator

        public java.util.Iterator<PingData> iterator()
        Specified by:
        iterator in interface java.lang.Iterable<PingData>
      • size

        public int size()
      • isEmpty

        public boolean isEmpty()
      • toString

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

        public java.lang.String print()
      • numResponses

        protected int[] numResponses()
      • toList

        protected java.util.List<PingData> toList()
      • resize

        protected void resize​(int new_size)
      • add

        protected void add​(PingData data)
      • find

        protected int find​(PingData data)
      • newLength

        protected static int newLength​(int length)