queryapi

package
v0.22.5 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package queryapi implements the Armada server's Jobs gRPC service (the "Query API"), which serves programmatic job-status queries by reading the Lookout database (the job, job_run, job_spec and job_error tables) directly via the server's own connection pool.

The QueryApi type in query_api.go implements each RPC by issuing type-safe queries generated by sqlc (see the database subpackage).

mirror.go provides optional, opt-in server-side query mirroring: when enabled, a QueryDB wrapper replays each query against a second database in a bounded, fire-and-forget manner so that database can be evaluated under real Query API load. Mirror results and errors are discarded and never affect the primary query path.

Index

Constants

This section is empty.

Variables

JobRunStateMap is a mapping between database state and api Job Run states

JobStateMap is a mapping between database state and api Job states

Functions

func DbTimeToTimestamp

func DbTimeToTimestamp(t pgtype.Timestamp) *types.Timestamp

func NilStringToString

func NilStringToString(s *string) string

Types

type QueryApi

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

func New

func New(db QueryDB, maxQueryItems int, decompressorFactory func() compress.Decompressor) *QueryApi

func (*QueryApi) GetActiveQueues added in v0.18.0

func (*QueryApi) GetJobDetails

func (q *QueryApi) GetJobDetails(ctx context.Context, req *api.JobDetailsRequest) (*api.JobDetailsResponse, error)

func (*QueryApi) GetJobErrors added in v0.15.0

func (q *QueryApi) GetJobErrors(ctx context.Context, req *api.JobErrorsRequest) (*api.JobErrorsResponse, error)

func (*QueryApi) GetJobRunDetails

func (q *QueryApi) GetJobRunDetails(ctx context.Context, req *api.JobRunDetailsRequest) (*api.JobRunDetailsResponse, error)

func (*QueryApi) GetJobStatus

func (q *QueryApi) GetJobStatus(ctx context.Context, req *api.JobStatusRequest) (*api.JobStatusResponse, error)

func (*QueryApi) GetJobStatusUsingExternalJobUri added in v0.15.0

func (q *QueryApi) GetJobStatusUsingExternalJobUri(ctx context.Context, req *api.JobStatusUsingExternalJobUriRequest) (*api.JobStatusResponse, error)

type QueryDB added in v0.22.2

type QueryDB interface {
	database.DBTX
	BeginTx(ctx context.Context, opts pgx.TxOptions) (pgx.Tx, error)
}

QueryDB is the subset of *pgxpool.Pool that QueryApi depends on. Both the real pool and the mirroring wrapper satisfy it.

func NewMirroringDB added in v0.22.2

func NewMirroringDB(primary QueryDB, mirror *pgxpool.Pool, maxInFlight int) QueryDB

NewMirroringDB returns a QueryDB that delegates to primary and additionally replays each query against mirror in a bounded, fire-and-forget manner.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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