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 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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