public final class DiscoveryResult extends java.lang.Object implements ResolverResult
Wraps a single instance of discovery enabled server, and stats related to it.
| Modifier and Type | Field and Description |
|---|---|
static DiscoveryResult |
EMPTY
This exists to allow for a semblance of type safety, and encourages avoiding null checks on the underlying Server,
thus representing a sentinel value for an empty resolution result.
|
| Constructor and Description |
|---|
DiscoveryResult(com.netflix.niws.loadbalancer.DiscoveryEnabledServer server)
This solely exists to create a result object from incomplete InstanceInfo.
|
DiscoveryResult(com.netflix.niws.loadbalancer.DiscoveryEnabledServer server,
com.netflix.loadbalancer.LoadBalancerStats lbStats) |
| Modifier and Type | Method and Description |
|---|---|
void |
addToFailureCount() |
void |
clearSuccessiveConnectionFailureCount() |
void |
decrementActiveRequestsCount() |
void |
decrementOpenConnectionsCount() |
boolean |
equals(java.lang.Object obj)
Two instances are deemed identical if they wrap the same underlying discovery server instance.
|
static DiscoveryResult |
from(com.netflix.appinfo.InstanceInfo instanceInfo,
boolean useSecurePort)
This convenience method exists for usage in tests.
|
int |
getActiveRequestsCount() |
java.lang.String |
getAppName() |
java.lang.String |
getASGName() |
java.lang.String |
getAvailabilityZone() |
java.lang.String |
getHost() |
java.util.Optional<java.lang.String> |
getIPAddr() |
SimpleMetaInfo |
getMetaInfo() |
int |
getOpenConnectionsCount() |
int |
getPort() |
int |
getSecurePort() |
com.netflix.niws.loadbalancer.DiscoveryEnabledServer |
getServer() |
java.lang.String |
getServerId() |
java.lang.String |
getTarget() |
long |
getTotalRequestsCount() |
java.lang.String |
getZone() |
int |
hashCode() |
void |
incrementActiveRequestsCount() |
void |
incrementNumRequests() |
void |
incrementOpenConnectionsCount() |
void |
incrementSuccessiveConnectionFailureCount() |
boolean |
isCircuitBreakerTripped() |
boolean |
isDiscoveryEnabled() |
boolean |
isSecurePortEnabled() |
void |
noteResponseTime(double msecs) |
void |
stopPublishingStats() |
public static final DiscoveryResult EMPTY
public DiscoveryResult(com.netflix.niws.loadbalancer.DiscoveryEnabledServer server,
com.netflix.loadbalancer.LoadBalancerStats lbStats)
public DiscoveryResult(com.netflix.niws.loadbalancer.DiscoveryEnabledServer server)
public static DiscoveryResult from(com.netflix.appinfo.InstanceInfo instanceInfo, boolean useSecurePort)
public java.util.Optional<java.lang.String> getIPAddr()
public java.lang.String getHost()
getHost in interface ResolverResultpublic boolean isDiscoveryEnabled()
isDiscoveryEnabled in interface ResolverResultpublic int getPort()
getPort in interface ResolverResultpublic int getSecurePort()
public boolean isSecurePortEnabled()
public java.lang.String getTarget()
public SimpleMetaInfo getMetaInfo()
@Nullable public java.lang.String getAvailabilityZone()
public java.lang.String getZone()
public java.lang.String getServerId()
public com.netflix.niws.loadbalancer.DiscoveryEnabledServer getServer()
public java.lang.String getASGName()
public java.lang.String getAppName()
public void noteResponseTime(double msecs)
public boolean isCircuitBreakerTripped()
public void incrementActiveRequestsCount()
public void incrementOpenConnectionsCount()
public void incrementSuccessiveConnectionFailureCount()
public void incrementNumRequests()
public int getOpenConnectionsCount()
public long getTotalRequestsCount()
public int getActiveRequestsCount()
public void decrementOpenConnectionsCount()
public void decrementActiveRequestsCount()
public void clearSuccessiveConnectionFailureCount()
public void addToFailureCount()
public void stopPublishingStats()
public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Object