eventhandlers

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddReservationErrorHandler added in v0.7.0

func AddReservationErrorHandler(sched *scheduler.Scheduler, internalHandler SchedulerInternalHandler, extendedHandle frameworkext.ExtendedHandle)

func AddScheduleEventHandler

func AddScheduleEventHandler(sched *scheduler.Scheduler, internalHandler SchedulerInternalHandler, extendedHandle frameworkext.ExtendedHandle)

AddScheduleEventHandler adds reservation event handlers for the scheduler just like pods'. One special case is that reservations have expiration, which the scheduler should cleanup expired ones from the cache and queue.

Types

type SchedulerInternalCacheHandler

type SchedulerInternalCacheHandler interface {
	AddPod(pod *corev1.Pod) error
	UpdatePod(oldPod, newPod *corev1.Pod) error
	RemovePod(pod *corev1.Pod) error
	IsAssumedPod(pod *corev1.Pod) (bool, error)
	GetPod(pod *corev1.Pod) (*corev1.Pod, error)
}

type SchedulerInternalHandler

type SchedulerInternalHandler interface {
	GetCache() SchedulerInternalCacheHandler
	GetQueue() SchedulerInternalQueueHandler
	MoveAllToActiveOrBackoffQueue(event framework.ClusterEvent)
}

SchedulerInternalHandler exports scheduler internal cache and queue interface for testability.

type SchedulerInternalHandlerImpl

type SchedulerInternalHandlerImpl struct {
	Scheduler *scheduler.Scheduler
}

func (*SchedulerInternalHandlerImpl) GetCache

func (*SchedulerInternalHandlerImpl) GetQueue

func (*SchedulerInternalHandlerImpl) MoveAllToActiveOrBackoffQueue

func (s *SchedulerInternalHandlerImpl) MoveAllToActiveOrBackoffQueue(event framework.ClusterEvent)

type SchedulerInternalQueueHandler

type SchedulerInternalQueueHandler interface {
	Add(pod *corev1.Pod) error
	Update(oldPod, newPod *corev1.Pod) error
	Delete(pod *corev1.Pod) error
	AddUnschedulableIfNotPresent(pod *framework.QueuedPodInfo, podSchedulingCycle int64) error
	SchedulingCycle() int64
	AssignedPodAdded(pod *corev1.Pod)
	AssignedPodUpdated(pod *corev1.Pod)
}

Jump to

Keyboard shortcuts

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