tabletconn

package
v0.21.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 3, 2024 License: Apache-2.0 Imports: 13 Imported by: 23

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ConnClosed is returned when the underlying connection was closed.
	ConnClosed = vterrors.New(vtrpcpb.Code_UNAVAILABLE, "vttablet: Connection Closed")
)

Functions

func ErrorFromGRPC

func ErrorFromGRPC(err error) error

ErrorFromGRPC converts a GRPC error to vtError for tabletserver calls.

func ErrorFromVTRPC

func ErrorFromVTRPC(err *vtrpcpb.RPCError) error

ErrorFromVTRPC converts a *vtrpcpb.RPCError to vtError for tabletserver calls.

func RegisterDialer

func RegisterDialer(name string, dialer TabletDialer)

RegisterDialer is meant to be used by TabletDialer implementations to self register.

func RegisterFlags added in v0.15.0

func RegisterFlags(fs *pflag.FlagSet)

RegisterFlags registers the tabletconn flags on a given flagset. It is exported for tests that need to inject a particular TabletProtocol.

Types

type TabletDialer

type TabletDialer func(ctx context.Context, tablet *topodatapb.Tablet, failFast grpcclient.FailFast) (queryservice.QueryService, error)

TabletDialer represents a function that will return a QueryService object that can communicate with a tablet. Only the tablet's HostName and PortMap should be used (and maybe the alias for debug messages).

timeout represents the connection timeout. If set to 0, this connection should be established in the background and the TabletDialer should return right away.

func GetDialer

func GetDialer() TabletDialer

GetDialer returns the dialer to use, described by the command line flag

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL