Documentation ¶
Index ¶
- Constants
- func NewMgr(pCtx context.Context, work *types.Work) types.RemoteMgr
- type Mgr
- func (m *Mgr) DecRemoteJobs()
- func (m *Mgr) ExecuteTask(req *types.RemoteTaskExecuteRequest) (*types.RemoteTaskExecuteResult, error)
- func (m *Mgr) IncRemoteJobs()
- func (m *Mgr) Init()
- func (m *Mgr) SendFiles(req *types.RemoteTaskSendFileRequest) ([]string, error)
- func (m *Mgr) Start()
- func (m *Mgr) TotalSlots() int
- type RemoteSlotMgr
- type Status
Constants ¶
View Source
const ( MaxHightPrioritySlot = 48 MaxMiddlePrioritySlot = 48 SlotTCPTimeoutSeconds = 3600 * 24 MaxQuerySlotBatchSize = 10 // 最大slot空闲时间,超过考虑释放 MaxSlotIdleIntervalTime = 30 * time.Second // 最大job空闲时间,超过这个考虑转本地 MaxJosIdleIntervalTime = 60 * time.Second // 最大无slot的时间,和上面结合起来,考虑转本地 MaxNoSlotSIntervalTime = 30 * time.Second RefusedRecoverSeconds = 120 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Mgr ¶
type Mgr struct {
// contains filtered or unexported fields
}
Mgr describe the remote manager provides the actions handler to remote workers
func (*Mgr) ExecuteTask ¶
func (m *Mgr) ExecuteTask(req *types.RemoteTaskExecuteRequest) (*types.RemoteTaskExecuteResult, error)
ExecuteTask run the task in remote worker and ensure the dependent files
func (*Mgr) Init ¶
func (m *Mgr) Init()
Init do the initialization for remote manager !! only call once !!
type RemoteSlotMgr ¶
type RemoteSlotMgr interface { Handle(ctx context.Context) Reset(hl []*dcProtocol.Host) ([]*dcProtocol.Host, error) DisableAllWorker() GetDeadWorkers() []*worker RecoverDeadWorker(w *worker) DisableWorker(host *dcProtocol.Host) EnableWorker(host *dcProtocol.Host) CanWorkerRetry(host *dcProtocol.Host) bool // check if worker can retry, if can set worker status to retrying SetWorkerStatus(host *dcProtocol.Host, status Status) Lock(usage dcSDK.JobUsage, f string, banWorkerList []*dcProtocol.Host) *dcProtocol.Host Unlock(usage dcSDK.JobUsage, host *dcProtocol.Host) TotalSlots() int GetWorkers() []*worker CountWorkerError(w *worker) IsWorkerDead(w *worker, netErrorLimit int) bool WorkerDead(w *worker) }
Click to show internal directories.
Click to hide internal directories.