factory

package
v0.7.4 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2015 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package factory can set up a scheduler. This code is here instead of plugin/cmd/scheduler for both testability and reuse.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigFactory

type ConfigFactory struct {
	Client *client.Client
	// queue for pods that need scheduling
	PodQueue *cache.FIFO
	// a means to list all scheduled pods
	PodLister *storeToPodLister
	// a means to list all minions
	MinionLister *storeToNodeLister
	// map of strings to predicate functions to be used
	// to filter the minions for scheduling pods
	PredicateMap map[string]algorithm.FitPredicate
	// map of strings to priority config to be used
	// to prioritize the filtered minions for scheduling pods
	PriorityMap map[string]algorithm.PriorityConfig
}

ConfigFactory knows how to fill out a scheduler config with its support functions.

func NewConfigFactory added in v0.7.0

func NewConfigFactory(client *client.Client) *ConfigFactory

NewConfigFactory initializes the factory.

func (*ConfigFactory) AddPredicate added in v0.7.0

func (factory *ConfigFactory) AddPredicate(key string, function algorithm.FitPredicate)

func (*ConfigFactory) AddPriority added in v0.7.0

func (factory *ConfigFactory) AddPriority(key string, function algorithm.PriorityFunction, weight int)

func (*ConfigFactory) Create

func (factory *ConfigFactory) Create(predicateKeys, priorityKeys []string) (*scheduler.Config, error)

Create creates a scheduler and all support functions.

func (*ConfigFactory) SetWeight added in v0.7.0

func (factory *ConfigFactory) SetWeight(key string, weight int)

Jump to

Keyboard shortcuts

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