Interface ChannelEndpoint (6.108.0)

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: 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 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
Type Description
boolean

true if the server is healthy and ready to accept RPCs