bqexporter

package
v0.0.0-...-d3da680 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2024 License: Apache-2.0 Imports: 50 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ArtifactTasks = tq.RegisterTaskClass(tq.TaskClass{
	ID:            "bq-artifact-export",
	Prototype:     &taskspb.ExportInvocationArtifactsToBQ{},
	Kind:          tq.Transactional,
	Queue:         "bqartifactexports",
	RoutingPrefix: "/internal/tasks/bqexporter",
})

ArtifactTasks describes how to route bq artifact export tasks.

View Source
var InvocationTasks = tq.RegisterTaskClass(tq.TaskClass{
	ID:            "bq-invocation-export",
	Prototype:     &taskspb.ExportInvocationToBQ{},
	Kind:          tq.Transactional,
	Queue:         "bqinvocationexports",
	RoutingPrefix: "/internal/tasks/bqexporter",
})

InvocationTasks describes how to route bq invocation export tasks.

View Source
var TestResultTasks = tq.RegisterTaskClass(tq.TaskClass{
	ID:            "bq-test-result-export",
	Prototype:     &taskspb.ExportInvocationTestResultsToBQ{},
	Kind:          tq.Transactional,
	Queue:         "bqtestresultexports",
	RoutingPrefix: "/internal/tasks/bqexporter",
})

TestResultTasks describes how to route bq test result export tasks.

Functions

func InitServer

func InitServer(srv *server.Server, opts Options) error

InitServer initializes a bqexporter server.

func Schedule

func Schedule(ctx context.Context, invID invocations.ID) error

Schedule schedules tasks for all the given invocation's BigQuery Exports.

Types

type InvClient

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

InvClient provides methods to export data to BigQuery via the BigQuery Write API.

func NewInvClient

func NewInvClient(ctx context.Context, projectID string) (s *InvClient, reterr error)

NewInvClient creates a new client for exporting data via the BigQuery Write API.

func (*InvClient) Close

func (c *InvClient) Close() (reterr error)

Close releases resources held by the client.

func (*InvClient) EnsureSchema

func (c *InvClient) EnsureSchema(ctx context.Context) error

func (*InvClient) InsertInvocationRow

func (c *InvClient) InsertInvocationRow(ctx context.Context, row *bqpb.InvocationRow) error

InsertInvocationRow inserts one InvocationRow in BigQuery.

type InvExportClient

type InvExportClient interface {
	InsertInvocationRow(ctx context.Context, row *bqpb.InvocationRow) error
}

InvExportClient is the interface for exporting invocations.

type Options

type Options struct {
	// Whether to use InsertIDs in BigQuery Streaming Inserts.
	UseInsertIDs bool

	// Maximum number of rows in a batch.
	MaxBatchRowCount int

	// Maximum size of a batch in bytes, approximate.
	MaxBatchSizeApprox int

	// Maximum size of all batches held in memory, approximate.
	MaxBatchTotalSizeApprox int

	// Maximum rate for BigQuery Streaming Inserts.
	RateLimit rate.Limit

	// ArtifactRBEInstance is the name of the RBE instance to use for artifact
	// storage. Example: "projects/luci-resultdb/instances/artifacts".
	ArtifactRBEInstance string
}

Options is bqexporter configuration.

func DefaultOptions

func DefaultOptions() Options

DefaultOptions returns Options with default values.

Jump to

Keyboard shortcuts

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