testutil

package
v0.0.0-...-6e93ed8 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecMultiSQLInGoroutine

func ExecMultiSQLInGoroutine(s kv.Storage, dbName string, multiSQL []string, done chan error)

ExecMultiSQLInGoroutine exports for testing.

func ExtractAllTableHandles

func ExtractAllTableHandles(se sessiontypes.Session, dbName, tbName string) ([]int64, error)

ExtractAllTableHandles extracts all handles of a given table.

func FindIdxInfo

func FindIdxInfo(dom *domain.Domain, dbName, tbName, idxName string) *model.IndexInfo

FindIdxInfo is to get IndexInfo by index name.

func SessionExecInGoroutine

func SessionExecInGoroutine(s kv.Storage, dbName, sql string, done chan error)

SessionExecInGoroutine export for testing.

func TestMatchCancelState

func TestMatchCancelState(t *testing.T, job *model.Job, cancelState any, sql string) bool

TestMatchCancelState is used to test whether the cancel state matches.

Types

type OperatorTestSink

type OperatorTestSink[T any] struct {
	// contains filtered or unexported fields
}

OperatorTestSink is used for dist task operator test.

func NewOperatorTestSink

func NewOperatorTestSink[T any]() *OperatorTestSink[T]

NewOperatorTestSink creates a new OperatorTestSink.

func (*OperatorTestSink[T]) Close

func (s *OperatorTestSink[T]) Close() error

Close implements disttask/operator.Operator.

func (*OperatorTestSink[T]) Collect

func (s *OperatorTestSink[T]) Collect() []T

Collect the result from OperatorTestSink.

func (*OperatorTestSink[T]) Open

func (s *OperatorTestSink[T]) Open() error

Open implements disttask/operator.Operator.

func (*OperatorTestSink[T]) SetSource

func (s *OperatorTestSink[T]) SetSource(dataCh operator.DataChannel[T])

SetSource implements disttask/operator.Operator.

func (*OperatorTestSink[T]) String

func (*OperatorTestSink[T]) String() string

String implements disttask/operator.Operator.

type OperatorTestSource

type OperatorTestSource[T any] struct {
	// contains filtered or unexported fields
}

OperatorTestSource is used for dist task operator test.

func NewOperatorTestSource

func NewOperatorTestSource[T any](toBeSent ...T) *OperatorTestSource[T]

NewOperatorTestSource creates a new OperatorTestSource.

func (*OperatorTestSource[T]) Close

func (s *OperatorTestSource[T]) Close() error

Close implements disttask/operator.Operator.

func (*OperatorTestSource[T]) Open

func (s *OperatorTestSource[T]) Open() error

Open implements disttask/operator.Operator.

func (*OperatorTestSource[T]) SetSink

func (s *OperatorTestSource[T]) SetSink(sink operator.DataChannel[T])

SetSink implements disttask/operator.Operator.

func (*OperatorTestSource[T]) String

func (*OperatorTestSource[T]) String() string

String implements disttask/operator.Operator.

type SubStates

type SubStates = []model.SchemaState

SubStates is a slice of SchemaState.

Jump to

Keyboard shortcuts

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