l2vtgate

package
v2.1.0-alpha.1+incompa... Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2016 License: BSD-3-Clause Imports: 18 Imported by: 0

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

Constants

This section is empty.

Variables

View Source
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) Begin

func (l *L2VTGate) Begin(ctx context.Context, target *querypb.Target) (int64, error)

Begin is part of the queryservice.QueryService interface

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) Commit

func (l *L2VTGate) Commit(ctx context.Context, target *querypb.Target, transactionID int64) error

Commit 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) Gateway

func (l *L2VTGate) Gateway() gateway.Gateway

Gateway returns this l2vtgate Gateway object (for tests mainly).

func (*L2VTGate) GetGatewayCacheStatus

func (l *L2VTGate) GetGatewayCacheStatus() gateway.TabletCacheStatusList

GetGatewayCacheStatus returns a displayable version of the Gateway cache.

func (*L2VTGate) HandlePanic

func (l *L2VTGate) HandlePanic(err *error)

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) Rollback

func (l *L2VTGate) Rollback(ctx context.Context, target *querypb.Target, transactionID int64) error

Rollback 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

func (l *L2VTGate) StreamHealthUnregister(int) error

StreamHealthUnregister is part of the queryservice.QueryService interface

func (*L2VTGate) UpdateStream

func (l *L2VTGate) UpdateStream(ctx context.Context, target *querypb.Target, position string, timestamp int64, sendReply func(*querypb.StreamEvent) error) error

UpdateStream is part of the queryservice.QueryService interface

type RegisterL2VTGate

type RegisterL2VTGate func(queryservice.QueryService)

RegisterL2VTGate defines the type of registration mechanism.

Jump to

Keyboard shortcuts

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