cvs

package
v0.0.0-...-be15534 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

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) CloseImpl

func (jm *JobMaster) CloseImpl(ctx context.Context)

CloseImpl is called when the master is being closed

func (*JobMaster) ID

func (jm *JobMaster) ID() worker.RunnableID

ID implements JobMasterImpl.ID

func (*JobMaster) InitImpl

func (jm *JobMaster) InitImpl(ctx context.Context) (err error)

InitImpl implements JobMasterImpl.InitImpl

func (*JobMaster) IsJobMasterImpl

func (jm *JobMaster) IsJobMasterImpl()

IsJobMasterImpl implements JobMasterImpl.IsJobMasterImpl

func (*JobMaster) OnCancel

func (jm *JobMaster) OnCancel(ctx context.Context) error

OnCancel implements JobMasterImpl.OnCancel

func (*JobMaster) OnMasterMessage

func (jm *JobMaster) OnMasterMessage(ctx context.Context, topic p2p.Topic, message p2p.MessageValue) error

OnMasterMessage implements JobMasterImpl.OnMasterMessage

func (*JobMaster) OnMasterRecovered

func (jm *JobMaster) OnMasterRecovered(ctx context.Context) (err error)

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

func (*JobMaster) StopImpl

func (jm *JobMaster) StopImpl(ctx context.Context)

StopImpl is called when the master is being canceled

func (*JobMaster) Tick

func (jm *JobMaster) Tick(ctx context.Context) error

Tick implements JobMasterImpl.Tick

type Status

type Status struct {
	*Config `json:"cfg"`

	FileInfos map[int]*SyncFileInfo `json:"files"`
}

Status records worker status of cvs job master

type SyncFileInfo

type SyncFileInfo struct {
	Idx      int    `json:"idx"`
	Location string `json:"loc"`
}

SyncFileInfo records sync file progress

type WorkerInfo

type WorkerInfo struct {
	// contains filtered or unexported fields
}

WorkerInfo holds handler of worker

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL