queuejobresources

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilterPods

func FilterPods(pods []*v1.Pod, phase v1.PodPhase) int

filterPods returns pods based on their phase.

func GetPodResources

func GetPodResources(template *v1.PodTemplateSpec) *schedulerapi.Resource

Types

type Factory

type Factory func(config *rest.Config) Interface

Factory is a function that returns an Interface for queue job resources.

type Interface

type Interface interface {
	SyncQueueJob(queuejob *qjobv1.XQueueJob, qjobRes *qjobv1.XQueueJobResource) error
	UpdateQueueJobStatus(queuejob *qjobv1.XQueueJob) error
	GetAggregatedResources(queuejob *qjobv1.XQueueJob) *schedulerapi.Resource
	GetAggregatedResourcesByPriority(priority int, queuejob *qjobv1.XQueueJob) *schedulerapi.Resource
	Cleanup(queuejob *qjobv1.XQueueJob, qjobRes *qjobv1.XQueueJobResource) error
	Run(stopCh <-chan struct{})
}

Interface is an abstract interface for queue job resource management.

type RefByLabel

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

RefByLabel : A reference manager by resource vector index

func (*RefByLabel) AddReference

func (rm *RefByLabel) AddReference(owner *qjobv1.XQueueJobResource, ownee runtime.Object) error

AddReference : add ref

func (*RefByLabel) AddTag

func (rm *RefByLabel) AddTag(owner *qjobv1.XQueueJobResource, getTag func() string) error

AddTag : add tag

func (*RefByLabel) BelongTo

func (rm *RefByLabel) BelongTo(owner *qjobv1.XQueueJobResource, ownee runtime.Object) bool

BelongTo : belong to QJ

type RefManager

type RefManager interface {

	//Tag the owner
	AddTag(owner *qjobv1.XQueueJobResource, getTag func() string) error

	//check whether ownee is a member of owner
	BelongTo(owner *qjobv1.XQueueJobResource, ownee runtime.Object) bool

	//mark the ownee to be a member of owner
	AddReference(owner *qjobv1.XQueueJobResource, ownee runtime.Object) error
}

RefManager : Define reference manager commont interface

func NewLabelRefManager

func NewLabelRefManager() RefManager

NewLabelRefManager : new ref manager

type RegisteredResources

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

RegisteredResources : registered resources

func (*RegisteredResources) InitQueueJobResource

func (rres *RegisteredResources) InitQueueJobResource(t qjobv1.ResourceType,
	config *rest.Config) (Interface, bool, error)

InitQueueJobResource creates an instance of the type queue job resource. It returns `false` if the type is not known.

func (*RegisteredResources) Register

func (rres *RegisteredResources) Register(t qjobv1.ResourceType, factory Factory)

Register registers a Factory by type. This is expected to happen during app startup.

func (*RegisteredResources) Registered

func (rres *RegisteredResources) Registered() []qjobv1.ResourceType

Registered enumerates the names of all registered plugins.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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