repository

package
v0.15.9 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	Unknown     AggregateType = -1
	Max                       = 0
	Average                   = 1
	StateCounts               = 2
	Min                       = 3
)

Variables

This section is empty.

Functions

func GetStatesForFilter added in v0.3.77

func GetStatesForFilter(filters []*model.Filter) []string

GetStatesForFilter returns a list of states as string if filter for state exists Will always return the states in the same order, irrespective of the ordering of the states in the filter

Types

type AggregateType added in v0.3.50

type AggregateType int

type BasicParser added in v0.3.77

type BasicParser[T any] struct {
	// contains filtered or unexported fields
}

func (*BasicParser[T]) GetField added in v0.3.77

func (fp *BasicParser[T]) GetField() string

func (*BasicParser[T]) GetVariableRef added in v0.3.77

func (fp *BasicParser[T]) GetVariableRef() interface{}

func (*BasicParser[T]) ParseValue added in v0.3.77

func (fp *BasicParser[T]) ParseValue() (interface{}, error)

type FieldParser added in v0.3.77

type FieldParser interface {
	GetField() string
	GetVariableRef() interface{}
	ParseValue() (interface{}, error)
}

func ParserForGroup added in v0.3.77

func ParserForGroup(field string) FieldParser

func ParsersForAggregate added in v0.3.77

func ParsersForAggregate(field string, filters []*model.Filter) ([]FieldParser, error)

type GetJobErrorRepository added in v0.8.3

type GetJobErrorRepository interface {
	GetJobErrorMessage(ctx *armadacontext.Context, jobId string) (string, error)
}

type GetJobRunDebugMessageRepository added in v0.5.0

type GetJobRunDebugMessageRepository interface {
	GetJobRunDebugMessage(ctx *armadacontext.Context, runId string) (string, error)
}

type GetJobRunErrorRepository

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

type GetJobSpecRepository

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

type GetJobsRepository

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

type GetJobsResult

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

type GroupByResult

type GroupByResult struct {
	Groups []*model.JobGroup
}

type GroupJobsRepository

type GroupJobsRepository interface {
	GroupBy(
		ctx *armadacontext.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 NewJobSimulatorWithClock added in v0.4.49

func NewJobSimulatorWithClock(converter *instructions.InstructionConverter, store *lookoutdb.LookoutDb, clk clock.Clock) *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) Lease added in v0.3.77

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

func (*JobSimulator) LeaseExpired

func (js *JobSimulator) LeaseExpired(runId string, timestamp time.Time, _ clock.Clock) *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) Preempted added in v0.3.77

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

func (*JobSimulator) Rejected added in v0.8.3

func (js *JobSimulator) Rejected(message 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, debug string, timestamp time.Time) *JobSimulator

func (*JobSimulator) RunSucceeded

func (js *JobSimulator) RunSucceeded(runId 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, namespace string, timestamp time.Time, opts *JobOptions) *JobSimulator

func (*JobSimulator) Succeeded

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

type LastTransitionTimeParser added in v0.3.77

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

func (*LastTransitionTimeParser) GetField added in v0.3.77

func (fp *LastTransitionTimeParser) GetField() string

func (*LastTransitionTimeParser) GetVariableRef added in v0.3.77

func (fp *LastTransitionTimeParser) GetVariableRef() interface{}

func (*LastTransitionTimeParser) ParseValue added in v0.3.77

func (fp *LastTransitionTimeParser) ParseValue() (interface{}, error)

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)

type Query

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

type QueryAggregator added in v0.3.77

type QueryAggregator interface {
	AggregateSql() (string, error)
}

func GetAggregatorsForColumn added in v0.3.77

func GetAggregatorsForColumn(queryCol *queryColumn, aggregateType AggregateType, filters []*model.Filter) ([]QueryAggregator, error)

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) GetJobs added in v0.4.50

func (qb *QueryBuilder) GetJobs(
	filters []*model.Filter,
	activeJobSets bool,
	order *model.Order,
	skip int,
	take int,
) (*Query, error)

func (*QueryBuilder) GroupBy

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

type SqlFunctionAggregator added in v0.3.77

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

func NewSqlFunctionAggregator added in v0.3.77

func NewSqlFunctionAggregator(queryCol *queryColumn, fn string) *SqlFunctionAggregator

func (*SqlFunctionAggregator) AggregateSql added in v0.3.77

func (qa *SqlFunctionAggregator) AggregateSql() (string, error)

type SqlGetJobErrorMessageRepository added in v0.8.3

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

func NewSqlGetJobErrorRepository added in v0.8.3

func NewSqlGetJobErrorRepository(db *pgxpool.Pool, decompressor compress.Decompressor) *SqlGetJobErrorMessageRepository

func (*SqlGetJobErrorMessageRepository) GetJobErrorMessage added in v0.8.3

func (r *SqlGetJobErrorMessageRepository) GetJobErrorMessage(ctx *armadacontext.Context, jobId string) (string, error)

type SqlGetJobRunDebugMessageRepository added in v0.5.0

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

func NewSqlGetJobRunDebugMessageRepository added in v0.5.0

func NewSqlGetJobRunDebugMessageRepository(db *pgxpool.Pool, decompressor compress.Decompressor) *SqlGetJobRunDebugMessageRepository

func (*SqlGetJobRunDebugMessageRepository) GetJobRunDebugMessage added in v0.5.0

func (r *SqlGetJobRunDebugMessageRepository) GetJobRunDebugMessage(ctx *armadacontext.Context, runId string) (string, error)

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 *armadacontext.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 *armadacontext.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 *armadacontext.Context, filters []*model.Filter, activeJobSets bool, 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 *armadacontext.Context,
	filters []*model.Filter,
	activeJobSets bool,
	order *model.Order,
	groupedField *model.GroupedField,
	aggregates []string,
	skip int,
	take int,
) (*GroupByResult, error)

type StateCountAggregator added in v0.3.77

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

func NewStateCountAggregator added in v0.3.77

func NewStateCountAggregator(queryCol *queryColumn, stateString string) *StateCountAggregator

func (*StateCountAggregator) AggregateSql added in v0.3.77

func (qa *StateCountAggregator) AggregateSql() (string, error)

type StateParser added in v0.3.77

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

func (*StateParser) GetField added in v0.3.77

func (fp *StateParser) GetField() string

func (*StateParser) GetVariableRef added in v0.3.77

func (fp *StateParser) GetVariableRef() interface{}

func (*StateParser) ParseValue added in v0.3.77

func (fp *StateParser) ParseValue() (interface{}, error)

type TimeParser added in v0.3.77

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

func (*TimeParser) GetField added in v0.3.77

func (fp *TimeParser) GetField() string

func (*TimeParser) GetVariableRef added in v0.3.77

func (fp *TimeParser) GetVariableRef() interface{}

func (*TimeParser) ParseValue added in v0.3.77

func (fp *TimeParser) ParseValue() (interface{}, error)

Jump to

Keyboard shortcuts

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