Documentation ¶
Index ¶
- Constants
- type Quota
- type QuotaGroup
- type QuotaGroupMgr
- func (rg *QuotaGroupMgr) AddTask(groupName string, taskId taskmodel.TaskIdType, taskType uint32, ...) error
- func (rg *QuotaGroupMgr) GetTaskCount() (taskCount uint, err error)
- func (rg *QuotaGroupMgr) Init() error
- func (rg *QuotaGroupMgr) Select(retTaskId *taskmodel.TaskIdType, subtasks *[]taskmodel.SubtaskBody) error
- type QuotaGroupRecord
Constants ¶
View Source
const ( // 资源组同步的间隔, 秒 QuotaGroupSyncInterval uint32 = 120 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type QuotaGroup ¶
type QuotaGroup struct { ID uint32 // ID Name string // 资源组名 Quota float32 // 资源组的调度资源配额 Description string // 资源组的描述 InsertTime uint64 // 资源组的插入时间 QueueGroup *schedulingqueue.SchedulingTeam // 资源组的调度队列组 }
资源组结构
type QuotaGroupMgr ¶
type QuotaGroupMgr struct { GroupMap map[string]*QuotaGroup // 资源组表 QuotaList []Quota // 所有资源组的quota值的列表 MaxQuota float32 // 资源组中最大的quota值 MaxQuotaIndex int // 最大quota值元素的索引 Mutex sync.Mutex // 访问锁 }
资源组管理器
func (*QuotaGroupMgr) AddTask ¶
func (rg *QuotaGroupMgr) AddTask( groupName string, taskId taskmodel.TaskIdType, taskType uint32, priority uint32, ) error
向资源组中添加任务
func (*QuotaGroupMgr) GetTaskCount ¶
func (rg *QuotaGroupMgr) GetTaskCount() (taskCount uint, err error)
获取调度中的任务总数
func (*QuotaGroupMgr) Select ¶
func (rg *QuotaGroupMgr) Select( retTaskId *taskmodel.TaskIdType, subtasks *[]taskmodel.SubtaskBody, ) error
选择要调度的资源组, 调度任务, 返回任务下被调度到的子任务列表 无法选出子任务时, retTaskId为0, subtasks返回的元素为空
Click to show internal directories.
Click to hide internal directories.