ppsdb

package
v2.7.0-nightly.20230526 Latest Latest
Warning

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

Go to latest
Published: May 25, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package ppsdb contains the database schema that PPS uses.

Index

Constants

This section is empty.

Variables

View Source
var JobsJobSetIndex = &col.Index{
	Name: "jobset",
	Extract: func(val proto.Message) string {
		return val.(*pps.JobInfo).Job.ID
	},
}
View Source
var JobsPipelineIndex = &col.Index{
	Name: "pipeline",
	Extract: func(val proto.Message) string {
		return JobsPipelineKey(val.(*pps.JobInfo).Job.Pipeline)
	},
}

JobsPipelineIndex maps pipeline to Jobs started by the pipeline

View Source
var JobsTerminalIndex = &col.Index{
	Name: "job_state",
	Extract: func(val proto.Message) string {
		jobInfo := val.(*pps.JobInfo)
		return JobsTerminalKey(jobInfo.Job.Pipeline, pps.IsTerminal(jobInfo.State))
	},
}
View Source
var PipelinesNameIndex = &col.Index{
	Name: "name",
	Extract: func(val proto.Message) string {
		return PipelinesNameKey(val.(*pps.PipelineInfo).Pipeline)
	},
}

PipelinesNameIndex records the name of pipelines

View Source
var PipelinesVersionIndex = &col.Index{
	Name: "version",
	Extract: func(val proto.Message) string {
		info := val.(*pps.PipelineInfo)
		return VersionKey(info.Pipeline, info.Version)
	},
}

PipelinesVersionIndex records the version numbers of pipelines

Functions

func CollectionsV0

func CollectionsV0() []col.PostgresCollection

CollectionsV0 returns a list of all the PPS API collections for postgres-initialization purposes. These collections are not usable for querying. DO NOT MODIFY THIS FUNCTION IT HAS BEEN USED IN A RELEASED MIGRATION

func JobKey

func JobKey(j *pps.Job) string

JobKey is a string representation of a Job suitable for use as an indexing key. It will include the project if the project name is not the empty string.

func Jobs

Jobs returns a PostgresCollection of Jobs

func JobsPipelineKey

func JobsPipelineKey(p *pps.Pipeline) string

func JobsTerminalKey

func JobsTerminalKey(pipeline *pps.Pipeline, isTerminal bool) string

func ParsePipelineKey

func ParsePipelineKey(key string) (projectName, pipelineName, id string, err error)

ParsePipelineKey expects keys to either be of the form <pipeline>@<id> or <project>/<pipeline>@<id>.

func Pipelines

func Pipelines(db *pachsql.DB, listener col.PostgresListener) col.PostgresCollection

Pipelines returns a PostgresCollection of pipelines

func PipelinesNameKey

func PipelinesNameKey(p *pps.Pipeline) string

PipelinesNameKey returns the key used by PipelinesNameIndex to index a PipelineInfo.

func VersionKey

func VersionKey(p *pps.Pipeline, version uint64) string

VersionKey return a unique key for the given project, pipeline & version. If the project is the empty string it will return an old-style key without a project; otherwise the key will include the project. The version is zero-padded in order to facilitate sorting.

Types

This section is empty.

Jump to

Keyboard shortcuts

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