| 140 | } |
| 141 | |
| 142 | pub struct Job { |
| 143 | pub job_id: JobId, |
| 144 | pub counters: JobTaskCounters, |
| 145 | pub tasks: Map<JobTaskId, JobTaskInfo>, |
| 146 | |
| 147 | pub job_desc: JobDescription, |
| 148 | pub submit_descs: SmallVec<[SubmittedJobDescription; 1]>, |
| 149 | |
| 150 | // If true, new tasks may be submitted into this job |
| 151 | // If true and all tasks in the job are terminated then the job |
| 152 | // is in state OPEN not FINISHED. |
| 153 | pub is_open: bool, |
| 154 | pub cancel_reason: Option<String>, |
| 155 | |
| 156 | pub submission_date: DateTime<Utc>, |
| 157 | pub completion_date: Option<DateTime<Utc>>, |
| 158 | } |
| 159 | |
| 160 | impl Job { |
| 161 | pub fn new(job_id: JobId, job_desc: JobDescription, is_open: bool) -> Self { |
no outgoing calls