lookoutdb

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: May 5, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateJobRunContainers

func CreateJobRunContainers(ctx context.Context, db *pgxpool.Pool, instructions []*model.CreateJobRunContainerInstruction)

func CreateJobRunContainersBatch

func CreateJobRunContainersBatch(ctx context.Context, db *pgxpool.Pool, instructions []*model.CreateJobRunContainerInstruction) error

func CreateJobRunContainersScalar

func CreateJobRunContainersScalar(ctx context.Context, db *pgxpool.Pool, instructions []*model.CreateJobRunContainerInstruction)

func CreateJobRuns

func CreateJobRuns(ctx context.Context, db *pgxpool.Pool, instructions []*model.CreateJobRunInstruction)

func CreateJobRunsBatch

func CreateJobRunsBatch(ctx context.Context, db *pgxpool.Pool, instructions []*model.CreateJobRunInstruction) error

func CreateJobRunsScalar

func CreateJobRunsScalar(ctx context.Context, db *pgxpool.Pool, instructions []*model.CreateJobRunInstruction)

func CreateJobs

func CreateJobs(ctx context.Context, db *pgxpool.Pool, instructions []*model.CreateJobInstruction)

func CreateJobsBatch

func CreateJobsBatch(ctx context.Context, db *pgxpool.Pool, instructions []*model.CreateJobInstruction) error

func CreateJobsScalar

func CreateJobsScalar(ctx context.Context, db *pgxpool.Pool, instructions []*model.CreateJobInstruction)

CreateJobsScalar will insert jobs one by one into the database

func CreateUserAnnotations

func CreateUserAnnotations(ctx context.Context, db *pgxpool.Pool, instructions []*model.CreateUserAnnotationInstruction)

func CreateUserAnnotationsBatch

func CreateUserAnnotationsBatch(ctx context.Context, db *pgxpool.Pool, instructions []*model.CreateUserAnnotationInstruction) error

func CreateUserAnnotationsScalar

func CreateUserAnnotationsScalar(ctx context.Context, db *pgxpool.Pool, instructions []*model.CreateUserAnnotationInstruction)

func ProcessUpdates

func ProcessUpdates(ctx context.Context, db *pgxpool.Pool, msgs chan *model.InstructionSet, bufferSize int) chan []*model.ConsumerMessageId

ProcessUpdates will update the lookout database according to the incoming channel of instructions. It returns a channel containing all the message ids that have been successfully processed.

func Update

func Update(ctx context.Context, db *pgxpool.Pool, instructions *model.InstructionSet)

Update updates the lookout database according to the supplied InstructionSet. The updates are applied in the following order: * New Job Creations * Job Updates, New Job Creations, New User Annotations * Job Run Updates, New Job Containers In each case we first try to bach insert the rows using the postgres copy protocol. If this fails then we try a slower, serial insert and discard any rows that cannot be inserted. TODO: identify transient errors (e.g. database down) and retry until resolved

func UpdateJobRuns

func UpdateJobRuns(ctx context.Context, db *pgxpool.Pool, instructions []*model.UpdateJobRunInstruction)

func UpdateJobRunsBatch

func UpdateJobRunsBatch(ctx context.Context, db *pgxpool.Pool, instructions []*model.UpdateJobRunInstruction) error

func UpdateJobRunsScalar

func UpdateJobRunsScalar(ctx context.Context, db *pgxpool.Pool, instructions []*model.UpdateJobRunInstruction)

func UpdateJobs

func UpdateJobs(ctx context.Context, db *pgxpool.Pool, instructions []*model.UpdateJobInstruction)

func UpdateJobsBatch

func UpdateJobsBatch(ctx context.Context, db *pgxpool.Pool, instructions []*model.UpdateJobInstruction) error

func UpdateJobsScalar

func UpdateJobsScalar(ctx context.Context, db *pgxpool.Pool, instructions []*model.UpdateJobInstruction)

Types

This section is empty.

Jump to

Keyboard shortcuts

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