Class ClusterView


  • public class ClusterView
    extends java.lang.Object
    ClusterView is a snapshot of the current membership of the group. The ClusterView is created anew each time a membership change occurs in the group. ClusterView is managed by ClusterViewManager.
    • Field Detail

      • masterViewId

        public final long masterViewId
    • Method Detail

      • get

        public SystemAdvertisement get​(PeerID id)
        Retrieves a system advertisement from a the table.
        Parameters:
        id - instance id
        Returns:
        Returns the SystemAdvertisement associated with id
      • add

        public void add​(SystemAdvertisement adv)
        Adds a system advertisement to the view.
        Parameters:
        adv - adds a system advertisement to the view
      • containsKey

        public boolean containsKey​(PeerID id)
      • getView

        public java.util.List<SystemAdvertisement> getView()
        Returns a sorted list containing the System Advertisements of peers in PeerId sorted order
        Returns:
        List - list of system advertisements
      • getPeerNamesInView

        public java.util.List<java.lang.String> getPeerNamesInView()
        Returns the list of peer names in the peer id sorted order from the cluster view
        Returns:
        List
      • getSize

        public int getSize()
        Gets the viewSize attribute of the ClusterView object
        Returns:
        The viewSize
      • getMasterCandidate

        public SystemAdvertisement getMasterCandidate()
        Returns the top node on the list
        Returns:
        the top node on the list
      • isFirst

        public boolean isFirst​(SystemAdvertisement advertisement)
        Determines whether this node is at the top of the list
        Parameters:
        advertisement - the advertisement to test
        Returns:
        true if this node is a the top of the list, false otherwise
      • getClusterViewId

        public long getClusterViewId()
        Returns the cluster view ID
        Returns:
        the view id
      • clear

        public void clear()
        Removes all of the elements from this set (optional operation).