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 Type
    Method
    Description
    Returns the network address of this server.
    io.grpc.ManagedChannel
    Returns the gRPC channel for making RPCs to this server.
    boolean
    Returns 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 ChannelEndpointCache and should not be shut down directly by callers.

      Returns:
      the managed channel for this server