Lease<InstanceInfo> lease = leaseMap.get(id); if (lease == null || (isLeaseExpirationEnabled() && lease.isExpired())) { continue;
public void evict(long additionalLeaseMs) { logger.debug("Running the evict task"); if (!isLeaseExpirationEnabled()) { logger.debug("DS: lease expiration is currently disabled."); return;
/** * Gets the {@link InstanceInfo} information. * * @param appName the application name for which the information is requested. * @param id the unique identifier of the instance. * @param includeRemoteRegions true, if we need to include applications from remote regions * as indicated by the region {@link URL} by this property * {@link EurekaServerConfig#getRemoteRegionUrls()}, false otherwise * @return the information about the instance. */ @Override public InstanceInfo getInstanceByAppAndId(String appName, String id, boolean includeRemoteRegions) { Map<String, Lease<InstanceInfo>> leaseMap = registry.get(appName); Lease<InstanceInfo> lease = null; if (leaseMap != null) { lease = leaseMap.get(id); } if (lease != null && (!isLeaseExpirationEnabled() || !lease.isExpired())) { return decorateInstanceInfo(lease); } else if (includeRemoteRegions) { for (RemoteRegionRegistry remoteRegistry : this.regionNameVSRemoteRegistry.values()) { Application application = remoteRegistry.getApplication(appName); if (application != null) { return application.getByInstanceId(id); } } } return null; }
Lease<InstanceInfo> lease = leaseMap.get(id); if (lease == null || (isLeaseExpirationEnabled() && lease.isExpired())) { continue;
public void evict(long additionalLeaseMs) { logger.debug("Running the evict task"); if (!isLeaseExpirationEnabled()) { logger.debug("DS: lease expiration is currently disabled."); return;
/** * Gets the {@link InstanceInfo} information. * * @param appName the application name for which the information is requested. * @param id the unique identifier of the instance. * @param includeRemoteRegions true, if we need to include applications from remote regions * as indicated by the region {@link URL} by this property * {@link EurekaServerConfig#getRemoteRegionUrls()}, false otherwise * @return the information about the instance. */ @Override public InstanceInfo getInstanceByAppAndId(String appName, String id, boolean includeRemoteRegions) { Map<String, Lease<InstanceInfo>> leaseMap = registry.get(appName); Lease<InstanceInfo> lease = null; if (leaseMap != null) { lease = leaseMap.get(id); } if (lease != null && (!isLeaseExpirationEnabled() || !lease.isExpired())) { return decorateInstanceInfo(lease); } else if (includeRemoteRegions) { for (RemoteRegionRegistry remoteRegistry : this.regionNameVSRemoteRegistry.values()) { Application application = remoteRegistry.getApplication(appName); if (application != null) { return application.getByInstanceId(id); } } } return null; }