Package com.netflix.eureka.registry
Class RemoteRegionRegistry
- java.lang.Object
-
- com.netflix.eureka.registry.RemoteRegionRegistry
-
- All Implemented Interfaces:
com.netflix.discovery.shared.LookupService<java.lang.String>
public class RemoteRegionRegistry extends java.lang.Object implements com.netflix.discovery.shared.LookupService<java.lang.String>Handles all registry operations that needs to be done on a eureka service running in an other region. The primary operations include fetching registry information from remote region and fetching delta information on a periodic basis. TODO: a lot of the networking code in this class can be replaced by newer code inDiscoveryClient
-
-
Constructor Summary
Constructors Constructor Description RemoteRegionRegistry(EurekaServerConfig serverConfig, com.netflix.discovery.EurekaClientConfig clientConfig, ServerCodecs serverCodecs, EurekaServerHttpClientFactory eurekaServerHttpClientFactory, java.lang.String regionName, java.net.URL remoteRegionURL)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected com.netflix.discovery.shared.ApplicationsfetchRemoteRegistry(boolean delta)Fetch registry information from the remote region.com.netflix.discovery.shared.ApplicationgetApplication(java.lang.String appName)com.netflix.discovery.shared.ApplicationsgetApplicationDeltas()com.netflix.discovery.shared.ApplicationsgetApplications()java.util.List<com.netflix.appinfo.InstanceInfo>getInstancesById(java.lang.String id)com.netflix.appinfo.InstanceInfogetNextServerFromEureka(java.lang.String arg0, boolean arg1)longgetRemoteFetchMismatches()longgetRemoteFetchSuccesses()longgetTimeOfLastSuccessfulRemoteFetch()booleanisReadyForServingData()Check if this registry is ready for serving data.booleanstoreFullRegistry()Gets the full registry information from the eureka server and stores it locally.
-
-
-
Constructor Detail
-
RemoteRegionRegistry
@Inject public RemoteRegionRegistry(EurekaServerConfig serverConfig, com.netflix.discovery.EurekaClientConfig clientConfig, ServerCodecs serverCodecs, EurekaServerHttpClientFactory eurekaServerHttpClientFactory, java.lang.String regionName, java.net.URL remoteRegionURL)
-
-
Method Detail
-
isReadyForServingData
public boolean isReadyForServingData()
Check if this registry is ready for serving data.- Returns:
- true if ready, false otherwise.
-
storeFullRegistry
public boolean storeFullRegistry()
Gets the full registry information from the eureka server and stores it locally.- Returns:
- the full registry information.
-
fetchRemoteRegistry
protected com.netflix.discovery.shared.Applications fetchRemoteRegistry(boolean delta)
Fetch registry information from the remote region.- Parameters:
delta- - true, if the fetch needs to get deltas, false otherwise- Returns:
- - response which has information about the data.
-
getApplications
public com.netflix.discovery.shared.Applications getApplications()
- Specified by:
getApplicationsin interfacecom.netflix.discovery.shared.LookupService<java.lang.String>
-
getNextServerFromEureka
public com.netflix.appinfo.InstanceInfo getNextServerFromEureka(java.lang.String arg0, boolean arg1)- Specified by:
getNextServerFromEurekain interfacecom.netflix.discovery.shared.LookupService<java.lang.String>
-
getApplication
public com.netflix.discovery.shared.Application getApplication(java.lang.String appName)
- Specified by:
getApplicationin interfacecom.netflix.discovery.shared.LookupService<java.lang.String>
-
getInstancesById
public java.util.List<com.netflix.appinfo.InstanceInfo> getInstancesById(java.lang.String id)
- Specified by:
getInstancesByIdin interfacecom.netflix.discovery.shared.LookupService<java.lang.String>
-
getApplicationDeltas
public com.netflix.discovery.shared.Applications getApplicationDeltas()
-
getTimeOfLastSuccessfulRemoteFetch
@Monitor(name="eurekaServer.registry.secondsSinceLastSuccessfulRemoteFetch", type=GAUGE) public long getTimeOfLastSuccessfulRemoteFetch()
-
getRemoteFetchSuccesses
@Monitor(name="eurekaServer.registry.remoteDeltaSuccesses", type=COUNTER) public long getRemoteFetchSuccesses()
-
getRemoteFetchMismatches
@Monitor(name="eurekaServer.registry.remoteDeltaMismatches", type=COUNTER) public long getRemoteFetchMismatches()
-
-