MCPcopy
hub / github.com/dragonflyoss/dragonfly / Job

Interface Job

scheduler/job/job.go:55–77  ·  view source on GitHub ↗

Job is an interface for job.

Source from the content-addressed store, hash-verified

53
54// Job is an interface for job.
55type Job interface {
56 // Serve starts the job.
57 Serve()
58
59 // GetTask retrieves task information from all hosts in the cluster.
60 GetTask(context.Context, *internaljob.GetTaskRequest, *logger.SugaredLoggerOnWith) (*internaljob.GetTaskResponse, error)
61
62 // ListTaskEntries lists all task entries.
63 ListTaskEntries(context.Context, *internaljob.ListTaskEntriesRequest, *logger.SugaredLoggerOnWith) (*internaljob.ListTaskEntriesResponse, error)
64
65 // PreheatSinglePeer preheats job by single seed peer, scheduler will trigger seed peer to download task.
66 PreheatSingleSeedPeer(context.Context, *internaljob.PreheatRequest, *logger.SugaredLoggerOnWith) (*internaljob.PreheatResponse, error)
67
68 // PreheatAllSeedPeers preheats job by all peer seed peers, only supported by v2 protocol. Scheduler will trigger all seed peers to download task.
69 // If all the seed peers download task failed, return error. If some of the seed peers download task failed, return success tasks and failure tasks.
70 // Notify the client that the preheat is successful.
71 PreheatAllSeedPeers(context.Context, *internaljob.PreheatRequest, *logger.SugaredLoggerOnWith) (*internaljob.PreheatResponse, error)
72
73 // PreheatAllPeers preheats job by all peers, only supported by v2 protocol. Scheduler will trigger all peers to download task.
74 // If all the peers download task failed, return error. If some of the peers download task failed, return success tasks and
75 // failure tasks. Notify the client that the preheat is successful.
76 PreheatAllPeers(context.Context, *internaljob.PreheatRequest, *logger.SugaredLoggerOnWith) (*internaljob.PreheatResponse, error)
77}
78
79// job is an implementation of Job.
80type job struct {

Callers 26

ServeMethod · 0.65
runSchedulerFunction · 0.65
runManagerFunction · 0.65
TestServiceV2_StatImageFunction · 0.65
TestServiceV2_StatFileFunction · 0.65
StatImageMethod · 0.65
StatFileMethod · 0.65
TestServiceV2_StatFileFunction · 0.65
PreheatFileMethod · 0.65
StatFileMethod · 0.65
ListTaskEntriesMethod · 0.65

Implementers 3

jobscheduler/job/job.go
MockJobscheduler/job/mocks/job_mock.go
MockJobMockRecorderscheduler/job/mocks/job_mock.go

Calls

no outgoing calls

Tested by

no test coverage detected