MCPcopy Create free account
hub / github.com/It4innovations/hyperqueue / attach_submit

Method attach_submit

crates/hyperqueue/src/server/job.rs:490–528  ·  view source on GitHub ↗
(&mut self, description: SubmittedJobDescription)

Source from the content-addressed store, hash-verified

488 }
489
490 pub fn attach_submit(&mut self, description: SubmittedJobDescription) {
491 match &description.description().task_desc {
492 JobTaskDescription::Array { ids, .. } => {
493 self.tasks.reserve(ids.id_count() as usize);
494 ids.iter().for_each(|task_id| {
495 let task_id = JobTaskId::new(task_id);
496 assert!(
497 self.tasks
498 .insert(
499 task_id,
500 JobTaskInfo {
501 state: JobTaskState::Waiting,
502 },
503 )
504 .is_none()
505 );
506 })
507 }
508 JobTaskDescription::Graph {
509 tasks,
510 resource_rqs: _,
511 } => {
512 self.tasks.reserve(tasks.len());
513 tasks.iter().for_each(|task| {
514 assert!(
515 self.tasks
516 .insert(
517 task.id,
518 JobTaskInfo {
519 state: JobTaskState::Waiting,
520 },
521 )
522 .is_none()
523 );
524 })
525 }
526 };
527 self.submit_descs.push(description);
528 }
529}

Callers 2

submit_job_descFunction · 0.80
test_validate_submitFunction · 0.80

Calls 5

descriptionMethod · 0.80
id_countMethod · 0.80
pushMethod · 0.80
iterMethod · 0.45
lenMethod · 0.45

Tested by 1

test_validate_submitFunction · 0.64