scheduler

package
v0.0.0-...-e20f597 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2014 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package scheduler contains a generic Scheduler interface and several implementations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FakeMinionLister

type FakeMinionLister []string

FakeMinionLister implements MinionLister on a []string for test purposes.

func (FakeMinionLister) List

func (f FakeMinionLister) List() ([]string, error)

List returns minions as a []string

type FakePodLister

type FakePodLister []api.Pod

FakePodLister implements PodLister on an []api.Pods for test purposes.

func (FakePodLister) ListPods

func (f FakePodLister) ListPods(s labels.Selector) (selected []api.Pod, err error)

ListPods returns []api.Pod matching a query.

type MinionLister

type MinionLister interface {
	List() (machines []string, err error)
}

MinionLister interface represents anything that can list minions for a scheduler.

type PodLister

type PodLister interface {
	// TODO: make this exactly the same as client's ListPods() method...
	ListPods(labels.Selector) ([]api.Pod, error)
}

PodLister interface represents anything that can list pods for a scheduler

type RandomFitScheduler

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

RandomFitScheduler is a Scheduler which schedules a Pod on a random machine which matches its requirement.

func (*RandomFitScheduler) Schedule

func (s *RandomFitScheduler) Schedule(pod api.Pod, minionLister MinionLister) (string, error)

Schedule schedules a pod on a random machine which matches its requirement.

type RandomScheduler

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

RandomScheduler chooses machines uniformly at random.

func (*RandomScheduler) Schedule

func (s *RandomScheduler) Schedule(pod api.Pod, minionLister MinionLister) (string, error)

Schedule schedules a given pod to a random machine.

type RoundRobinScheduler

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

RoundRobinScheduler chooses machines in order.

func (*RoundRobinScheduler) Schedule

func (s *RoundRobinScheduler) Schedule(pod api.Pod, minionLister MinionLister) (string, error)

Schedule schedules a pod on the machine next to the last scheduled machine.

type Scheduler

type Scheduler interface {
	Schedule(api.Pod, MinionLister) (selectedMachine string, err error)
}

Scheduler is an interface implemented by things that know how to schedule pods onto machines.

func NewRandomFitScheduler

func NewRandomFitScheduler(podLister PodLister, random *rand.Rand) Scheduler

func NewRandomScheduler

func NewRandomScheduler(random *rand.Rand) Scheduler

func NewRoundRobinScheduler

func NewRoundRobinScheduler() Scheduler

Jump to

Keyboard shortcuts

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