Documentation ¶
Index ¶
- Constants
- func CalculateAllocatedTaskNum(job *api.JobInfo) int
- func GenerateNodeMapAndSlice(nodes map[string]*api.NodeInfo) map[string]*schedulernodeinfo.NodeInfo
- func GetAllocatedResource(job *api.JobInfo) *api.Resource
- func GetInqueueResource(job *api.JobInfo, allocated *api.Resource) *api.Resource
- func HaveAffinity(pod *v1.Pod) bool
- func NormalizeScore(maxPriority int64, reverse bool, scores []api.ScoredNode)
- type CachedNodeInfo
- type NodeLister
- type PodAffinityLister
- type PodFilter
- type PodLister
- func (pl *PodLister) AffinityFilteredList(podFilter PodFilter, selector labels.Selector) ([]*v1.Pod, error)
- func (pl *PodLister) AffinityLister() *PodAffinityLister
- func (pl *PodLister) FilteredList(podFilter PodFilter, selector labels.Selector) ([]*v1.Pod, error)
- func (pl *PodLister) GetPod(task *api.TaskInfo) *v1.Pod
- func (pl *PodLister) List(selector labels.Selector) ([]*v1.Pod, error)
- func (pl *PodLister) UpdateTask(task *api.TaskInfo, nodeName string) *v1.Pod
- type PodsLister
Constants ¶
const ( // Permit indicates that plugin callback function permits job to be inqueue, pipelined, or other status Permit = 1 // Abstain indicates that plugin callback function abstains in voting job to be inqueue, pipelined, or other status Abstain = 0 // Reject indicates that plugin callback function rejects job to be inqueue, pipelined, or other status Reject = -1 )
Variables ¶
This section is empty.
Functions ¶
func CalculateAllocatedTaskNum ¶ added in v1.6.0
CalculateAllocatedTaskNum returns allocated resource num for given job
func GenerateNodeMapAndSlice ¶
GenerateNodeMapAndSlice returns the nodeMap and nodeSlice generated from ssn
func GetAllocatedResource ¶ added in v1.5.1
GetAllocatedResource returns allocated resource for given job
func GetInqueueResource ¶ added in v1.5.1
GetInqueueResource returns reserved resource for running job whose part of pods have not been allocated resource.
func HaveAffinity ¶
HaveAffinity checks pod have affinity or not
func NormalizeScore ¶ added in v1.4.0
func NormalizeScore(maxPriority int64, reverse bool, scores []api.ScoredNode)
NormalizeScore normalizes the score for each filteredNode
Types ¶
type CachedNodeInfo ¶
CachedNodeInfo is used in nodeorder and predicate plugin
func (*CachedNodeInfo) GetNodeInfo ¶
func (c *CachedNodeInfo) GetNodeInfo(name string) (*v1.Node, error)
GetNodeInfo is used to get info of a particular node
type NodeLister ¶
NodeLister is used in nodeorder plugin
type PodAffinityLister ¶
type PodAffinityLister struct {
// contains filtered or unexported fields
}
PodAffinityLister is used to list pod with affinity
func (*PodAffinityLister) FilteredList ¶
func (pal *PodAffinityLister) FilteredList(podFilter PodFilter, selector labels.Selector) ([]*v1.Pod, error)
FilteredList is used to list all the pods with affinity under filter condition
type PodFilter ¶ added in v1.3.0
PodFilter is a function to filter a pod. If pod passed return true else return false.
type PodLister ¶
type PodLister struct { Session *framework.Session CachedPods map[api.TaskID]*v1.Pod Tasks map[api.TaskID]*api.TaskInfo TaskWithAffinity map[api.TaskID]*api.TaskInfo }
PodLister is used in predicate and nodeorder plugin
func NewPodLister ¶
NewPodLister returns a PodLister generate from ssn
func NewPodListerFromNode ¶ added in v1.2.0
NewPodListerFromNode returns a PodLister generate from ssn
func (*PodLister) AffinityFilteredList ¶
func (pl *PodLister) AffinityFilteredList(podFilter PodFilter, selector labels.Selector) ([]*v1.Pod, error)
AffinityFilteredList is used to list all the pods with affinity under filter condition
func (*PodLister) AffinityLister ¶
func (pl *PodLister) AffinityLister() *PodAffinityLister
AffinityLister generate a PodAffinityLister following current PodLister
func (*PodLister) FilteredList ¶
FilteredList is used to list all the pods under filter condition
func (*PodLister) GetPod ¶
GetPod will get pod with proper nodeName, from cache or DeepCopy keeping this function read only to avoid concurrent panic of map
type PodsLister ¶ added in v1.3.0
type PodsLister interface { // Returns the list of pods. List(labels.Selector) ([]*v1.Pod, error) // This is similar to "List()", but the returned slice does not // contain pods that don't pass `podFilter`. FilteredList(podFilter PodFilter, selector labels.Selector) ([]*v1.Pod, error) }
PodsLister interface represents anything that can list pods for a scheduler.