Package com.google.cloud.spanner.spi.v1
Interface ChannelEndpoint
@InternalApi
public interface ChannelEndpoint
Represents 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:
-
Method Summary
Modifier and TypeMethodDescriptionReturns the network address of this server.io.grpc.ManagedChannelReturns the gRPC channel for making RPCs to this server.booleanReturns whether this server is ready to accept RPCs.
-
Method Details
-
getAddress
String getAddress()Returns the network address of this server.- Returns:
- the server address in "host:port" format
-
isHealthy
boolean isHealthy()Returns whether this server is ready to accept RPCs.A server is considered unhealthy if:
- The underlying channel is shutdown or terminated
- The channel is in a transient failure state
- Returns:
- true if the server is healthy and ready to accept RPCs
-
getChannel
io.grpc.ManagedChannel getChannel()Returns the gRPC channel for making RPCs to this server.The returned channel is managed by the
ChannelEndpointCacheand should not be shut down directly by callers.- Returns:
- the managed channel for this server
-