Documentation
¶
Index ¶
- Variables
- type Arguments
- type ClusterID
- type FinishedJobInfo
- type GetStatusFunc
- type JobQueue
- type JobQueues
- type JobSyncInfo
- type LessFn
- type NodeSyncInfo
- type NodeTaskSyncInfo
- type PFJob
- type PFJobInterface
- type PolicyFactory
- type PriorityQueue
- type QueueID
- type QueueInfo
- type QueueSyncInfo
- type Registry
- type SortPolicy
- type StatusInfo
- type TaskSyncInfo
Constants ¶
This section is empty.
Variables ¶
var QueueSortPolicies = make(Registry)
QueueSortPolicies global queue sort policies
Functions ¶
This section is empty.
Types ¶
type FinishedJobInfo ¶ added in v0.14.5
type FinishedJobInfo struct {
Namespace string
Name string
Duration time.Duration
FrameworkVersion schema.FrameworkVersion
}
FinishedJobInfo contains gc job info
type GetStatusFunc ¶ added in v0.14.5
type GetStatusFunc func(interface{}) (StatusInfo, error)
type JobQueue ¶ added in v0.14.3
type JobQueue struct {
sync.RWMutex
StopCh chan struct{}
Queue *QueueInfo
Jobs *PriorityQueue
// contains filtered or unexported fields
}
func NewJobQueue ¶ added in v0.14.3
func (*JobQueue) DeleteMark ¶ added in v0.14.3
type JobQueues ¶ added in v0.14.3
JobQueues the collect of JobQueue
func NewJobQueues ¶ added in v0.14.3
func NewJobQueues() JobQueues
type JobSyncInfo ¶ added in v0.14.5
type JobSyncInfo struct {
ID string
Namespace string
ParentJobID string
FrameworkVersion schema.FrameworkVersion
Status schema.JobStatus
RuntimeInfo interface{}
RuntimeStatus interface{}
Annotations map[string]string
Message string
Action schema.ActionType
RetryTimes int
}
func (*JobSyncInfo) String ¶ added in v0.14.5
func (js *JobSyncInfo) String() string
type LessFn ¶
type LessFn func(interface{}, interface{}) bool
LessFn is the func declaration used by sort or priority queue.
type NodeSyncInfo ¶ added in v0.14.6
type NodeTaskSyncInfo ¶ added in v0.14.6
type PFJob ¶
type PFJob struct {
ID string
Name string
Namespace string
UserName string
// JobType of job, such as TypeSingle, TypeDistributed, and TypeWorkflow
JobType schema.JobType
Framework schema.Framework
// TODO: use Framework and Tasks.Role instead of JobMode
JobMode string
Status string
// compute resource request resource for job
// ClusterID and QueueID of job
ClusterID ClusterID
QueueID QueueID
QueueName string
Resource *resources.Resource
Priority int32
MinAvailable int32
// PriorityClassName defines job info on cluster
PriorityClassName string
// Tasks for TypeDistributed job
Tasks []schema.Member
// ExtRuntimeConf define extra runtime conf
ExtRuntimeConf []byte
// ExtensionTemplate records the extension template of job
ExtensionTemplate []byte
IsCustomYaml bool
// Conf for job
Conf schema.Conf
// Labels for job to update
Labels map[string]string
Annotations map[string]string
// extend field
Tags []string
LogUrl string
WaitingTime *time.Duration
CreateTime time.Time
StartTime time.Time
EndTIme time.Time
}
PFJob will have all info of a Job
func (*PFJob) NamespacedName ¶ added in v0.14.5
func (*PFJob) UpdateAnnotations ¶
func (*PFJob) UpdateJobPriority ¶ added in v0.14.3
func (*PFJob) UpdateLabels ¶
type PFJobInterface ¶
type PolicyFactory ¶
type PolicyFactory = func(configuration Arguments) (SortPolicy, error)
PolicyFactory is a function that builds a sort policy.
type PriorityQueue ¶
type PriorityQueue struct {
// contains filtered or unexported fields
}
PriorityQueue implements a scheduling queue.
func NewPriorityQueue ¶
func NewPriorityQueue(lessFn LessFn) *PriorityQueue
NewPriorityQueue returns a PriorityQueue
func (*PriorityQueue) Pop ¶
func (q *PriorityQueue) Pop() interface{}
Pop pops element in the priority Queue
func (*PriorityQueue) Push ¶
func (q *PriorityQueue) Push(it interface{})
Push pushes element in the priority Queue
type QueueInfo ¶
type QueueInfo struct {
UID QueueID
Name string
Namespace string
// ClusterID for queue
ClusterID ClusterID
Type string
Status string
// Priority for queue
Priority int32
Weight int32
// SortPolicy for queue job
SortPolicyNames []string
SortPolicies []SortPolicy
// Location for queue affinity
Location map[string]string
// SchedulerName for queue job
SchedulerName string
//
Permissions []string
// Resource range of queue
MaxResources *resources.Resource
MinResources *resources.Resource
UsedResources *resources.Resource
}
QueueInfo will have all details about queue
func NewQueueInfo ¶
func (*QueueInfo) JobOrderFn ¶
type QueueSyncInfo ¶ added in v0.14.5
type QueueSyncInfo struct {
Name string
Namespace string
Labels map[string]string
Status string
QuotaType string
MaxResource *resources.Resource
MinResource *resources.Resource
Action schema.ActionType
Message string
RetryTimes int
}
QueueSyncInfo contains queue sync info
type Registry ¶
type Registry map[string]PolicyFactory
Registry is a collection of all available sort polices.
func (Registry) Register ¶
func (r Registry) Register(name string, factory PolicyFactory) error
Register adds a new sort policy to the registry. If a sort policy with the same name exists, it returns an error.
func (Registry) Unregister ¶
Unregister removes an existing sort policy from the registry. If no sort policy with the provided name exists, it returns an error.
type SortPolicy ¶
func NewRegistry ¶
func NewRegistry(policyNames []string) []SortPolicy
NewRegistry registry sort policy for queue
type StatusInfo ¶ added in v0.14.5
type TaskSyncInfo ¶ added in v0.14.5
type TaskSyncInfo struct {
ID string
Name string
Namespace string
JobID string
NodeName string
MemberRole schema.MemberRole
Status schema.TaskStatus
Message string
PodStatus interface{}
Action schema.ActionType
RetryTimes int
}