Documentation
¶
Index ¶
- func RegisterWorker()
- type Config
- type JobMaster
- func (jm *JobMaster) CloseImpl(ctx context.Context)
- func (jm *JobMaster) ID() worker.RunnableID
- func (jm *JobMaster) InitImpl(ctx context.Context) (err error)
- func (jm *JobMaster) IsJobMasterImpl()
- func (jm *JobMaster) OnCancel(ctx context.Context) error
- func (jm *JobMaster) OnMasterMessage(ctx context.Context, topic p2p.Topic, message p2p.MessageValue) error
- func (jm *JobMaster) OnMasterRecovered(ctx context.Context) (err error)
- func (jm *JobMaster) OnOpenAPIInitialized(apiGroup *gin.RouterGroup)
- func (jm *JobMaster) OnWorkerDispatched(worker framework.WorkerHandle, err error) error
- func (jm *JobMaster) OnWorkerMessage(worker framework.WorkerHandle, topic p2p.Topic, message p2p.MessageValue) error
- func (jm *JobMaster) OnWorkerOffline(worker framework.WorkerHandle, reason error) error
- func (jm *JobMaster) OnWorkerOnline(worker framework.WorkerHandle) error
- func (jm *JobMaster) OnWorkerStatusUpdated(worker framework.WorkerHandle, newStatus *frameModel.WorkerStatus) error
- func (jm *JobMaster) Status() frameModel.WorkerStatus
- func (jm *JobMaster) StopImpl(ctx context.Context)
- func (jm *JobMaster) Tick(ctx context.Context) error
- type Status
- type SyncFileInfo
- type WorkerInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterWorker ¶
func RegisterWorker()
RegisterWorker is used to register cvs job master into global registry
Types ¶
type Config ¶
type Config struct { SrcHost string `toml:"srcHost" json:"srcHost"` SrcDir string `toml:"srcDir" json:"srcDir"` DstHost string `toml:"dstHost" json:"dstHost"` DstDir string `toml:"dstDir" json:"dstDir"` FileNum int `toml:"fileNum" json:"fileNum"` }
Config records all configurations of cvs job
type JobMaster ¶
type JobMaster struct { sync.Mutex framework.BaseJobMaster // contains filtered or unexported fields }
JobMaster defines cvs job master
func NewCVSJobMaster ¶
func NewCVSJobMaster(ctx *dcontext.Context, workerID frameModel.WorkerID, masterID frameModel.MasterID, conf *Config) *JobMaster
NewCVSJobMaster creates a new cvs job master
func (*JobMaster) IsJobMasterImpl ¶
func (jm *JobMaster) IsJobMasterImpl()
IsJobMasterImpl implements JobMasterImpl.IsJobMasterImpl
func (*JobMaster) OnMasterMessage ¶
func (jm *JobMaster) OnMasterMessage(ctx context.Context, topic p2p.Topic, message p2p.MessageValue) error
OnMasterMessage implements JobMasterImpl.OnMasterMessage
func (*JobMaster) OnMasterRecovered ¶
OnMasterRecovered implements JobMasterImpl.OnMasterRecovered
func (*JobMaster) OnOpenAPIInitialized ¶
func (jm *JobMaster) OnOpenAPIInitialized(apiGroup *gin.RouterGroup)
OnOpenAPIInitialized implements JobMasterImpl.OnOpenAPIInitialized.
func (*JobMaster) OnWorkerDispatched ¶
func (jm *JobMaster) OnWorkerDispatched(worker framework.WorkerHandle, err error) error
OnWorkerDispatched implements JobMasterImpl.OnWorkerDispatched
func (*JobMaster) OnWorkerMessage ¶
func (jm *JobMaster) OnWorkerMessage(worker framework.WorkerHandle, topic p2p.Topic, message p2p.MessageValue) error
OnWorkerMessage implements JobMasterImpl.OnWorkerMessage
func (*JobMaster) OnWorkerOffline ¶
func (jm *JobMaster) OnWorkerOffline(worker framework.WorkerHandle, reason error) error
OnWorkerOffline implements JobMasterImpl.OnWorkerOffline When offline, we should: 1. remove this file from map cache 2. update checkpoint, but note that this operation might fail.
func (*JobMaster) OnWorkerOnline ¶
func (jm *JobMaster) OnWorkerOnline(worker framework.WorkerHandle) error
OnWorkerOnline implements JobMasterImpl.OnWorkerOnline
func (*JobMaster) OnWorkerStatusUpdated ¶
func (jm *JobMaster) OnWorkerStatusUpdated(worker framework.WorkerHandle, newStatus *frameModel.WorkerStatus) error
OnWorkerStatusUpdated implements JobMasterImpl.OnWorkerStatusUpdated
func (*JobMaster) Status ¶
func (jm *JobMaster) Status() frameModel.WorkerStatus
Status implements JobMasterImpl.Status
type Status ¶
type Status struct { *Config `json:"cfg"` FileInfos map[int]*SyncFileInfo `json:"files"` }
Status records worker status of cvs job master
type SyncFileInfo ¶
SyncFileInfo records sync file progress
type WorkerInfo ¶
type WorkerInfo struct {
// contains filtered or unexported fields
}
WorkerInfo holds handler of worker