Documentation ¶
Overview ¶
Package l2vtgate provides the core functionnality of a second-layer vtgate to route queries from an original vtgate to a subset of tablets.
Index ¶
- Variables
- type L2VTGate
- func (l *L2VTGate) Begin(ctx context.Context, target *querypb.Target) (int64, error)
- func (l *L2VTGate) BeginExecute(ctx context.Context, target *querypb.Target, sql string, ...) (result *sqltypes.Result, transactionID int64, err error)
- func (l *L2VTGate) BeginExecuteBatch(ctx context.Context, target *querypb.Target, queries []querytypes.BoundQuery, ...) (results []sqltypes.Result, transactionID int64, err error)
- func (l *L2VTGate) Commit(ctx context.Context, target *querypb.Target, transactionID int64) error
- func (l *L2VTGate) CommitPrepared(ctx context.Context, target *querypb.Target, dtid string) (err error)
- func (l *L2VTGate) CreateTransaction(ctx context.Context, target *querypb.Target, dtid string, ...) (err error)
- func (l *L2VTGate) Execute(ctx context.Context, target *querypb.Target, sql string, ...) (result *sqltypes.Result, err error)
- func (l *L2VTGate) ExecuteBatch(ctx context.Context, target *querypb.Target, queries []querytypes.BoundQuery, ...) (results []sqltypes.Result, err error)
- func (l *L2VTGate) Gateway() gateway.Gateway
- func (l *L2VTGate) GetGatewayCacheStatus() gateway.TabletCacheStatusList
- func (l *L2VTGate) HandlePanic(err *error)
- func (l *L2VTGate) Prepare(ctx context.Context, target *querypb.Target, transactionID int64, dtid string) (err error)
- func (l *L2VTGate) ReadTransaction(ctx context.Context, target *querypb.Target, dtid string) (metadata *querypb.TransactionMetadata, err error)
- func (l *L2VTGate) ResolveTransaction(ctx context.Context, target *querypb.Target, dtid string) (err error)
- func (l *L2VTGate) Rollback(ctx context.Context, target *querypb.Target, transactionID int64) error
- func (l *L2VTGate) RollbackPrepared(ctx context.Context, target *querypb.Target, dtid string, originalID int64) (err error)
- func (l *L2VTGate) SetRollback(ctx context.Context, target *querypb.Target, dtid string, transactionID int64) (err error)
- func (l *L2VTGate) SplitQuery(ctx context.Context, target *querypb.Target, sql string, ...) (splits []querytypes.QuerySplit, err error)
- func (l *L2VTGate) StartCommit(ctx context.Context, target *querypb.Target, transactionID int64, dtid string) (err error)
- func (l *L2VTGate) StreamExecute(ctx context.Context, target *querypb.Target, sql string, ...) (err error)
- func (l *L2VTGate) StreamHealthRegister(chan<- *querypb.StreamHealthResponse) (int, error)
- func (l *L2VTGate) StreamHealthUnregister(int) error
- func (l *L2VTGate) UpdateStream(ctx context.Context, target *querypb.Target, position string, timestamp int64, ...) error
- type RegisterL2VTGate
Constants ¶
This section is empty.
Variables ¶
var RegisterL2VTGates []RegisterL2VTGate
RegisterL2VTGates stores register funcs for L2VTGate server.
Functions ¶
This section is empty.
Types ¶
type L2VTGate ¶
type L2VTGate struct {
// contains filtered or unexported fields
}
L2VTGate implements queryservice.QueryService and forwards queries to the underlying gateway.
func Init ¶
func Init(hc discovery.HealthCheck, topoServer topo.Server, serv topo.SrvTopoServer, statsName, cell string, retryCount int, tabletTypesToWait []topodatapb.TabletType) *L2VTGate
Init creates the single L2VTGate with the provided parameters.
func (*L2VTGate) BeginExecute ¶
func (l *L2VTGate) BeginExecute(ctx context.Context, target *querypb.Target, sql string, bindVariables map[string]interface{}, options *querypb.ExecuteOptions) (result *sqltypes.Result, transactionID int64, err error)
BeginExecute is part of the queryservice.QueryService interface
func (*L2VTGate) BeginExecuteBatch ¶
func (l *L2VTGate) BeginExecuteBatch(ctx context.Context, target *querypb.Target, queries []querytypes.BoundQuery, asTransaction bool, options *querypb.ExecuteOptions) (results []sqltypes.Result, transactionID int64, err error)
BeginExecuteBatch is part of the queryservice.QueryService interface
func (*L2VTGate) CommitPrepared ¶
func (l *L2VTGate) CommitPrepared(ctx context.Context, target *querypb.Target, dtid string) (err error)
CommitPrepared is part of the queryservice.QueryService interface
func (*L2VTGate) CreateTransaction ¶
func (l *L2VTGate) CreateTransaction(ctx context.Context, target *querypb.Target, dtid string, participants []*querypb.Target) (err error)
CreateTransaction is part of the queryservice.QueryService interface
func (*L2VTGate) Execute ¶
func (l *L2VTGate) Execute(ctx context.Context, target *querypb.Target, sql string, bindVariables map[string]interface{}, transactionID int64, options *querypb.ExecuteOptions) (result *sqltypes.Result, err error)
Execute is part of the queryservice.QueryService interface
func (*L2VTGate) ExecuteBatch ¶
func (l *L2VTGate) ExecuteBatch(ctx context.Context, target *querypb.Target, queries []querytypes.BoundQuery, asTransaction bool, transactionID int64, options *querypb.ExecuteOptions) (results []sqltypes.Result, err error)
ExecuteBatch is part of the queryservice.QueryService interface
func (*L2VTGate) GetGatewayCacheStatus ¶
func (l *L2VTGate) GetGatewayCacheStatus() gateway.TabletCacheStatusList
GetGatewayCacheStatus returns a displayable version of the Gateway cache.
func (*L2VTGate) HandlePanic ¶
HandlePanic is part of the queryservice.QueryService interface
func (*L2VTGate) Prepare ¶
func (l *L2VTGate) Prepare(ctx context.Context, target *querypb.Target, transactionID int64, dtid string) (err error)
Prepare is part of the queryservice.QueryService interface
func (*L2VTGate) ReadTransaction ¶
func (l *L2VTGate) ReadTransaction(ctx context.Context, target *querypb.Target, dtid string) (metadata *querypb.TransactionMetadata, err error)
ReadTransaction is part of the queryservice.QueryService interface
func (*L2VTGate) ResolveTransaction ¶
func (l *L2VTGate) ResolveTransaction(ctx context.Context, target *querypb.Target, dtid string) (err error)
ResolveTransaction is part of the queryservice.QueryService interface
func (*L2VTGate) RollbackPrepared ¶
func (l *L2VTGate) RollbackPrepared(ctx context.Context, target *querypb.Target, dtid string, originalID int64) (err error)
RollbackPrepared is part of the queryservice.QueryService interface
func (*L2VTGate) SetRollback ¶
func (l *L2VTGate) SetRollback(ctx context.Context, target *querypb.Target, dtid string, transactionID int64) (err error)
SetRollback is part of the queryservice.QueryService interface
func (*L2VTGate) SplitQuery ¶
func (l *L2VTGate) SplitQuery(ctx context.Context, target *querypb.Target, sql string, bindVariables map[string]interface{}, splitColumns []string, splitCount int64, numRowsPerQueryPart int64, algorithm querypb.SplitQueryRequest_Algorithm) (splits []querytypes.QuerySplit, err error)
SplitQuery is part of the queryservice.QueryService interface
func (*L2VTGate) StartCommit ¶
func (l *L2VTGate) StartCommit(ctx context.Context, target *querypb.Target, transactionID int64, dtid string) (err error)
StartCommit is part of the queryservice.QueryService interface
func (*L2VTGate) StreamExecute ¶
func (l *L2VTGate) StreamExecute(ctx context.Context, target *querypb.Target, sql string, bindVariables map[string]interface{}, options *querypb.ExecuteOptions, sendReply func(*sqltypes.Result) error) (err error)
StreamExecute is part of the queryservice.QueryService interface
func (*L2VTGate) StreamHealthRegister ¶
func (l *L2VTGate) StreamHealthRegister(chan<- *querypb.StreamHealthResponse) (int, error)
StreamHealthRegister is part of the queryservice.QueryService interface
func (*L2VTGate) StreamHealthUnregister ¶
StreamHealthUnregister is part of the queryservice.QueryService interface
type RegisterL2VTGate ¶
type RegisterL2VTGate func(queryservice.QueryService)
RegisterL2VTGate defines the type of registration mechanism.