scheduler

package
v0.0.0-...-0e89551 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2015 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildFactory

type BuildFactory interface {
	Create(atc.JobConfig, atc.ResourceConfigs, []db.BuildInput) (atc.Plan, error)
}

type BuildScheduler

type BuildScheduler interface {
	TryNextPendingBuild(lager.Logger, atc.JobConfig, atc.ResourceConfigs) Waiter
	BuildLatestInputs(lager.Logger, atc.JobConfig, atc.ResourceConfigs) error
}

type BuildsDB

type BuildsDB interface {
	GetAllStartedBuilds() ([]db.Build, error)
	ErrorBuild(buildID int, err error) error
}

type Locker

type Locker interface {
	AcquireWriteLock([]db.NamedLock) (db.Lock, error)
	AcquireWriteLockImmediately([]db.NamedLock) (db.Lock, error)

	AcquireReadLock([]db.NamedLock) (db.Lock, error)
}

type PipelineDB

type PipelineDB interface {
	CreateJobBuild(job string) (db.Build, error)
	CreateJobBuildForCandidateInputs(job string) (db.Build, bool, error)
	ScheduleBuild(buildID int, jobConfig atc.JobConfig) (bool, error)

	GetJobBuildForInputs(job string, inputs []db.BuildInput) (db.Build, error)
	GetNextPendingBuild(job string) (db.Build, error)

	GetLatestInputVersions([]atc.JobInput) ([]db.BuildInput, error)
	SaveResourceVersions(atc.ResourceConfig, []atc.Version) error
	UseInputsForBuild(buildID int, inputs []db.BuildInput) error
}

type Runner

type Runner struct {
	Logger lager.Logger

	Locker Locker
	DB     db.PipelineDB

	Scheduler BuildScheduler

	Noop bool

	Interval time.Duration
}

func (*Runner) Run

func (runner *Runner) Run(signals <-chan os.Signal, ready chan<- struct{}) error

type Scanner

type Scanner interface {
	Scan(lager.Logger, string) error
}

type Scheduler

type Scheduler struct {
	PipelineDB PipelineDB
	BuildsDB   BuildsDB
	Factory    BuildFactory
	Engine     engine.Engine
	Scanner    Scanner
}

func (*Scheduler) BuildLatestInputs

func (s *Scheduler) BuildLatestInputs(logger lager.Logger, job atc.JobConfig, resources atc.ResourceConfigs) error

func (*Scheduler) TriggerImmediately

func (s *Scheduler) TriggerImmediately(logger lager.Logger, job atc.JobConfig, resources atc.ResourceConfigs) (db.Build, error)

func (*Scheduler) TryNextPendingBuild

func (s *Scheduler) TryNextPendingBuild(logger lager.Logger, job atc.JobConfig, resources atc.ResourceConfigs) Waiter

type Waiter

type Waiter interface {
	Wait()
}

Directories

Path Synopsis
This file was generated by counterfeiter
This file was generated by counterfeiter

Jump to

Keyboard shortcuts

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