repository

package
v0.3.56 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2023 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Unknown AggregateType = -1
	Max                   = 0
	Average               = 1
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AggregateType added in v0.3.50

type AggregateType int

type FromBuilder added in v0.3.53

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

func NewFromBuilder added in v0.3.53

func NewFromBuilder(baseTable, baseTableAbbrev string) *FromBuilder

func (*FromBuilder) Build added in v0.3.53

func (b *FromBuilder) Build() string

func (*FromBuilder) Join added in v0.3.53

func (b *FromBuilder) Join(joinType JoinType, table, abbrev, on string) *FromBuilder

type GetJobRunErrorRepository

type GetJobRunErrorRepository interface {
	GetJobRunError(ctx context.Context, runId string) (string, error)
}

type GetJobSpecRepository

type GetJobSpecRepository interface {
	GetJobSpec(ctx context.Context, jobId string) (*api.Job, error)
}

type GetJobsRepository

type GetJobsRepository interface {
	GetJobs(ctx context.Context, filters []*model.Filter, order *model.Order, skip int, take int) (*GetJobsResult, error)
}

type GetJobsResult

type GetJobsResult struct {
	Jobs  []*model.Job
	Count int
}

type GroupByResult

type GroupByResult struct {
	// Total number of groups
	Count  int
	Groups []*model.JobGroup
}

type GroupJobsRepository

type GroupJobsRepository interface {
	GroupBy(
		ctx context.Context,
		filters []*model.Filter,
		order *model.Order,
		groupedField string,
		aggregates []string,
		skip int,
		take int,
	) (*GroupByResult, error)
}

type JobOptions

type JobOptions struct {
	JobId            string
	Priority         int
	PriorityClass    string
	Cpu              resource.Quantity
	Memory           resource.Quantity
	EphemeralStorage resource.Quantity
	Gpu              resource.Quantity
	Annotations      map[string]string
}

type JobSimulator

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

func NewJobSimulator

func NewJobSimulator(converter *instructions.InstructionConverter, store *lookoutdb.LookoutDb) *JobSimulator

func (*JobSimulator) ApiJob

func (js *JobSimulator) ApiJob() *api.Job

func (*JobSimulator) Build

func (js *JobSimulator) Build() *JobSimulator

func (*JobSimulator) Cancelled

func (js *JobSimulator) Cancelled(timestamp time.Time) *JobSimulator

func (*JobSimulator) Failed

func (js *JobSimulator) Failed(node string, exitCode int32, message string, timestamp time.Time) *JobSimulator

func (*JobSimulator) Job

func (js *JobSimulator) Job() *model.Job

func (*JobSimulator) LeaseExpired

func (js *JobSimulator) LeaseExpired(timestamp time.Time) *JobSimulator

func (*JobSimulator) LeaseReturned

func (js *JobSimulator) LeaseReturned(runId string, message string, timestamp time.Time) *JobSimulator

func (*JobSimulator) Pending

func (js *JobSimulator) Pending(runId string, cluster string, timestamp time.Time) *JobSimulator

func (*JobSimulator) Reprioritized

func (js *JobSimulator) Reprioritized(newPriority uint32, timestamp time.Time) *JobSimulator

func (*JobSimulator) RunFailed

func (js *JobSimulator) RunFailed(runId string, node string, exitCode int32, message string, timestamp time.Time) *JobSimulator

func (*JobSimulator) RunSucceeded

func (js *JobSimulator) RunSucceeded(runId string, timestamp time.Time) *JobSimulator

func (*JobSimulator) RunTerminated

func (js *JobSimulator) RunTerminated(runId string, cluster string, node string, message string, timestamp time.Time) *JobSimulator

func (*JobSimulator) RunUnschedulable

func (js *JobSimulator) RunUnschedulable(runId string, cluster string, node string, message string, timestamp time.Time) *JobSimulator

func (*JobSimulator) Running

func (js *JobSimulator) Running(runId string, node string, timestamp time.Time) *JobSimulator

func (*JobSimulator) Submit

func (js *JobSimulator) Submit(queue, jobSet, owner string, timestamp time.Time, opts *JobOptions) *JobSimulator

func (*JobSimulator) Succeeded

func (js *JobSimulator) Succeeded(timestamp time.Time) *JobSimulator

type JoinType added in v0.3.53

type JoinType string
const (
	Left  JoinType = "LEFT"
	Inner JoinType = "INNER"
)

type LookoutTables

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

func NewTables

func NewTables() *LookoutTables

func (*LookoutTables) ColumnFromField

func (c *LookoutTables) ColumnFromField(field string) (string, error)

func (*LookoutTables) GroupAggregateForCol added in v0.3.50

func (c *LookoutTables) GroupAggregateForCol(col string) (AggregateType, error)

func (*LookoutTables) IsFilterable

func (c *LookoutTables) IsFilterable(col string) bool

func (*LookoutTables) IsGroupable

func (c *LookoutTables) IsGroupable(col string) bool

func (*LookoutTables) IsOrderable

func (c *LookoutTables) IsOrderable(col string) bool

func (*LookoutTables) SupportsMatch

func (c *LookoutTables) SupportsMatch(col, match string) bool

func (*LookoutTables) TableAbbrev

func (c *LookoutTables) TableAbbrev(table string) (string, error)

func (*LookoutTables) TablePrecedence

func (c *LookoutTables) TablePrecedence() []string

func (*LookoutTables) TablesForColumn

func (c *LookoutTables) TablesForColumn(col string) (map[string]bool, error)

type Query

type Query struct {
	Sql  string
	Args []interface{}
}

type QueryBuilder

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

QueryBuilder is a struct responsible for building a single Lookout SQL query

func NewQueryBuilder

func NewQueryBuilder(lookoutTables *LookoutTables) *QueryBuilder

func (*QueryBuilder) CountGroups

func (qb *QueryBuilder) CountGroups(filters []*model.Filter, groupedField string) (*Query, error)

CountGroups returns Query that counts the total number of groups created by grouping by groupedField and filtering with filters

func (*QueryBuilder) CreateTempTable

func (qb *QueryBuilder) CreateTempTable() (*Query, string)

CreateTempTable creates a temporary table of job ids Returns the Query and the name of the temporary table, to be used later in InsertIntoTempTable

func (*QueryBuilder) GroupBy

func (qb *QueryBuilder) GroupBy(
	filters []*model.Filter,
	order *model.Order,
	groupedField string,
	aggregates []string,
	skip int,
	take int,
) (*Query, error)

GroupBy returns Query that performs a group by on filters

func (*QueryBuilder) InsertIntoTempTable

func (qb *QueryBuilder) InsertIntoTempTable(tempTableName string, filters []*model.Filter, order *model.Order, skip, take int) (*Query, error)

InsertIntoTempTable returns Query that returns Job IDs according to filters, order, skip and take, and inserts them in the temp table with name tempTableName

func (*QueryBuilder) JobCount

func (qb *QueryBuilder) JobCount(filters []*model.Filter) (*Query, error)

JobCount Returns SQL Query that when executed will return the total number of jobs that match the list of filters

type SqlGetJobRunErrorRepository

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

func NewSqlGetJobRunErrorRepository

func NewSqlGetJobRunErrorRepository(db *pgxpool.Pool, decompressor compress.Decompressor) *SqlGetJobRunErrorRepository

func (*SqlGetJobRunErrorRepository) GetJobRunError

func (r *SqlGetJobRunErrorRepository) GetJobRunError(ctx context.Context, runId string) (string, error)

type SqlGetJobSpecRepository

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

func NewSqlGetJobSpecRepository

func NewSqlGetJobSpecRepository(db *pgxpool.Pool, decompressor compress.Decompressor) *SqlGetJobSpecRepository

func (*SqlGetJobSpecRepository) GetJobSpec

func (r *SqlGetJobSpecRepository) GetJobSpec(ctx context.Context, jobId string) (*api.Job, error)

type SqlGetJobsRepository

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

func NewSqlGetJobsRepository

func NewSqlGetJobsRepository(db *pgxpool.Pool) *SqlGetJobsRepository

func (*SqlGetJobsRepository) GetJobs

func (r *SqlGetJobsRepository) GetJobs(ctx context.Context, filters []*model.Filter, order *model.Order, skip int, take int) (*GetJobsResult, error)

type SqlGroupJobsRepository

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

func NewSqlGroupJobsRepository

func NewSqlGroupJobsRepository(db *pgxpool.Pool) *SqlGroupJobsRepository

func (*SqlGroupJobsRepository) GroupBy

func (r *SqlGroupJobsRepository) GroupBy(
	ctx context.Context,
	filters []*model.Filter,
	order *model.Order,
	groupedField string,
	aggregates []string,
	skip int,
	take int,
) (*GroupByResult, error)

Jump to

Keyboard shortcuts

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