stream

package
v1.17.4 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const ShortRowsWriteErrFmt = "short rows write to server, rows read = %d, rows sent = %d"

Variables

This section is empty.

Functions

func CallBackUntilFirstBlock

func CallBackUntilFirstBlock(ctx context.Context, respStream <-chan response.Packet, callBack func(resp response.Packet)) (*data.Block, error)

func HandleInsertFromFmtStream

func HandleInsertFromFmtStream(
	ctx context.Context, respStream <-chan response.Packet,
	blockReader format.BlockStreamFmtReader,
	sendBlock SendBlock, cancelInsert CancelInsert, handleResp CallBackResp,
	opts ...InsertOption,
) (int, error)

Types

type CallBackResp

type CallBackResp func(resp response.Packet)

type CancelInsert

type CancelInsert func()

type InsertOption

type InsertOption func(process *InsertProcess)

func OptionAddCallBackResp

func OptionAddCallBackResp(callback CallBackResp) InsertOption

func OptionAddLogf

func OptionAddLogf(logf2 Logf) InsertOption

func OptionBatchSize

func OptionBatchSize(n int) InsertOption

type InsertProcess

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

func NewInsertProcess

func NewInsertProcess(sample *data.Block, sendBlock SendBlock, cancelInsert CancelInsert, opts ...InsertOption) *InsertProcess

func (*InsertProcess) BatchSize

func (p *InsertProcess) BatchSize() int

func (*InsertProcess) Error

func (p *InsertProcess) Error() error

func (*InsertProcess) Finish

func (p *InsertProcess) Finish() (int, error)

func (*InsertProcess) NumColumns

func (p *InsertProcess) NumColumns() int

func (*InsertProcess) Sample

func (p *InsertProcess) Sample() *data.Block

func (*InsertProcess) Start

func (p *InsertProcess) Start(ctx context.Context,
	inputBlockStream <-chan *data.Block, serverResponseStream <-chan response.Packet)

type Logf

type Logf func(s string, args ...interface{})

type SendBlock

type SendBlock func(b *data.Block) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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