Package org.elasticsearch.discovery
Class PeerFinder
java.lang.Object
org.elasticsearch.discovery.PeerFinder
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
static interface
-
Field Summary
-
Constructor Summary
ConstructorDescriptionPeerFinder(Settings settings, TransportService transportService, PeerFinder.TransportAddressConnector transportAddressConnector, PeerFinder.ConfiguredHostsResolver configuredHostsResolver)
-
Method Summary
Modifier and TypeMethodDescriptionvoid
activate(DiscoveryNodes lastAcceptedNodes)
void
deactivate(DiscoveryNode leader)
long
protected boolean
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.protected abstract void
Invoked when the set of found peers changes.void
setCurrentTerm(long currentTerm)
protected void
startProbe(TransportAddress transportAddress)
-
Field Details
-
REQUEST_PEERS_ACTION_NAME
- See Also:
- Constant Field Values
-
DISCOVERY_FIND_PEERS_INTERVAL_SETTING
-
DISCOVERY_REQUEST_PEERS_TIMEOUT_SETTING
public static final Setting<org.elasticsearch.core.TimeValue> DISCOVERY_REQUEST_PEERS_TIMEOUT_SETTING -
VERBOSITY_INCREASE_TIMEOUT_SETTING
-
-
Constructor Details
-
PeerFinder
public PeerFinder(Settings settings, TransportService transportService, PeerFinder.TransportAddressConnector transportAddressConnector, PeerFinder.ConfiguredHostsResolver configuredHostsResolver)
-
-
Method Details
-
activate
-
deactivate
-
holdsLock
protected final boolean holdsLock() -
getLeader
-
getCurrentTerm
public long getCurrentTerm() -
setCurrentTerm
public void setCurrentTerm(long currentTerm) -
onActiveMasterFound
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
-
getFoundPeers
-
startProbe
-