scheduler

package
v0.0.0-...-de86ced Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2017 License: Apache-2.0 Imports: 12 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, atc.VersionedResourceTypes, []dbng.BuildInput) (atc.Plan, error)
}

type BuildScheduler

type BuildScheduler interface {
	Schedule(
		logger lager.Logger,
		versions *algorithm.VersionsDB,
		jobs []dbng.Job,
		resources dbng.Resources,
		resourceTypes atc.VersionedResourceTypes,
	) (map[string]time.Duration, error)

	TriggerImmediately(
		logger lager.Logger,
		job dbng.Job,
		resources dbng.Resources,
		resourceTypes atc.VersionedResourceTypes,
	) (dbng.Build, Waiter, error)

	SaveNextInputMapping(logger lager.Logger, job dbng.Job) error
}

type BuildStarter

type BuildStarter interface {
	TryStartPendingBuildsForJob(
		logger lager.Logger,
		job dbng.Job,
		resources dbng.Resources,
		resourceTypes atc.VersionedResourceTypes,
		nextPendingBuilds []dbng.Build,
	) error
}

func NewBuildStarter

func NewBuildStarter(
	pipeline dbng.Pipeline,
	maxInFlightUpdater maxinflight.Updater,
	factory BuildFactory,
	scanner Scanner,
	inputMapper inputmapper.InputMapper,
	execEngine engine.Engine,
) BuildStarter

type Runner

type Runner struct {
	Logger lager.Logger

	Pipeline dbng.Pipeline

	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 {
	Pipeline     dbng.Pipeline
	InputMapper  inputmapper.InputMapper
	BuildStarter BuildStarter
	Scanner      Scanner
}

func (*Scheduler) SaveNextInputMapping

func (s *Scheduler) SaveNextInputMapping(logger lager.Logger, job dbng.Job) error

func (*Scheduler) Schedule

func (s *Scheduler) Schedule(
	logger lager.Logger,
	versions *algorithm.VersionsDB,
	jobs []dbng.Job,
	resources dbng.Resources,
	resourceTypes atc.VersionedResourceTypes,
) (map[string]time.Duration, error)

func (*Scheduler) TriggerImmediately

func (s *Scheduler) TriggerImmediately(
	logger lager.Logger,
	job dbng.Job,
	resources dbng.Resources,
	resourceTypes atc.VersionedResourceTypes,
) (dbng.Build, Waiter, error)

type Waiter

type Waiter interface {
	Wait()
}

Directories

Path Synopsis
factoryfakes
Code generated by counterfeiter.
Code generated by counterfeiter.
inputconfig/inputconfigfakes
Code generated by counterfeiter.
Code generated by counterfeiter.
inputmapperfakes
Code generated by counterfeiter.
Code generated by counterfeiter.
maxinflightfakes
Code generated by counterfeiter.
Code generated by counterfeiter.
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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