this.urlRandomizer = new EndpointUtils.InstanceInfoBasedUrlRandomizer(instanceInfo); localRegionApps.set(new Applications());
this.urlRandomizer = new EndpointUtils.InstanceInfoBasedUrlRandomizer(instanceInfo); localRegionApps.set(new Applications());
/** * Get the list of EIPS from the DNS. * * <p> * This mechanism looks for the EIP pool in the zone the instance is in by * looking up the DNS name <code>{zone}.{region}.{domainName}</code>. The * zone is fetched from the {@link InstanceInfo} object;the region is picked * up from the specified configuration * {@link com.netflix.discovery.EurekaClientConfig#getRegion()};the domain name is picked up from * the specified configuration {@link com.netflix.discovery.EurekaClientConfig#getEurekaServerDNSName()} * with a "txt." prefix (see {@link com.netflix.discovery.endpoint.EndpointUtils * #getZoneBasedDiscoveryUrlsFromRegion(com.netflix.discovery.EurekaClientConfig, String)}. * </p> * * @param myZone * the zone where this instance exist in. * @return the collection of EIPs that exist in the zone this instance is * in. */ private Collection<String> getEIPsForZoneFromDNS(String myZone) { List<String> ec2Urls = EndpointUtils.getServiceUrlsFromDNS( clientConfig, myZone, true, new EndpointUtils.InstanceInfoBasedUrlRandomizer(applicationInfoManager.getInfo()) ); return getEIPsFromServiceUrls(ec2Urls); }
/** * Resolve peer URLs. * * @return peer URLs with node's own URL filtered out */ protected List<String> resolvePeerUrls() { InstanceInfo myInfo = applicationInfoManager.getInfo(); String zone = InstanceInfo.getZone(clientConfig.getAvailabilityZones(clientConfig.getRegion()), myInfo); List<String> replicaUrls = EndpointUtils .getDiscoveryServiceUrls(clientConfig, zone, new EndpointUtils.InstanceInfoBasedUrlRandomizer(myInfo)); int idx = 0; while (idx < replicaUrls.size()) { if (isThisMyUrl(replicaUrls.get(idx))) { replicaUrls.remove(idx); } else { idx++; } } return replicaUrls; }
private Collection<String> getIPsForZoneFromDNS(String myZone) { return EndpointUtils.getServiceUrlsFromDNS( clientConfig, myZone, true, new EndpointUtils.InstanceInfoBasedUrlRandomizer(applicationInfoManager.getInfo()) ); }
/** * Get the list of EIPS from the DNS. * * <p> * This mechanism looks for the EIP pool in the zone the instance is in by * looking up the DNS name <code>{zone}.{region}.{domainName}</code>. The * zone is fetched from the {@link InstanceInfo} object;the region is picked * up from the specified configuration * {@link com.netflix.discovery.EurekaClientConfig#getRegion()};the domain name is picked up from * the specified configuration {@link com.netflix.discovery.EurekaClientConfig#getEurekaServerDNSName()} * with a "txt." prefix (see {@link com.netflix.discovery.endpoint.EndpointUtils * #getZoneBasedDiscoveryUrlsFromRegion(com.netflix.discovery.EurekaClientConfig, String)}. * </p> * * @param myZone * the zone where this instance exist in. * @return the collection of EIPs that exist in the zone this instance is * in. */ private Collection<String> getEIPsForZoneFromDNS(String myZone) { List<String> ec2Urls = EndpointUtils.getServiceUrlsFromDNS( clientConfig, myZone, true, new EndpointUtils.InstanceInfoBasedUrlRandomizer(applicationInfoManager.getInfo()) ); return getEIPsFromServiceUrls(ec2Urls); }
/** * Resolve peer URLs. * * @return peer URLs with node's own URL filtered out */ protected List<String> resolvePeerUrls() { InstanceInfo myInfo = applicationInfoManager.getInfo(); String zone = InstanceInfo.getZone(clientConfig.getAvailabilityZones(clientConfig.getRegion()), myInfo); List<String> replicaUrls = EndpointUtils .getDiscoveryServiceUrls(clientConfig, zone, new EndpointUtils.InstanceInfoBasedUrlRandomizer(myInfo)); int idx = 0; while (idx < replicaUrls.size()) { if (isThisMyUrl(replicaUrls.get(idx))) { replicaUrls.remove(idx); } else { idx++; } } return replicaUrls; }
private Collection<String> getIPsForZoneFromDNS(String myZone) { return EndpointUtils.getServiceUrlsFromDNS( clientConfig, myZone, true, new EndpointUtils.InstanceInfoBasedUrlRandomizer(applicationInfoManager.getInfo()) ); }