Documentation ¶
Index ¶
Constants ¶
View Source
const ( ERR_NORMAL = iota ERR_RETRY ERR_FATAL ERR_TX_POOL_FULL ERR_NOT_IN_TX )
View Source
const (
CONN_CLOSED = OperationalError("vttablet: Connection Closed")
)
Variables ¶
This section is empty.
Functions ¶
func RegisterDialer ¶
func RegisterDialer(name string, dialer TabletDialer)
RegisterDialer is meant to be used by TabletDialer implementations to self register.
Types ¶
type OperationalError ¶
type OperationalError string
OperationalError represents an error due to a failure to communicate with vttablet.
func (OperationalError) Error ¶
func (e OperationalError) Error() string
type ServerError ¶
ServerError represents an error that was returned from a vttablet server.
func (*ServerError) Error ¶
func (e *ServerError) Error() string
type TabletConn ¶
type TabletConn interface { // Execute executes a non-streaming query on vttablet. Execute(context context.Context, query string, bindVars map[string]interface{}, transactionId int64) (*mproto.QueryResult, error) // ExecuteBatch executes a group of queries. ExecuteBatch(context context.Context, queries []tproto.BoundQuery, transactionId int64) (*tproto.QueryResultList, error) // StreamExecute executes a streaming query on vttablet. It returns a channel that will stream results. // It also returns an ErrFunc that can be called to check if there were any errors. ErrFunc can be called // immediately after StreamExecute returns to check if there were errors sending the call. It should also // be called after finishing the iteration over the channel to see if there were other errors. StreamExecute(context context.Context, query string, bindVars map[string]interface{}, transactionId int64) (<-chan *mproto.QueryResult, ErrFunc) // Transaction support Begin(context context.Context) (transactionId int64, err error) Commit(context context.Context, transactionId int64) error Rollback(context context.Context, transactionId int64) error // Close must be called for releasing resources. Close() // GetEndPoint returns the end point info. EndPoint() topo.EndPoint }
TabletConn defines the interface for a vttablet client. It should not be concurrently used across goroutines.
type TabletDialer ¶
type TabletDialer func(context context.Context, endPoint topo.EndPoint, keyspace, shard string, timeout time.Duration) (TabletConn, error)
TabletDialer represents a function that will return a TabletConn object that can communicate with a tablet.
func GetDialer ¶
func GetDialer() TabletDialer
GetDialer returns the dialer to use, described by the command line flag
Click to show internal directories.
Click to hide internal directories.