Documentation ¶
Index ¶
- func CleanupPluginBuilders()
- func CloseSession(ssn *Session)
- func RegisterAction(act Action)
- func RegisterPluginBuilder(name string, pc PluginBuilder)
- func TimeJitterAfter(new, old time.Time, duration, maxJitter time.Duration) bool
- type Action
- type Arguments
- type Event
- type EventHandler
- type Plugin
- type PluginBuilder
- type Session
- func (ssn *Session) AddBatchNodeOrderFn(name string, pf api.BatchNodeOrderFn)
- func (ssn *Session) AddEventHandler(eh *EventHandler)
- func (ssn *Session) AddJobEnqueueableFn(name string, fn api.ValidateFn)
- func (ssn *Session) AddJobOrderFn(name string, cf api.CompareFn)
- func (ssn *Session) AddJobPipelinedFn(name string, vf api.ValidateFn)
- func (ssn *Session) AddJobReadyFn(name string, vf api.ValidateFn)
- func (ssn *Session) AddJobValidFn(name string, fn api.ValidateExFn)
- func (ssn *Session) AddNamespaceOrderFn(name string, cf api.CompareFn)
- func (ssn *Session) AddNodeMapFn(name string, pf api.NodeMapFn)
- func (ssn *Session) AddNodeOrderFn(name string, pf api.NodeOrderFn)
- func (ssn *Session) AddNodeReduceFn(name string, pf api.NodeReduceFn)
- func (ssn *Session) AddOverusedFn(name string, fn api.ValidateFn)
- func (ssn *Session) AddPredicateFn(name string, pf api.PredicateFn)
- func (ssn *Session) AddPreemptableFn(name string, cf api.EvictableFn)
- func (ssn *Session) AddQueueOrderFn(name string, qf api.CompareFn)
- func (ssn *Session) AddReclaimableFn(name string, rf api.EvictableFn)
- func (ssn *Session) AddTaskOrderFn(name string, cf api.CompareFn)
- func (ssn *Session) Allocate(task *api.TaskInfo, hostname string) error
- func (ssn *Session) BatchNodeOrderFn(task *api.TaskInfo, nodes []*api.NodeInfo) (map[string]float64, error)
- func (ssn *Session) Evict(reclaimee *api.TaskInfo, reason string) error
- func (ssn *Session) JobEnqueueable(obj interface{}) bool
- func (ssn *Session) JobOrderFn(l, r interface{}) bool
- func (ssn *Session) JobPipelined(obj interface{}) bool
- func (ssn *Session) JobReady(obj interface{}) bool
- func (ssn *Session) JobValid(obj interface{}) *api.ValidateResult
- func (ssn *Session) NamespaceOrderFn(l, r interface{}) bool
- func (ssn *Session) NodeOrderFn(task *api.TaskInfo, node *api.NodeInfo) (float64, error)
- func (ssn *Session) NodeOrderMapFn(task *api.TaskInfo, node *api.NodeInfo) (map[string]float64, float64, error)
- func (ssn *Session) NodeOrderReduceFn(task *api.TaskInfo, ...) (map[string]float64, error)
- func (ssn *Session) Overused(queue *api.QueueInfo) bool
- func (ssn *Session) Pipeline(task *api.TaskInfo, hostname string) error
- func (ssn *Session) PredicateFn(task *api.TaskInfo, node *api.NodeInfo) error
- func (ssn *Session) Preemptable(preemptor *api.TaskInfo, preemptees []*api.TaskInfo) []*api.TaskInfo
- func (ssn *Session) QueueOrderFn(l, r interface{}) bool
- func (ssn *Session) Reclaimable(reclaimer *api.TaskInfo, reclaimees []*api.TaskInfo) []*api.TaskInfo
- func (ssn *Session) Statement() *Statement
- func (ssn Session) String() string
- func (ssn *Session) TaskCompareFns(l, r interface{}) int
- func (ssn *Session) TaskOrderFn(l, r interface{}) bool
- func (ssn *Session) UpdateJobCondition(jobInfo *api.JobInfo, cond *scheduling.PodGroupCondition) error
- type Statement
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CleanupPluginBuilders ¶
func CleanupPluginBuilders()
CleanupPluginBuilders cleans up all the plugin
func RegisterPluginBuilder ¶
func RegisterPluginBuilder(name string, pc PluginBuilder)
RegisterPluginBuilder register the plugin
Types ¶
type Action ¶
type Action interface { // The unique name of Action. Name() string // Initialize initializes the allocator plugins. Initialize() // Execute allocates the cluster's resources into each queue. Execute(ssn *Session) // UnIntialize un-initializes the allocator plugins. UnInitialize() }
Action is the interface of scheduler action.
type Arguments ¶
Arguments map
func GetArgOfActionFromConf ¶
func GetArgOfActionFromConf(configurations []conf.Configuration, actionName string) Arguments
GetArgOfActionFromConf return argument of action reading from configuration of schedule
func (Arguments) GetFloat64 ¶
GetFloat64 get the float64 value from string
type EventHandler ¶
EventHandler structure
type Plugin ¶
type Plugin interface { // The unique name of Plugin. Name() string OnSessionOpen(ssn *Session) OnSessionClose(ssn *Session) }
Plugin is the interface of scheduler plugin
type PluginBuilder ¶
PluginBuilder plugin management
func GetPluginBuilder ¶
func GetPluginBuilder(name string) (PluginBuilder, bool)
GetPluginBuilder get the pluginbuilder by name
type Session ¶
type Session struct { UID types.UID Jobs map[api.JobID]*api.JobInfo Nodes map[string]*api.NodeInfo Queues map[api.QueueID]*api.QueueInfo NamespaceInfo map[api.NamespaceName]*api.NamespaceInfo Backlog []*api.JobInfo Tiers []conf.Tier Configurations []conf.Configuration // contains filtered or unexported fields }
Session information for the current session
func OpenSession ¶
func OpenSession(cache cache.Cache, tiers []conf.Tier, configurations []conf.Configuration) *Session
OpenSession start the session
func (*Session) AddBatchNodeOrderFn ¶
func (ssn *Session) AddBatchNodeOrderFn(name string, pf api.BatchNodeOrderFn)
AddBatchNodeOrderFn add Batch Node order function
func (*Session) AddEventHandler ¶
func (ssn *Session) AddEventHandler(eh *EventHandler)
AddEventHandler add event handlers
func (*Session) AddJobEnqueueableFn ¶
func (ssn *Session) AddJobEnqueueableFn(name string, fn api.ValidateFn)
AddJobEnqueueableFn add jobenqueueable function
func (*Session) AddJobOrderFn ¶
AddJobOrderFn add job order function
func (*Session) AddJobPipelinedFn ¶
func (ssn *Session) AddJobPipelinedFn(name string, vf api.ValidateFn)
AddJobPipelinedFn add pipelined function
func (*Session) AddJobReadyFn ¶
func (ssn *Session) AddJobReadyFn(name string, vf api.ValidateFn)
AddJobReadyFn add JobReady function
func (*Session) AddJobValidFn ¶
func (ssn *Session) AddJobValidFn(name string, fn api.ValidateExFn)
AddJobValidFn add jobvalid function
func (*Session) AddNamespaceOrderFn ¶
AddNamespaceOrderFn add namespace order function
func (*Session) AddNodeMapFn ¶
AddNodeMapFn add Node map function
func (*Session) AddNodeOrderFn ¶
func (ssn *Session) AddNodeOrderFn(name string, pf api.NodeOrderFn)
AddNodeOrderFn add Node order function
func (*Session) AddNodeReduceFn ¶
func (ssn *Session) AddNodeReduceFn(name string, pf api.NodeReduceFn)
AddNodeReduceFn add Node reduce function
func (*Session) AddOverusedFn ¶
func (ssn *Session) AddOverusedFn(name string, fn api.ValidateFn)
AddOverusedFn add overused function
func (*Session) AddPredicateFn ¶
func (ssn *Session) AddPredicateFn(name string, pf api.PredicateFn)
AddPredicateFn add Predicate function
func (*Session) AddPreemptableFn ¶
func (ssn *Session) AddPreemptableFn(name string, cf api.EvictableFn)
AddPreemptableFn add preemptable function
func (*Session) AddQueueOrderFn ¶
AddQueueOrderFn add queue order function
func (*Session) AddReclaimableFn ¶
func (ssn *Session) AddReclaimableFn(name string, rf api.EvictableFn)
AddReclaimableFn add Reclaimable function
func (*Session) AddTaskOrderFn ¶
AddTaskOrderFn add task order function
func (*Session) BatchNodeOrderFn ¶
func (ssn *Session) BatchNodeOrderFn(task *api.TaskInfo, nodes []*api.NodeInfo) (map[string]float64, error)
BatchNodeOrderFn invoke node order function of the plugins
func (*Session) JobEnqueueable ¶
JobEnqueueable invoke jobEnqueueableFns function of the plugins
func (*Session) JobOrderFn ¶
JobOrderFn invoke joborder function of the plugins
func (*Session) JobPipelined ¶
JobPipelined invoke pipelined function of the plugins
func (*Session) JobValid ¶
func (ssn *Session) JobValid(obj interface{}) *api.ValidateResult
JobValid invoke jobvalid function of the plugins
func (*Session) NamespaceOrderFn ¶
NamespaceOrderFn invoke namespaceorder function of the plugins
func (*Session) NodeOrderFn ¶
NodeOrderFn invoke node order function of the plugins
func (*Session) NodeOrderMapFn ¶
func (ssn *Session) NodeOrderMapFn(task *api.TaskInfo, node *api.NodeInfo) (map[string]float64, float64, error)
NodeOrderMapFn invoke node order function of the plugins
func (*Session) NodeOrderReduceFn ¶
func (ssn *Session) NodeOrderReduceFn(task *api.TaskInfo, pluginNodeScoreMap map[string]schedulerapi.HostPriorityList) (map[string]float64, error)
NodeOrderReduceFn invoke node order function of the plugins
func (*Session) PredicateFn ¶
PredicateFn invoke predicate function of the plugins
func (*Session) Preemptable ¶
func (ssn *Session) Preemptable(preemptor *api.TaskInfo, preemptees []*api.TaskInfo) []*api.TaskInfo
Preemptable invoke preemptable function of the plugins
func (*Session) QueueOrderFn ¶
QueueOrderFn invoke queueorder function of the plugins
func (*Session) Reclaimable ¶
func (ssn *Session) Reclaimable(reclaimer *api.TaskInfo, reclaimees []*api.TaskInfo) []*api.TaskInfo
Reclaimable invoke reclaimable function of the plugins
func (*Session) TaskCompareFns ¶
TaskCompareFns invoke taskorder function of the plugins
func (*Session) TaskOrderFn ¶
TaskOrderFn invoke taskorder function of the plugins
func (*Session) UpdateJobCondition ¶
func (ssn *Session) UpdateJobCondition(jobInfo *api.JobInfo, cond *scheduling.PodGroupCondition) error
UpdateJobCondition update job condition accordingly.
type Statement ¶
type Statement struct {
// contains filtered or unexported fields
}
Statement structure
func (*Statement) Discard ¶
func (s *Statement) Discard()
Discard operation for evict, pipeline and allocate