public interface ChannelEndpointRepresents a Spanner server endpoint for location-aware routing.
Each instance wraps a gRPC ManagedChannel connected to a specific Spanner server. The ChannelEndpointCache creates and caches these instances.
Implementations must be thread-safe as instances may be shared across multiple concurrent operations. See Also: ChannelEndpointCache
Methods
getAddress()
public abstract String getAddress()Returns the network address of this server.
| Returns | |
|---|---|
| Type | Description |
String |
the server address in "host:port" format |
getChannel()
public abstract ManagedChannel getChannel()Returns the gRPC channel for making RPCs to this server.
The returned channel is managed by the ChannelEndpointCache and should not be shut down directly by callers.
| Returns | |
|---|---|
| Type | Description |
io.grpc.ManagedChannel |
the managed channel for this server |
isHealthy()
public abstract boolean isHealthy()Returns whether this server's channel is in READY state and can accept location-aware
RPCs.
Only endpoints in READY state are eligible for location-aware routing. Endpoints in
IDLE, CONNECTING, TRANSIENT_FAILURE, or SHUTDOWN are not
considered healthy for location-aware routing purposes.
| Returns | |
|---|---|
| Type | Description |
boolean |
true if the channel is in READY state |
isTransientFailure()
public abstract boolean isTransientFailure()Returns whether this server's channel is in TRANSIENT_FAILURE state.
When an endpoint is in transient failure, it should be reported as a skipped tablet in routing hints so the server can refresh the client cache.
| Returns | |
|---|---|
| Type | Description |
boolean |
true if the channel is in TRANSIENT_FAILURE state |