Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var QueueSortPolicies = make(Registry)
QueueSortPolicies global queue sort policies
Functions ¶
This section is empty.
Types ¶
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 LessFn ¶
type LessFn func(interface{}, interface{}) bool
LessFn is the func declaration used by sort or priority queue.
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
Resource *resources.Resource
Priority int32
MinAvailable int32
// PriorityClassName defines job info on cluster
PriorityClassName string
// storage resource for job
FSID string
// Tasks for TypeDistributed job
Tasks []models.Member
// ExtRuntimeConf define extra runtime conf
ExtRuntimeConf []byte
// ExtensionTemplate records the extension template of job
ExtensionTemplate string
// 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) 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
// SchedulerName for queue job
SchedulerName string
//
Permissions []string
// Resource range of queue
Max *resources.Resource
Min *resources.Resource
Used *resources.Resource
}
QueueInfo will have all details about queue
func NewQueueInfo ¶
func (*QueueInfo) JobOrderFn ¶
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