factory

package
v2.1.23+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2018 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultProvider   = "DefaultProvider"
	BaremetalProvider = "BaremetalProvider"
)

Variables

This section is empty.

Functions

func GetPredicates

func GetPredicates(predicatesKeys sets.String) (map[string]core.FitPredicate, error)

func GetPriorityConfigs

func GetPriorityConfigs(priorityKeys sets.String) ([]core.PriorityConfig, error)

func RegisterAlgorithmProvider

func RegisterAlgorithmProvider(name string, predicatesKeys, priorityKeys sets.String) string

RegisterAlgorithmProvider registers a new algorithm provider with the algorithm registry. This shoud be called from the init function in a provider plugin.

func RegisterFitPredicate

func RegisterFitPredicate(name string, predicate core.FitPredicate) string

RegisterFitPredicate registers a fit predicate with the algorithm registry. Returns the name with which the predicates was registerd.

func RegisterFitPredicateFactory

func RegisterFitPredicateFactory(name string, predicateFactory FitPredicateFactory) string

RegisterFitPredicateFactory registers a fit predicate factory with the algorithm registry. Returns the name with which the predicate was registered.

func RegisterPriority

func RegisterPriority(name string, priority core.Priority, weight int) string

RegisterPriority registers a priority with the algorithm registry.

Types

type AlgorithmProviderConfig

type AlgorithmProviderConfig struct {
	FitPredicateKeys sets.String
	PriorityKeys     sets.String
}

func GetAlgorithmProvider

func GetAlgorithmProvider(name string) (*AlgorithmProviderConfig, error)

type FitPredicateFactory

type FitPredicateFactory func() core.FitPredicate

type PriorityConfigFactory

type PriorityConfigFactory struct {
	MapReduceFunction PriorityFunctionFactory
	Weight            int
}

Jump to

Keyboard shortcuts

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