bq

package
v0.0.0-...-7fad99f Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BatchWriter

type BatchWriter struct {
	Writer       *Writer
	Serializer   *RowSerializer
	FlushEnabled bool
}

func NewBatchWriter

func NewBatchWriter(w *Writer, s *RowSerializer, flushEnabled bool) *BatchWriter

func (*BatchWriter) Flush

func (w *BatchWriter) Flush() (rows int)

func (*BatchWriter) Write

func (w *BatchWriter) Write(id uuid.UUID, cmd *commands.Append)

type BigQueryConn

type BigQueryConn struct {
	ProjectId    string
	WriterClient *managedwriter.Client
	QueryClient  *bigquery.Client
}

type Offset

type Offset = int64

type RowBuffer

type RowBuffer struct {
	Rows   [][]byte
	Buf    []byte // 9MB of data
	Length int
}

func (*RowBuffer) Reset

func (b *RowBuffer) Reset()

type RowSerializer

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

func NewRowSerializer

func NewRowSerializer(buffers int) *RowSerializer

func (*RowSerializer) Rows

func (s *RowSerializer) Rows(fn func(rows [][]byte)) (nrRows int)

Rows is used by another routine than Serialize.

func (*RowSerializer) Serialize

func (s *RowSerializer) Serialize(row *v1.Row)

Serialize is used by the same routine that does Append (the cmdhandler routine).

type Writer

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

func NewWriter

func NewWriter(ctx context.Context, conn *BigQueryConn, topic types.Topic, hr types.HashRange, from uuid.Time) *Writer

func (*Writer) Init

func (s *Writer) Init() error

func (*Writer) Write

func (s *Writer) Write(rows [][]byte) (err error)

Jump to

Keyboard shortcuts

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