Class 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 in DiscoveryClient
    • 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:
        getApplications in interface com.netflix.discovery.shared.LookupService<java.lang.String>
      • getNextServerFromEureka

        public com.netflix.appinfo.InstanceInfo getNextServerFromEureka​(java.lang.String arg0,
                                                                        boolean arg1)
        Specified by:
        getNextServerFromEureka in interface com.netflix.discovery.shared.LookupService<java.lang.String>
      • getApplication

        public com.netflix.discovery.shared.Application getApplication​(java.lang.String appName)
        Specified by:
        getApplication in interface com.netflix.discovery.shared.LookupService<java.lang.String>
      • getInstancesById

        public java.util.List<com.netflix.appinfo.InstanceInfo> getInstancesById​(java.lang.String id)
        Specified by:
        getInstancesById in interface com.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()