tabletconntest

package
v2.0.0-beta.2+incompat... Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2016 License: BSD-3-Clause Imports: 17 Imported by: 0

Documentation

Overview

Package tabletconntest provides the test methods to make sure a tabletconn/queryservice pair over RPC works correctly.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TestSuite

func TestSuite(t *testing.T, protocol string, endPoint *topodatapb.EndPoint, fake *FakeQueryService)

TestSuite runs all the tests

Types

type FakeQueryService

type FakeQueryService struct {
	// contains filtered or unexported fields
}

FakeQueryService has the server side of this fake

func CreateFakeServer

func CreateFakeServer(t *testing.T) *FakeQueryService

CreateFakeServer returns the fake server for the tests

func (*FakeQueryService) Begin

func (f *FakeQueryService) Begin(ctx context.Context, target *querypb.Target, sessionID int64) (int64, error)

Begin is part of the queryservice.QueryService interface

func (*FakeQueryService) Commit

func (f *FakeQueryService) Commit(ctx context.Context, target *querypb.Target, sessionID, transactionID int64) error

Commit is part of the queryservice.QueryService interface

func (*FakeQueryService) Execute

func (f *FakeQueryService) Execute(ctx context.Context, target *querypb.Target, sql string, bindVariables map[string]interface{}, sessionID, transactionID int64) (*sqltypes.Result, error)

Execute is part of the queryservice.QueryService interface

func (*FakeQueryService) ExecuteBatch

func (f *FakeQueryService) ExecuteBatch(ctx context.Context, target *querypb.Target, queries []querytypes.BoundQuery, sessionID int64, asTransaction bool, transactionID int64) ([]sqltypes.Result, error)

ExecuteBatch is part of the queryservice.QueryService interface

func (*FakeQueryService) GetSessionId

func (f *FakeQueryService) GetSessionId(keyspace, shard string) (int64, error)

GetSessionId is part of the queryservice.QueryService interface

func (*FakeQueryService) HandlePanic

func (f *FakeQueryService) HandlePanic(err *error)

HandlePanic is part of the queryservice.QueryService interface

func (*FakeQueryService) Rollback

func (f *FakeQueryService) Rollback(ctx context.Context, target *querypb.Target, sessionID, transactionID int64) error

Rollback is part of the queryservice.QueryService interface

func (*FakeQueryService) SplitQuery

func (f *FakeQueryService) SplitQuery(ctx context.Context, target *querypb.Target, sql string, bindVariables map[string]interface{}, splitColumn string, splitCount int64, sessionID int64) ([]querytypes.QuerySplit, error)

SplitQuery is part of the queryservice.QueryService interface

func (*FakeQueryService) SplitQueryV2

func (f *FakeQueryService) SplitQueryV2(
	ctx context.Context,
	target *querypb.Target,
	sql string,
	bindVariables map[string]interface{},
	splitColumns []string,
	splitCount int64,
	numRowsPerQueryPart int64,
	algorithm querypb.SplitQueryRequest_Algorithm,
	sessionID int64) ([]querytypes.QuerySplit, error)

SplitQueryV2 is part of the queryservice.QueryService interface TODO(erez): Rename to SplitQuery after migration to SplitQuery V2 is done.

func (*FakeQueryService) StreamExecute

func (f *FakeQueryService) StreamExecute(ctx context.Context, target *querypb.Target, sql string, bindVariables map[string]interface{}, sessionID int64, sendReply func(*sqltypes.Result) error) error

StreamExecute is part of the queryservice.QueryService interface

func (*FakeQueryService) StreamHealthRegister

func (f *FakeQueryService) StreamHealthRegister(c chan<- *querypb.StreamHealthResponse) (int, error)

StreamHealthRegister is part of the queryservice.QueryService interface

func (*FakeQueryService) StreamHealthUnregister

func (f *FakeQueryService) StreamHealthUnregister(int) error

StreamHealthUnregister is part of the queryservice.QueryService interface

Jump to

Keyboard shortcuts

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