Job is an interface for job.
| 53 | |
| 54 | // Job is an interface for job. |
| 55 | type 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. |
| 80 | type job struct { |
no outgoing calls
no test coverage detected