Documentation ¶
Index ¶
- Constants
- func Cleanup(cleanupArgs *api.CleanupArgs) (*api.CleanupResult, error)
- func CompletedNotify(completedNotifyArgs *api.CompletedNotifyArgs) (*api.CompletedNotifyResult, error)
- func Expire(expireArgs *api.ExpireArgs) (*api.ExpireResult, error)
- func GetCandidateBaremetalList(candidates []core.Candidater, args *api.CandidateListArgs, ...) (*api.CandidateListResult, error)
- func GetCandidateDetail(args *api.CandidateDetailArgs) (*api.CandidateDetailResult, error)
- func GetCandidateHostList(candidates []core.Candidater, args *api.CandidateListArgs, ...) (*api.CandidateListResult, error)
- func GetCandidateList(args *api.CandidateListArgs) (*api.CandidateListResult, error)
- func GetCandidateManager() *data_manager.CandidateManager
- func GetHistoryDetail(historyDetailArgs *api.HistoryDetailArgs) (*api.HistoryDetailResult, error)
- func GetHistoryList(historyArgs *api.HistoryArgs) (*api.HistoryResult, error)
- func InitAndStart(stopCh <-chan struct{})
- func IsReady() bool
- func NewSessionID() string
- func Schedule(info *api.SchedInfo) ([]*core.SchedResultItem, error)
- type BaremetalCandidatesProvider
- type BaremetalScheduler
- type BaseCandidateProvider
- type BaseScheduler
- func (s *BaseScheduler) BeforePredicate() error
- func (s *BaseScheduler) CandidateManager() *data_manager.CandidateManager
- func (s *BaseScheduler) DirtySelectedCandidates(scs []*core.SelectedCandidate)
- func (s *BaseScheduler) NewSchedUnit() *core.Unit
- func (s *BaseScheduler) SchedData() *api.SchedData
- func (s *BaseScheduler) Unit() *core.Unit
- type CandidatesProvider
- type CompletedManager
- type ExpireManager
- type GuestScheduler
- type HistoryItem
- type HistoryManager
- type HostCandidatesProvider
- type Scheduler
- type SchedulerManager
- type Task
- type TaskExecuteCallback
- type TaskExecutor
- type TaskExecutorQueue
- type TaskExecutorQueueManager
- type TaskManager
Constants ¶
Variables ¶
This section is empty.
Functions ¶
func Cleanup ¶
func Cleanup(cleanupArgs *api.CleanupArgs) (*api.CleanupResult, error)
func CompletedNotify ¶
func CompletedNotify(completedNotifyArgs *api.CompletedNotifyArgs) (*api.CompletedNotifyResult, error)
func Expire ¶
func Expire(expireArgs *api.ExpireArgs) (*api.ExpireResult, error)
func GetCandidateBaremetalList ¶
func GetCandidateBaremetalList( candidates []core.Candidater, args *api.CandidateListArgs, r *api.CandidateListResult, ) (*api.CandidateListResult, error)
func GetCandidateDetail ¶
func GetCandidateDetail(args *api.CandidateDetailArgs) (*api.CandidateDetailResult, error)
func GetCandidateHostList ¶
func GetCandidateHostList( candidates []core.Candidater, args *api.CandidateListArgs, r *api.CandidateListResult, ) (*api.CandidateListResult, error)
func GetCandidateList ¶
func GetCandidateList(args *api.CandidateListArgs) (*api.CandidateListResult, error)
func GetCandidateManager ¶
func GetCandidateManager() *data_manager.CandidateManager
func GetHistoryDetail ¶
func GetHistoryDetail(historyDetailArgs *api.HistoryDetailArgs) (*api.HistoryDetailResult, error)
func GetHistoryList ¶
func GetHistoryList(historyArgs *api.HistoryArgs) (*api.HistoryResult, error)
func InitAndStart ¶
func InitAndStart(stopCh <-chan struct{})
func NewSessionID ¶
func NewSessionID() string
NewSessionID returns the current timestamp of a string type with precision of milliseconds. And it should be consistent with the format of Region. just like: 1509699887616
Types ¶
type BaremetalCandidatesProvider ¶
type BaremetalCandidatesProvider struct {
*BaseCandidateProvider
}
func NewBaremetalCandidatesProvider ¶
func NewBaremetalCandidatesProvider(s Scheduler) *BaremetalCandidatesProvider
func (*BaremetalCandidatesProvider) CandidateType ¶
func (b *BaremetalCandidatesProvider) CandidateType() string
func (*BaremetalCandidatesProvider) Candidates ¶
func (b *BaremetalCandidatesProvider) Candidates() ([]core.Candidater, error)
func (*BaremetalCandidatesProvider) ProviderType ¶
func (b *BaremetalCandidatesProvider) ProviderType() string
type BaremetalScheduler ¶
type BaremetalScheduler struct { *BaseScheduler // contains filtered or unexported fields }
BaremetalScheduler for baremetal type schedule
func (*BaremetalScheduler) Candidates ¶
func (bs *BaremetalScheduler) Candidates() ([]core.Candidater, error)
func (*BaremetalScheduler) Predicates ¶
func (bs *BaremetalScheduler) Predicates() (map[string]core.FitPredicate, error)
func (*BaremetalScheduler) PriorityConfigs ¶
func (bs *BaremetalScheduler) PriorityConfigs() ([]core.PriorityConfig, error)
type BaseCandidateProvider ¶
type BaseCandidateProvider struct {
// contains filtered or unexported fields
}
func (*BaseCandidateProvider) CandidateManager ¶
func (b *BaseCandidateProvider) CandidateManager() *data_manager.CandidateManager
type BaseScheduler ¶
type BaseScheduler struct {
// contains filtered or unexported fields
}
func (*BaseScheduler) BeforePredicate ¶
func (s *BaseScheduler) BeforePredicate() error
func (*BaseScheduler) CandidateManager ¶
func (s *BaseScheduler) CandidateManager() *data_manager.CandidateManager
func (*BaseScheduler) DirtySelectedCandidates ¶
func (s *BaseScheduler) DirtySelectedCandidates(scs []*core.SelectedCandidate)
func (*BaseScheduler) NewSchedUnit ¶
func (s *BaseScheduler) NewSchedUnit() *core.Unit
func (*BaseScheduler) SchedData ¶
func (s *BaseScheduler) SchedData() *api.SchedData
func (*BaseScheduler) Unit ¶
func (s *BaseScheduler) Unit() *core.Unit
type CandidatesProvider ¶
type CandidatesProvider interface { ProviderType() string CandidateType() string Candidates() ([]core.Candidater, error) CandidateManager() *data_manager.CandidateManager }
type CompletedManager ¶
type CompletedManager struct {
// contains filtered or unexported fields
}
func NewCompletedManager ¶
func NewCompletedManager(stopCh <-chan struct{}) *CompletedManager
func (*CompletedManager) Add ¶
func (c *CompletedManager) Add(completedNotifyArgs *api.CompletedNotifyArgs)
func (*CompletedManager) Run ¶
func (c *CompletedManager) Run()
type ExpireManager ¶
type ExpireManager struct {
// contains filtered or unexported fields
}
func NewExpireManager ¶
func NewExpireManager(stopCh <-chan struct{}) *ExpireManager
func (*ExpireManager) Add ¶
func (e *ExpireManager) Add(expireArgs *api.ExpireArgs)
func (*ExpireManager) Run ¶
func (e *ExpireManager) Run()
type GuestScheduler ¶
type GuestScheduler struct { *BaseScheduler // contains filtered or unexported fields }
GuestScheduler for guest type schedule
func (*GuestScheduler) Candidates ¶
func (gs *GuestScheduler) Candidates() ([]core.Candidater, error)
func (*GuestScheduler) Predicates ¶
func (gs *GuestScheduler) Predicates() (map[string]core.FitPredicate, error)
func (*GuestScheduler) PriorityConfigs ¶
func (gs *GuestScheduler) PriorityConfigs() ([]core.PriorityConfig, error)
type HistoryItem ¶
func NewHistoryItem ¶
func NewHistoryItem(task *Task) *HistoryItem
func (*HistoryItem) IsSuggestion ¶
func (h *HistoryItem) IsSuggestion() bool
func (*HistoryItem) ToMap ¶
func (h *HistoryItem) ToMap() map[string]string
type HistoryManager ¶
type HistoryManager struct {
// contains filtered or unexported fields
}
func NewHistoryManager ¶
func NewHistoryManager(stopCh <-chan struct{}) *HistoryManager
func (*HistoryManager) GetHistory ¶
func (m *HistoryManager) GetHistory(sessionId string) *HistoryItem
func (*HistoryManager) GetHistoryList ¶
func (m *HistoryManager) GetHistoryList(offset int64, limit int64, all bool) ([]*HistoryItem, int64)
func (*HistoryManager) NewHistoryItem ¶
func (m *HistoryManager) NewHistoryItem(task *Task) *HistoryItem
func (*HistoryManager) Run ¶
func (m *HistoryManager) Run()
type HostCandidatesProvider ¶
type HostCandidatesProvider struct {
*BaseCandidateProvider
}
func NewHostCandidatesProvider ¶
func NewHostCandidatesProvider(s Scheduler) *HostCandidatesProvider
func (*HostCandidatesProvider) CandidateType ¶
func (h *HostCandidatesProvider) CandidateType() string
func (*HostCandidatesProvider) Candidates ¶
func (h *HostCandidatesProvider) Candidates() ([]core.Candidater, error)
func (*HostCandidatesProvider) ProviderType ¶
func (h *HostCandidatesProvider) ProviderType() string
type Scheduler ¶
type Scheduler interface { SchedData() *api.SchedData CandidateManager() *data_manager.CandidateManager // Schedule process BeforePredicate() error Predicates() (map[string]core.FitPredicate, error) PriorityConfigs() ([]core.PriorityConfig, error) // Schedule input get function Unit() *core.Unit Candidates() ([]core.Candidater, error) DirtySelectedCandidates([]*core.SelectedCandidate) }
type SchedulerManager ¶
type SchedulerManager struct { ExpireManager *ExpireManager CompletedManager *CompletedManager HistoryManager *HistoryManager TaskManager *TaskManager DataManager *data_manager.DataManager CandidateManager *data_manager.CandidateManager }
func NewSchedulerManager ¶
func NewSchedulerManager(stopCh <-chan struct{}) *SchedulerManager
type Task ¶
type Task struct { Time time.Time SchedInfo *api.SchedInfo Consuming time.Duration // contains filtered or unexported fields }
func (*Task) GetSessionID ¶
func (*Task) GetTaskExecutor ¶
func (t *Task) GetTaskExecutor(tag string) *TaskExecutor
type TaskExecuteCallback ¶
type TaskExecuteCallback func(task *TaskExecutor)
type TaskExecutor ¶
type TaskExecutor struct { Tag string Status string Time time.Time Consuming time.Duration // contains filtered or unexported fields }
func NewTaskExecutor ¶
func NewTaskExecutor(scheduler Scheduler, taskExecuteCallback TaskExecuteCallback) *TaskExecutor
func (*TaskExecutor) Execute ¶
func (te *TaskExecutor) Execute()
func (*TaskExecutor) GetLogs ¶
func (te *TaskExecutor) GetLogs() []string
func (*TaskExecutor) GetResult ¶
func (te *TaskExecutor) GetResult() ([]*core.SchedResultItem, error)
func (*TaskExecutor) Kill ¶
func (te *TaskExecutor) Kill()
type TaskExecutorQueue ¶
type TaskExecutorQueue struct {
// contains filtered or unexported fields
}
func NewTaskExecutorQueue ¶
func NewTaskExecutorQueue(schedType string, poolId string, stopCh <-chan struct{}) *TaskExecutorQueue
func (*TaskExecutorQueue) AddTaskExecutor ¶
func (teq *TaskExecutorQueue) AddTaskExecutor(scheduler Scheduler, callback TaskExecuteCallback) *TaskExecutor
func (*TaskExecutorQueue) Start ¶
func (teq *TaskExecutorQueue) Start(stopCh <-chan struct{})
type TaskExecutorQueueManager ¶
type TaskExecutorQueueManager struct {
// contains filtered or unexported fields
}
func NewTaskExecutorQueueManager ¶
func NewTaskExecutorQueueManager(stopCh <-chan struct{}) *TaskExecutorQueueManager
func (*TaskExecutorQueueManager) AddTaskExecutor ¶
func (teqm *TaskExecutorQueueManager) AddTaskExecutor( scheduler Scheduler, callback TaskExecuteCallback) *TaskExecutor
func (*TaskExecutorQueueManager) GetQueue ¶
func (teqm *TaskExecutorQueueManager) GetQueue(schedType string, poolId string, ) *TaskExecutorQueue
type TaskManager ¶
type TaskManager struct {
// contains filtered or unexported fields
}
func NewTaskManager ¶
func NewTaskManager(stopCh <-chan struct{}) *TaskManager
func (*TaskManager) AddTask ¶
func (tm *TaskManager) AddTask(schedulerManager *SchedulerManager, schedInfo *api.SchedInfo) (*Task, error)
AddTask provides an interface to increase the scheduling task, it will be a scheduling request by the host specification type split into multiple scheduling tasks, added to the scheduling task manager.
func (*TaskManager) Run ¶
func (tm *TaskManager) Run()
Click to show internal directories.
Click to hide internal directories.