Documentation ¶
Index ¶
- Constants
- func AllocatedStatus(status TaskStatus) bool
- type Job
- func (job *Job) AddTask(task *Task)
- func (job *Job) DeleteTask(task *Task)
- func (job *Job) Ready() bool
- func (job *Job) ReadyTaskNum() int32
- func (job *Job) SetPodGroup(pg *schedulingv1alpha1.PodGroup)
- func (job Job) String() string
- func (job *Job) UnsetPodGroup()
- func (job *Job) UpdateTaskStatus(task *Task, status TaskStatus)
- func (job *Job) ValidTaskNum() int32
- type JobID
- type Task
- type TaskID
- type TaskStatus
Constants ¶
View Source
const SchedulerName = "coscheduling"
Variables ¶
This section is empty.
Functions ¶
func AllocatedStatus ¶
func AllocatedStatus(status TaskStatus) bool
AllocatedStatus checks whether the tasks has AllocatedStatus
Types ¶
type Job ¶
type Job struct { UID JobID Name string Namespace string TaskStatusIndex map[TaskStatus]taskMap Tasks taskMap MinAvailable int32 CreationTimestamp metav1.Time PodGroup *schedulingv1alpha1.PodGroup }
func (*Job) DeleteTask ¶
func (*Job) ReadyTaskNum ¶
ReadyTaskNum returns the number of tasks that are ready.
func (*Job) SetPodGroup ¶
func (job *Job) SetPodGroup(pg *schedulingv1alpha1.PodGroup)
SetPodGroup sets podGroup details to a job
func (*Job) UnsetPodGroup ¶
func (job *Job) UnsetPodGroup()
UnsetPodGroup removes podGroup details from a job
func (*Job) UpdateTaskStatus ¶
func (job *Job) UpdateTaskStatus(task *Task, status TaskStatus)
func (*Job) ValidTaskNum ¶
ValidTaskNum returns the number of tasks that are valid
type Task ¶
type Task struct { UID TaskID Job JobID Name string Namespace string Status TaskStatus NodeName string Pod *v1.Pod }
Task will have all info about the task.
type TaskStatus ¶
type TaskStatus int
TaskStatus defines the status of a task/pod.
const ( // Pending means the task is pending in the apiserver. Pending TaskStatus = 1 << iota // Unschedulable means the pod is pending, but may be lack of resources Unschedulable // Bound means the task/Pod bounds to a host. Bound // Running means a task is running on the host. Running // Releasing means a task/pod is deleted. Releasing // Succeeded means that all containers in the pod have voluntarily terminated // with a container exit code of 0, and the system is not going to restart any of these containers. Succeeded // Failed means that all containers in the pod have terminated, and at least one container has // terminated in a failure (exited with a non-zero exit code or was stopped by the system). Failed // Unknown means the status of task/pod is unknown to the scheduler. Unknown )
func (TaskStatus) String ¶
func (ts TaskStatus) String() string
Click to show internal directories.
Click to hide internal directories.