@Singleton
public class PeerEurekaNodes
extends java.lang.Object
PeerEurekaNodes.| Modifier and Type | Field and Description |
|---|---|
protected com.netflix.discovery.EurekaClientConfig |
clientConfig |
protected PeerAwareInstanceRegistry |
registry |
protected ServerCodecs |
serverCodecs |
protected EurekaServerConfig |
serverConfig |
| Constructor and Description |
|---|
PeerEurekaNodes(PeerAwareInstanceRegistry registry,
EurekaServerConfig serverConfig,
com.netflix.discovery.EurekaClientConfig clientConfig,
ServerCodecs serverCodecs,
com.netflix.appinfo.ApplicationInfoManager applicationInfoManager) |
| Modifier and Type | Method and Description |
|---|---|
protected PeerEurekaNode |
createPeerEurekaNode(java.lang.String peerEurekaNodeUrl) |
int |
getMinNumberOfAvailablePeers() |
java.util.List<PeerEurekaNode> |
getPeerEurekaNodes() |
java.util.List<PeerEurekaNode> |
getPeerNodesView() |
static java.lang.String |
hostFromUrl(java.lang.String url) |
boolean |
isInstanceURL(java.lang.String url,
com.netflix.appinfo.InstanceInfo instance)
Checks if the given service url matches the supplied instance
|
static boolean |
isThisMe(java.lang.String url)
Deprecated.
2016-06-27 use instance version of
isThisMyUrl(String)
Checks if the given service url contains the current host which is trying
to replicate. Only after the EIP binding is done the host has a chance to
identify itself in the list of replica nodes and needs to take itself out
of replication traffic. |
boolean |
isThisMyUrl(java.lang.String url)
Checks if the given service url contains the current host which is trying
to replicate.
|
protected java.util.List<java.lang.String> |
resolvePeerUrls()
Resolve peer URLs.
|
void |
shutdown() |
void |
start() |
protected void |
updatePeerEurekaNodes(java.util.List<java.lang.String> newPeerUrls)
Given new set of replica URLs, destroy
PeerEurekaNodes no longer available, and
create new ones. |
protected final PeerAwareInstanceRegistry registry
protected final EurekaServerConfig serverConfig
protected final com.netflix.discovery.EurekaClientConfig clientConfig
protected final ServerCodecs serverCodecs
@Inject public PeerEurekaNodes(PeerAwareInstanceRegistry registry, EurekaServerConfig serverConfig, com.netflix.discovery.EurekaClientConfig clientConfig, ServerCodecs serverCodecs, com.netflix.appinfo.ApplicationInfoManager applicationInfoManager)
public java.util.List<PeerEurekaNode> getPeerNodesView()
public java.util.List<PeerEurekaNode> getPeerEurekaNodes()
public int getMinNumberOfAvailablePeers()
public void start()
public void shutdown()
protected java.util.List<java.lang.String> resolvePeerUrls()
protected void updatePeerEurekaNodes(java.util.List<java.lang.String> newPeerUrls)
PeerEurekaNodes no longer available, and
create new ones.newPeerUrls - peer node URLs; this collection should have local node's URL filtered outprotected PeerEurekaNode createPeerEurekaNode(java.lang.String peerEurekaNodeUrl)
public static boolean isThisMe(java.lang.String url)
isThisMyUrl(String)
Checks if the given service url contains the current host which is trying
to replicate. Only after the EIP binding is done the host has a chance to
identify itself in the list of replica nodes and needs to take itself out
of replication traffic.url - the service url of the replica node that the check is made.public boolean isThisMyUrl(java.lang.String url)
url - the service url of the replica node that the check is made.public boolean isInstanceURL(java.lang.String url,
com.netflix.appinfo.InstanceInfo instance)
url - the service url of the replica node that the check is made.instance - the instance to check the service url againstpublic static java.lang.String hostFromUrl(java.lang.String url)