auctionrunner

package
v0.0.0-...-07292ff Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2016 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FetchStateAndBuildZones

func FetchStateAndBuildZones(logger lager.Logger, workPool *workpool.WorkPool, clients map[string]rep.Client, metricEmitter auctiontypes.AuctionMetricEmitterDelegate) map[string]Zone

func New

func New(
	delegate auctiontypes.AuctionRunnerDelegate,
	metricEmitter auctiontypes.AuctionMetricEmitterDelegate,
	clock clock.Clock,
	workPool *workpool.WorkPool,
	logger lager.Logger,
) *auctionRunner

Types

type Batch

type Batch struct {
	HasWork chan struct{}
	// contains filtered or unexported fields
}

func NewBatch

func NewBatch(clock clock.Clock) *Batch

func (*Batch) AddLRPStarts

func (b *Batch) AddLRPStarts(starts []auctioneer.LRPStartRequest)

func (*Batch) AddTasks

func (b *Batch) AddTasks(tasks []auctioneer.TaskStartRequest)

func (*Batch) DedupeAndDrain

func (b *Batch) DedupeAndDrain() ([]auctiontypes.LRPAuction, []auctiontypes.TaskAuction)

type Cell

type Cell struct {
	Guid string
	// contains filtered or unexported fields
}

func NewCell

func NewCell(logger lager.Logger, guid string, client rep.Client, state rep.CellState) *Cell

func (*Cell) Commit

func (c *Cell) Commit() rep.Work

func (*Cell) MatchRootFS

func (c *Cell) MatchRootFS(rootFS string) bool

func (*Cell) ReserveLRP

func (c *Cell) ReserveLRP(lrp *rep.LRP) error

func (*Cell) ReserveTask

func (c *Cell) ReserveTask(task *rep.Task) error

func (*Cell) ScoreForLRP

func (c *Cell) ScoreForLRP(lrp *rep.LRP) (float64, error)

func (*Cell) ScoreForTask

func (c *Cell) ScoreForTask(task *rep.Task) (float64, error)

type Scheduler

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

func NewScheduler

func NewScheduler(
	workPool *workpool.WorkPool,
	zones map[string]Zone,
	clock clock.Clock,
	logger lager.Logger,
) *Scheduler

func (*Scheduler) Schedule

func (s *Scheduler) Schedule(auctionRequest auctiontypes.AuctionRequest) auctiontypes.AuctionResults

Schedule takes in a set of job requests (LRP start auctions and task starts) and assigns the work to available cells according to the diego scoring algorithm. The scheduler is single-threaded. It determines scheduling of jobs one at a time so that each calculation reflects available resources correctly. It commits the work in batches at the end, for better network performance. Schedule returns AuctionResults, indicating the success or failure of each requested job.

type SortableLRPAuctions

type SortableLRPAuctions []auctiontypes.LRPAuction

func (SortableLRPAuctions) Len

func (a SortableLRPAuctions) Len() int

func (SortableLRPAuctions) Less

func (a SortableLRPAuctions) Less(i, j int) bool

func (SortableLRPAuctions) Swap

func (a SortableLRPAuctions) Swap(i, j int)

type SortableTaskAuctions

type SortableTaskAuctions []auctiontypes.TaskAuction

func (SortableTaskAuctions) Len

func (a SortableTaskAuctions) Len() int

func (SortableTaskAuctions) Less

func (a SortableTaskAuctions) Less(i, j int) bool

func (SortableTaskAuctions) Swap

func (a SortableTaskAuctions) Swap(i, j int)

type Zone

type Zone []*Cell

func (*Zone) FilterCells

func (z *Zone) FilterCells(rootFS string) []*Cell

Jump to

Keyboard shortcuts

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