wip(#3001): remove submit layer, rescue power ops into job_queue/power.rs
TREE IS RED ON PURPOSE — there is no compiling intermediate between
deleting submit and converting every caller. Checkpoint commit so the
work is durable; do not "fix" it by restoring submit.
Done:
- JobQueue::submit -> JobQueue::insert (no source/reason/container;
returns the ids insert_job names).
- submit.rs deleted. Its 6 pure chain builders + 3 async *_many
gatherers were NOT wrapper code and are rescued into
job_queue/power.rs (templates.rs documents power ops as living
outside it, because their shape needs a live is_running read).
- Converted: meta_inputs 1, topology 2, permissions 3, auto_update 2,
actions 3, lifecycle_handlers 3.
- Dropped source/reason at every converted site: nothing ever read
NodeKind::Dag's fields (only `{ .. }` matches exist), so they are
write-only. Dead reason-only locals deleted; the boot sweep's summary
became a tracing::info! rather than being lost.
Remaining: dashboard/lifecycle_ops 7, server.rs 7, and the test suite —
tests.rs has its own submit() helper whose u64 return is used as the
handle to navigate the inserted DAG, so those need a different way to
find nodes, not a mechanical port.
This commit is contained in:
parent
6f87821110
commit
7c0d9d2379
9 changed files with 198 additions and 301 deletions
|
|
@ -29,9 +29,9 @@
|
|||
|
||||
pub mod exec;
|
||||
pub mod model;
|
||||
pub mod power;
|
||||
pub mod resource;
|
||||
pub mod scheduler;
|
||||
pub mod submit;
|
||||
pub mod templates;
|
||||
#[cfg(test)]
|
||||
mod tests;
|
||||
|
|
@ -208,20 +208,17 @@ impl JobQueue {
|
|||
/// # Errors
|
||||
/// Propagates a graph-insert error (dependencies that aren't
|
||||
/// dependency-topological).
|
||||
pub fn submit(
|
||||
pub fn insert(
|
||||
&self,
|
||||
source: Source,
|
||||
reason: String,
|
||||
declare: impl FnOnce(&JobBuilder),
|
||||
) -> anyhow::Result<u64> {
|
||||
declare: impl FnOnce(&JobBuilder) -> Vec<hive_jobq::NodeGuid>,
|
||||
) -> anyhow::Result<Vec<NodeId>> {
|
||||
let mut inner = self.lock();
|
||||
let container = inner
|
||||
.append(NodeKind::Dag { source, reason }, Vec::new(), None)
|
||||
.map_err(|e| anyhow::anyhow!("job_queue: container insert failed: {e}"))?;
|
||||
insert_group(&mut inner, declare, Some(container))?;
|
||||
let named = inner
|
||||
.insert_job(None, declare)
|
||||
.map_err(|e| anyhow::anyhow!("job_queue: graph insert failed: {e}"))?;
|
||||
drop(inner);
|
||||
self.notify.notify_one();
|
||||
Ok(container.get())
|
||||
Ok(named)
|
||||
}
|
||||
|
||||
/// The scheduler itself, for `hive_jobq`'s run-loop seam
|
||||
|
|
|
|||
Loading…
Reference in a new issue