Documentation
¶
Index ¶
- Variables
- func ParseNullBool(nullBool sql.NullBool) bool
- func ParseNullFloat(nullFloat sql.NullFloat64) float64
- func ParseNullInt(nullInt sql.NullInt64) int64
- func ParseNullString(nullString sql.NullString) string
- func ParseNullTime(nullTime pq.NullTime) *time.Time
- func ParseNullTimeDefault(nullTime pq.NullTime) time.Time
- type Clock
- type DefaultClock
- type JobRecorder
- type JobRepository
- type JobRow
- type JobState
- type SQLJobRepository
- func (r *SQLJobRepository) GetJobSetInfos(ctx context.Context, opts *lookout.GetJobSetsRequest) ([]*lookout.JobSetInfo, error)
- func (r *SQLJobRepository) GetJobs(ctx context.Context, opts *lookout.GetJobsRequest) ([]*lookout.JobInfo, error)
- func (r *SQLJobRepository) GetQueueInfos(ctx context.Context) ([]*lookout.QueueInfo, error)
- type SQLJobStore
- func (r *SQLJobStore) MarkCancelled(event *api.JobCancelledEvent) error
- func (r *SQLJobStore) RecordJob(job *api.Job) error
- func (r *SQLJobStore) RecordJobFailed(event *api.JobFailedEvent) error
- func (r *SQLJobStore) RecordJobPending(event *api.JobPendingEvent) error
- func (r *SQLJobStore) RecordJobPriorityChange(event *api.JobReprioritizedEvent) error
- func (r *SQLJobStore) RecordJobRunning(event *api.JobRunningEvent) error
- func (r *SQLJobStore) RecordJobSucceeded(event *api.JobSucceededEvent) error
- func (r *SQLJobStore) RecordJobUnableToSchedule(event *api.JobUnableToScheduleEvent) error
Constants ¶
This section is empty.
Variables ¶
View Source
var AllJobStates = []JobState{ JobQueued, JobPending, JobRunning, JobSucceeded, JobFailed, JobCancelled, }
View Source
var FiltersForState = map[JobState][]goqu.Expression{ JobQueued: { job_submitted.IsNotNull(), job_cancelled.IsNull(), jobRun_created.IsNull(), jobRun_started.IsNull(), jobRun_finished.IsNull(), jobRun_unableToSchedule.IsNull(), }, JobPending: { job_cancelled.IsNull(), jobRun_created.IsNotNull(), jobRun_started.IsNull(), jobRun_finished.IsNull(), jobRun_unableToSchedule.IsNull(), }, JobRunning: { job_cancelled.IsNull(), jobRun_started.IsNotNull(), jobRun_finished.IsNull(), jobRun_unableToSchedule.IsNull(), }, JobSucceeded: { job_cancelled.IsNull(), jobRun_finished.IsNotNull(), jobRun_succeeded.IsTrue(), jobRun_unableToSchedule.IsNull(), }, JobFailed: { jobRun_succeeded.IsFalse(), }, JobCancelled: { job_cancelled.IsNotNull(), }, }
Functions ¶
func ParseNullBool ¶ added in v0.1.17
func ParseNullFloat ¶ added in v0.1.17
func ParseNullFloat(nullFloat sql.NullFloat64) float64
func ParseNullInt ¶ added in v0.1.21
func ParseNullString ¶ added in v0.1.17
func ParseNullString(nullString sql.NullString) string
Types ¶
type DefaultClock ¶ added in v0.1.21
type DefaultClock struct{}
func (*DefaultClock) Now ¶ added in v0.1.21
func (c *DefaultClock) Now() time.Time
type JobRecorder ¶
type JobRecorder interface { RecordJob(job *api.Job) error MarkCancelled(*api.JobCancelledEvent) error RecordJobPriorityChange(event *api.JobReprioritizedEvent) error RecordJobPending(event *api.JobPendingEvent) error RecordJobRunning(event *api.JobRunningEvent) error RecordJobSucceeded(event *api.JobSucceededEvent) error RecordJobFailed(event *api.JobFailedEvent) error RecordJobUnableToSchedule(event *api.JobUnableToScheduleEvent) error }
type JobRepository ¶
type JobRow ¶ added in v0.1.21
type JobRow struct { JobId sql.NullString `db:"job_id"` Queue sql.NullString `db:"queue"` Owner sql.NullString `db:"owner"` JobSet sql.NullString `db:"jobset"` Priority sql.NullFloat64 `db:"priority"` Submitted pq.NullTime `db:"submitted"` Cancelled pq.NullTime `db:"cancelled"` JobJson sql.NullString `db:"job"` RunId sql.NullString `db:"run_id"` PodNumber sql.NullInt64 `db:"pod_number"` Cluster sql.NullString `db:"cluster"` Node sql.NullString `db:"node"` Created pq.NullTime `db:"created"` Started pq.NullTime `db:"started"` Finished pq.NullTime `db:"finished"` Succeeded sql.NullBool `db:"succeeded"` Error sql.NullString `db:"error"` }
type JobState ¶ added in v0.1.23
type JobState string
Emulates JobStates enum can't use protobuf enums because gogoproto + grpc-gateway is hard with K8s specific messages
type SQLJobRepository ¶
type SQLJobRepository struct {
// contains filtered or unexported fields
}
func NewSQLJobRepository ¶
func NewSQLJobRepository(db *goqu.Database, clock Clock) *SQLJobRepository
func (*SQLJobRepository) GetJobSetInfos ¶ added in v0.1.21
func (r *SQLJobRepository) GetJobSetInfos(ctx context.Context, opts *lookout.GetJobSetsRequest) ([]*lookout.JobSetInfo, error)
func (*SQLJobRepository) GetJobs ¶ added in v0.1.23
func (r *SQLJobRepository) GetJobs(ctx context.Context, opts *lookout.GetJobsRequest) ([]*lookout.JobInfo, error)
func (*SQLJobRepository) GetQueueInfos ¶ added in v0.1.21
type SQLJobStore ¶
type SQLJobStore struct {
// contains filtered or unexported fields
}
func NewSQLJobStore ¶
func NewSQLJobStore(db *goqu.Database) *SQLJobStore
func (*SQLJobStore) MarkCancelled ¶
func (r *SQLJobStore) MarkCancelled(event *api.JobCancelledEvent) error
func (*SQLJobStore) RecordJobFailed ¶
func (r *SQLJobStore) RecordJobFailed(event *api.JobFailedEvent) error
func (*SQLJobStore) RecordJobPending ¶
func (r *SQLJobStore) RecordJobPending(event *api.JobPendingEvent) error
func (*SQLJobStore) RecordJobPriorityChange ¶
func (r *SQLJobStore) RecordJobPriorityChange(event *api.JobReprioritizedEvent) error
func (*SQLJobStore) RecordJobRunning ¶
func (r *SQLJobStore) RecordJobRunning(event *api.JobRunningEvent) error
func (*SQLJobStore) RecordJobSucceeded ¶
func (r *SQLJobStore) RecordJobSucceeded(event *api.JobSucceededEvent) error
func (*SQLJobStore) RecordJobUnableToSchedule ¶ added in v0.1.23
func (r *SQLJobStore) RecordJobUnableToSchedule(event *api.JobUnableToScheduleEvent) error
Source Files
¶
Click to show internal directories.
Click to hide internal directories.