public class InstanceRegistry
extends com.netflix.eureka.registry.PeerAwareInstanceRegistryImpl
implements org.springframework.context.ApplicationContextAware
| Constructor and Description |
|---|
InstanceRegistry(com.netflix.eureka.EurekaServerConfig serverConfig,
com.netflix.discovery.EurekaClientConfig clientConfig,
com.netflix.eureka.resources.ServerCodecs serverCodecs,
com.netflix.discovery.EurekaClient eurekaClient,
int expectedNumberOfClientsSendingRenews,
int defaultOpenForTrafficCount) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
cancel(String appName,
String serverId,
boolean isReplication) |
protected boolean |
internalCancel(String appName,
String id,
boolean isReplication) |
void |
openForTraffic(com.netflix.appinfo.ApplicationInfoManager applicationInfoManager,
int count)
If
PeerAwareInstanceRegistryImpl.openForTraffic(ApplicationInfoManager, int)
is called with a zero argument, it means that leases are not automatically
cancelled if the instance hasn't sent any renewals recently. |
void |
register(com.netflix.appinfo.InstanceInfo info,
boolean isReplication) |
void |
register(com.netflix.appinfo.InstanceInfo info,
int leaseDuration,
boolean isReplication) |
boolean |
renew(String appName,
String serverId,
boolean isReplication) |
void |
setApplicationContext(org.springframework.context.ApplicationContext context) |
deleteStatusOverride, getInstanceInfoOverrideRule, getLocalRegistrySize, getNextServerFromEureka, getNumOfReplicationsInLastMin, getReplicaNodes, getSortedApplications, init, isBelowRenewThresold, isLeaseExpirationEnabled, isLeaseExpirationEnabledMetric, isRegisterable, isSelfPreservationModeEnabled, isSelfPreservationModeEnabledMetric, shouldAllowAccess, shouldAllowAccess, shouldAllowAccessMetric, shutdown, statusUpdate, statusUpdate, syncUpclearRegistry, evict, evict, getApplication, getApplication, getApplicationDeltas, getApplicationDeltasFromMultipleRegions, getApplications, getApplications, getApplicationsFromAllRemoteRegions, getApplicationsFromLocalRegionOnly, getApplicationsFromMultipleRegions, getInstanceByAppAndId, getInstanceByAppAndId, getInstancesById, getInstancesById, getLastNCanceledInstances, getLastNRegisteredInstances, getNumberofElementsininstanceCache, getNumOfRenewsInLastMin, getNumOfRenewsPerMinThreshold, getOverriddenInstanceStatus, getResponseCache, initializedResponseCache, initRemoteRegionRegistry, overriddenInstanceStatusesSnapshot, postInit, storeOverriddenStatusIfRequired, storeOverriddenStatusIfRequired, updateRenewsPerMinThresholdclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclearRegistry, getApplication, getApplicationsFromLocalRegionOnly, getInstanceByAppAndId, getInstanceByAppAndId, getLastNCanceledInstances, getLastNRegisteredInstances, getNumOfRenewsInLastMin, getNumOfRenewsPerMinThreshold, getResponseCache, initializedResponseCache, overriddenInstanceStatusesSnapshot, storeOverriddenStatusIfRequired, storeOverriddenStatusIfRequiredpublic InstanceRegistry(com.netflix.eureka.EurekaServerConfig serverConfig,
com.netflix.discovery.EurekaClientConfig clientConfig,
com.netflix.eureka.resources.ServerCodecs serverCodecs,
com.netflix.discovery.EurekaClient eurekaClient,
int expectedNumberOfClientsSendingRenews,
int defaultOpenForTrafficCount)
public void setApplicationContext(org.springframework.context.ApplicationContext context)
throws org.springframework.beans.BeansException
setApplicationContext in interface org.springframework.context.ApplicationContextAwareorg.springframework.beans.BeansExceptionpublic void openForTraffic(com.netflix.appinfo.ApplicationInfoManager applicationInfoManager,
int count)
PeerAwareInstanceRegistryImpl.openForTraffic(ApplicationInfoManager, int)
is called with a zero argument, it means that leases are not automatically
cancelled if the instance hasn't sent any renewals recently. This happens for a
standalone server. It seems like a bad default, so we set it to the smallest
non-zero value we can, so that any instances that subsequently register can bump up
the threshold.openForTraffic in interface com.netflix.eureka.registry.InstanceRegistryopenForTraffic in class com.netflix.eureka.registry.PeerAwareInstanceRegistryImplpublic void register(com.netflix.appinfo.InstanceInfo info,
int leaseDuration,
boolean isReplication)
register in interface com.netflix.eureka.lease.LeaseManager<com.netflix.appinfo.InstanceInfo>register in class com.netflix.eureka.registry.AbstractInstanceRegistrypublic void register(com.netflix.appinfo.InstanceInfo info,
boolean isReplication)
register in interface com.netflix.eureka.registry.PeerAwareInstanceRegistryregister in class com.netflix.eureka.registry.PeerAwareInstanceRegistryImplpublic boolean cancel(String appName, String serverId, boolean isReplication)
cancel in interface com.netflix.eureka.lease.LeaseManager<com.netflix.appinfo.InstanceInfo>cancel in class com.netflix.eureka.registry.PeerAwareInstanceRegistryImplpublic boolean renew(String appName, String serverId, boolean isReplication)
renew in interface com.netflix.eureka.lease.LeaseManager<com.netflix.appinfo.InstanceInfo>renew in class com.netflix.eureka.registry.PeerAwareInstanceRegistryImplCopyright © 2021 Pivotal Software, Inc.. All rights reserved.