cache

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: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Binder

type Binder interface {
	Bind(task *v1.Pod, hostname string) error
}

type Cache

type Cache interface {
	// Run start informer
	Run(stopCh <-chan struct{})

	// Snapshot deep copy overall cache information into snapshot
	Snapshot() *api.ClusterInfo

	// WaitForCacheSync waits for all cache synced
	WaitForCacheSync(stopCh <-chan struct{}) bool

	// Bind binds Task to the target host.
	// TODO(jinzhej): clean up expire Tasks.
	Bind(task *api.TaskInfo, hostname string) error

	// Evict evicts the task to release resources.
	Evict(task *api.TaskInfo, reason string) error

	// RecordJobStatusEvent records related events according to job status.
	// Deprecated: remove it after removed PDB support.
	RecordJobStatusEvent(job *api.JobInfo)

	// UpdateJobStatus puts job in backlog for a while.
	UpdateJobStatus(job *api.JobInfo) (*api.JobInfo, error)

	// AllocateVolumes allocates volume on the host to the task
	AllocateVolumes(task *api.TaskInfo, hostname string) error

	// BindVolumes binds volumes to the task
	BindVolumes(task *api.TaskInfo) error
	LoadSchedulerConf(path string) (map[string]string, error)
	UpdateScheduledTime(task *api.TaskInfo) error
}

Cache collects pods/nodes/queues information and provides information snapshot

func New

func New(config *rest.Config, schedulerName string, defaultQueue string) Cache

New returns a Cache implementation.

type Evictor

type Evictor interface {
	Evict(pod *v1.Pod) error
}

type SchedulerCache

type SchedulerCache struct {
	sync.Mutex

	Binder        Binder
	Evictor       Evictor
	StatusUpdater StatusUpdater
	VolumeBinder  VolumeBinder

	Recorder record.EventRecorder

	Jobs            map[kbapi.JobID]*kbapi.JobInfo
	Nodes           map[string]*kbapi.NodeInfo
	Queues          map[kbapi.QueueID]*kbapi.QueueInfo
	PriorityClasses map[string]*v1beta1.PriorityClass
	// contains filtered or unexported fields
}

func (*SchedulerCache) AddNode

func (sc *SchedulerCache) AddNode(obj interface{})

func (*SchedulerCache) AddPDB

func (sc *SchedulerCache) AddPDB(obj interface{})

func (*SchedulerCache) AddPod

func (sc *SchedulerCache) AddPod(obj interface{})

func (*SchedulerCache) AddPodGroup

func (sc *SchedulerCache) AddPodGroup(obj interface{})

func (*SchedulerCache) AddPriorityClass

func (sc *SchedulerCache) AddPriorityClass(obj interface{})

func (*SchedulerCache) AddQueue

func (sc *SchedulerCache) AddQueue(obj interface{})

func (*SchedulerCache) AllocateVolumes

func (sc *SchedulerCache) AllocateVolumes(task *api.TaskInfo, hostname string) error

AllocateVolume allocates volume on the host to the task

func (*SchedulerCache) Bind

func (sc *SchedulerCache) Bind(taskInfo *kbapi.TaskInfo, hostname string) error

Bind binds task to the target host.

func (*SchedulerCache) BindVolumes

func (sc *SchedulerCache) BindVolumes(task *api.TaskInfo) error

BindVolume binds volumes to the task

func (*SchedulerCache) DeleteNode

func (sc *SchedulerCache) DeleteNode(obj interface{})

func (*SchedulerCache) DeletePDB

func (sc *SchedulerCache) DeletePDB(obj interface{})

func (*SchedulerCache) DeletePod

func (sc *SchedulerCache) DeletePod(obj interface{})

func (*SchedulerCache) DeletePodGroup

func (sc *SchedulerCache) DeletePodGroup(obj interface{})

func (*SchedulerCache) DeletePriorityClass

func (sc *SchedulerCache) DeletePriorityClass(obj interface{})

func (*SchedulerCache) DeleteQueue

func (sc *SchedulerCache) DeleteQueue(obj interface{})

func (*SchedulerCache) Evict

func (sc *SchedulerCache) Evict(taskInfo *kbapi.TaskInfo, reason string) error

func (*SchedulerCache) LoadSchedulerConf

func (sc *SchedulerCache) LoadSchedulerConf(path string) (map[string]string, error)

func (*SchedulerCache) RecordJobStatusEvent

func (sc *SchedulerCache) RecordJobStatusEvent(job *kbapi.JobInfo)

RecordJobStatusEvent records related events according to job status.

func (*SchedulerCache) Run

func (sc *SchedulerCache) Run(stopCh <-chan struct{})

func (*SchedulerCache) Snapshot

func (sc *SchedulerCache) Snapshot() *kbapi.ClusterInfo

func (*SchedulerCache) String

func (sc *SchedulerCache) String() string

func (*SchedulerCache) UpdateJobStatus

func (sc *SchedulerCache) UpdateJobStatus(job *kbapi.JobInfo) (*kbapi.JobInfo, error)

UpdateJobStatus update the status of job and its tasks.

func (*SchedulerCache) UpdateNode

func (sc *SchedulerCache) UpdateNode(oldObj, newObj interface{})

func (*SchedulerCache) UpdatePDB

func (sc *SchedulerCache) UpdatePDB(oldObj, newObj interface{})

func (*SchedulerCache) UpdatePod

func (sc *SchedulerCache) UpdatePod(oldObj, newObj interface{})

func (*SchedulerCache) UpdatePodGroup

func (sc *SchedulerCache) UpdatePodGroup(oldObj, newObj interface{})

func (*SchedulerCache) UpdatePriorityClass

func (sc *SchedulerCache) UpdatePriorityClass(oldObj, newObj interface{})

func (*SchedulerCache) UpdateQueue

func (sc *SchedulerCache) UpdateQueue(oldObj, newObj interface{})

func (*SchedulerCache) UpdateScheduledTime

func (sc *SchedulerCache) UpdateScheduledTime(task *arbapi.TaskInfo) error

func (*SchedulerCache) WaitForCacheSync

func (sc *SchedulerCache) WaitForCacheSync(stopCh <-chan struct{}) bool

type StatusUpdater

type StatusUpdater interface {
	UpdatePodCondition(pod *v1.Pod, podCondition *v1.PodCondition) (*v1.Pod, error)
	UpdatePodGroup(pg *v1alpha1.PodGroup) (*v1alpha1.PodGroup, error)
}

StatusUpdater updates pod with given PodCondition

type VolumeBinder

type VolumeBinder interface {
	AllocateVolumes(task *api.TaskInfo, hostname string) error
	BindVolumes(task *api.TaskInfo) error
}

Jump to

Keyboard shortcuts

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