core

package
v0.0.0-...-fe9cd46 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2020 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const Max = 2147483647

Max score for Score

Variables

This section is empty.

Functions

This section is empty.

Types

type ScheduleOperation

type ScheduleOperation struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

ScheduleOperation defines the scheduling opeation called

func NewScheduleOperation

func NewScheduleOperation(pgClient *pgclientset.Clientset, cache cache.Cache,
	frameworkHandler framework.FrameworkHandle, maxScheTime *time.Duration, pgInformer pginformer.PodGroupInformer) *ScheduleOperation

NewScheduleOperation create a new operation object

func (*ScheduleOperation) AddToDenyCache

func (sop *ScheduleOperation) AddToDenyCache(fullName string)

AddToDenyCache add podGroup to the back list cache

func (*ScheduleOperation) Compare

func (sop *ScheduleOperation) Compare(podInfo1, podInfo2 interface{}) bool

Compare returns the true or false, base on 1. priority 2. podGroup creation time 3. pod creation time

func (*ScheduleOperation) Filter

func (sop *ScheduleOperation) Filter(pod *corev1.Pod, nodeName string) error

Filter filter pod if not fit on the node

func (*ScheduleOperation) GetPodNameUIDs

func (sop *ScheduleOperation) GetPodNameUIDs(fullName string) *gochache.Cache

GetPodNameUIDs returns podName and uid pairs.

func (*ScheduleOperation) GetPodNodePairs

func (sop *ScheduleOperation) GetPodNodePairs(fullName string) *gochache.Cache

GetPodNodePairs returns the pod-node paired to be scheduled.

func (*ScheduleOperation) Permit

func (sop *ScheduleOperation) Permit(pod *corev1.Pod, nodeName string) (bool, string, error)

Permit permits a pod to run, if the minMember match, it would send a signal to chan.

func (*ScheduleOperation) PodGroupStatusCache

func (sop *ScheduleOperation) PodGroupStatusCache() cache.Cache

PodGroupStatusCache returns the podGroupStatusCache

func (*ScheduleOperation) PostBind

func (sop *ScheduleOperation) PostBind(pod *corev1.Pod, nodeName string)

PostBind is used for send metrics and update to api if all finish

func (*ScheduleOperation) PreFilter

func (sop *ScheduleOperation) PreFilter(pod *corev1.Pod) error

PreFilter pre-filter pod include: 1. cluster resource 2. last denied pod to increase schedule qps 3. last permitted pod to increase schedule qps

func (*ScheduleOperation) PreemptAddPod

func (sop *ScheduleOperation) PreemptAddPod(podToAdd *corev1.Pod, nodeName string) error

PreemptAddPod currently always return nil

func (*ScheduleOperation) PreemptRemovePod

func (sop *ScheduleOperation) PreemptRemovePod(podToSchedule, podToRemove *corev1.Pod) error

PreemptRemovePod requires: 1. online resource could preempt online offline 2. offline could preempt low process and not running offline 3. online preempt offline 4. offline preempt offline

func (*ScheduleOperation) Score

func (sop *ScheduleOperation) Score(pod *corev1.Pod, nodeName string) (int, error)

Score return the score, currently it is preserved.

Jump to

Keyboard shortcuts

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