Class PeerFinder

  • public abstract class PeerFinder
    extends java.lang.Object
    • Field Detail


        public static final java.lang.String REQUEST_PEERS_ACTION_NAME
        See Also:
        Constant Field Values

        public static final Setting<TimeValue> DISCOVERY_FIND_PEERS_INTERVAL_SETTING

        public static final Setting<TimeValue> DISCOVERY_REQUEST_PEERS_TIMEOUT_SETTING
    • Method Detail

      • activate

        public void activate​(DiscoveryNodes lastAcceptedNodes)
      • holdsLock

        protected final boolean holdsLock()
      • getLeader

        public java.util.Optional<DiscoveryNode> getLeader()
      • getCurrentTerm

        public long getCurrentTerm()
      • setCurrentTerm

        public void setCurrentTerm​(long currentTerm)
      • onActiveMasterFound

        protected abstract void onActiveMasterFound​(DiscoveryNode masterNode,
                                                    long term)
        Invoked on receipt of a PeersResponse from a node that believes it's an active leader, which this node should therefore try and join. Note that invocations of this method are not synchronised. By the time it is called we may have been deactivated.
      • onFoundPeersUpdated

        protected abstract void onFoundPeersUpdated()
        Invoked when the set of found peers changes. Note that invocations of this method are not fully synchronised, so we only guarantee that the change to the set of found peers happens before this method is invoked. If there are multiple concurrent changes then there will be multiple concurrent invocations of this method, with no guarantee as to their order. For this reason we do not pass the updated set of peers as an argument to this method, leaving it to the implementation to call getFoundPeers() with appropriate synchronisation to avoid lost updates. Also, by the time this method is invoked we may have been deactivated.
      • getLastResolvedAddresses

        public java.util.List<TransportAddress> getLastResolvedAddresses()
      • getFoundPeers

        public java.lang.Iterable<DiscoveryNode> getFoundPeers()