framework

package
v0.0.0-...-fb4d9db Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanupPluginBuilders

func CleanupPluginBuilders()

func CloseSession

func CloseSession(ssn *Session)

func RegisterAction

func RegisterAction(act Action)

func RegisterPluginBuilder

func RegisterPluginBuilder(name string, pc PluginBuilder)

Types

type Action

type Action interface {
	// The unique name of Action.
	Name() string

	// Initialize initializes the allocator plugins.
	Initialize()

	// Execute allocates the cluster's resources into each queue.
	Execute(ssn *Session)

	// UnIntialize un-initializes the allocator plugins.
	UnInitialize()
}

Action is the interface of scheduler action.

func GetAction

func GetAction(name string) (Action, bool)

type Arguments

type Arguments map[string]string

func (Arguments) GetInt

func (a Arguments) GetInt(ptr *int, key string)

type Event

type Event struct {
	Task *api.TaskInfo
}

type EventHandler

type EventHandler struct {
	AllocateFunc   func(event *Event)
	DeallocateFunc func(event *Event)
}

type Plugin

type Plugin interface {
	// The unique name of Plugin.
	Name() string

	OnSessionOpen(ssn *Session)
	OnSessionClose(ssn *Session)
}

type PluginBuilder

type PluginBuilder func(Arguments) Plugin

func GetPluginBuilder

func GetPluginBuilder(name string) (PluginBuilder, bool)

type Session

type Session struct {
	UID types.UID

	Jobs    map[api.JobID]*api.JobInfo
	Nodes   map[string]*api.NodeInfo
	Queues  map[api.QueueID]*api.QueueInfo
	Backlog []*api.JobInfo
	Tiers   []conf.Tier
	// contains filtered or unexported fields
}

func OpenSession

func OpenSession(cache cache.Cache, tiers []conf.Tier) *Session

func (*Session) AddEventHandler

func (ssn *Session) AddEventHandler(eh *EventHandler)

func (*Session) AddJobOrderFn

func (ssn *Session) AddJobOrderFn(name string, cf api.CompareFn)

func (*Session) AddJobReadyFn

func (ssn *Session) AddJobReadyFn(name string, vf api.ValidateFn)

func (*Session) AddJobValidFn

func (ssn *Session) AddJobValidFn(name string, fn api.ValidateExFn)

func (*Session) AddNodeOrderFn

func (ssn *Session) AddNodeOrderFn(name string, pf api.NodeOrderFn)

func (*Session) AddOverusedFn

func (ssn *Session) AddOverusedFn(name string, fn api.ValidateFn)

func (*Session) AddPredicateFn

func (ssn *Session) AddPredicateFn(name string, pf api.PredicateFn)

func (*Session) AddPreemptableFn

func (ssn *Session) AddPreemptableFn(name string, cf api.EvictableFn)

func (*Session) AddQueueOrderFn

func (ssn *Session) AddQueueOrderFn(name string, qf api.CompareFn)

func (*Session) AddReclaimableFn

func (ssn *Session) AddReclaimableFn(name string, rf api.EvictableFn)

func (*Session) AddTaskOrderFn

func (ssn *Session) AddTaskOrderFn(name string, cf api.CompareFn)

func (*Session) Allocate

func (ssn *Session) Allocate(task *api.TaskInfo, hostname string) error

func (*Session) Evict

func (ssn *Session) Evict(reclaimee *api.TaskInfo, reason string) error

func (Session) GetPolicy

func (ssn Session) GetPolicy(schedulerConf string) string

func (*Session) JobOrderFn

func (ssn *Session) JobOrderFn(l, r interface{}) bool

func (*Session) JobReady

func (ssn *Session) JobReady(obj interface{}) bool

func (*Session) JobValid

func (ssn *Session) JobValid(obj interface{}) *api.ValidateResult

func (*Session) NodeOrderFn

func (ssn *Session) NodeOrderFn(task *api.TaskInfo, node *api.NodeInfo) (int, error)

func (*Session) Overused

func (ssn *Session) Overused(queue *api.QueueInfo) bool

func (*Session) Pipeline

func (ssn *Session) Pipeline(task *api.TaskInfo, hostname string) error

func (*Session) PredicateFn

func (ssn *Session) PredicateFn(task *api.TaskInfo, node *api.NodeInfo) error

func (*Session) Preemptable

func (ssn *Session) Preemptable(preemptor *api.TaskInfo, preemptees []*api.TaskInfo) []*api.TaskInfo

func (*Session) QueueOrderFn

func (ssn *Session) QueueOrderFn(l, r interface{}) bool

func (*Session) Reclaimable

func (ssn *Session) Reclaimable(reclaimer *api.TaskInfo, reclaimees []*api.TaskInfo) []*api.TaskInfo

func (*Session) Statement

func (ssn *Session) Statement() *Statement

func (Session) String

func (ssn Session) String() string

func (*Session) TaskCompareFns

func (ssn *Session) TaskCompareFns(l, r interface{}) int

func (*Session) TaskOrderFn

func (ssn *Session) TaskOrderFn(l, r interface{}) bool

func (*Session) UpdateJobCondition

func (ssn *Session) UpdateJobCondition(jobInfo *api.JobInfo, cond *v1alpha1.PodGroupCondition) error

UpdateJobStatus update job condition accordingly.

func (Session) UpdateScheduledTime

func (ssn Session) UpdateScheduledTime(task *api.TaskInfo)

type Statement

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

func (*Statement) Commit

func (s *Statement) Commit()

func (*Statement) Discard

func (s *Statement) Discard()

func (*Statement) Evict

func (s *Statement) Evict(reclaimee *api.TaskInfo, reason string) error

func (*Statement) Pipeline

func (s *Statement) Pipeline(task *api.TaskInfo, hostname string) error

Jump to

Keyboard shortcuts

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