feat(scheduler-core): implement core event batch push interface (task 4.3)
Defines xce_core_event_type_t/xce_core_event_t (9 event kinds: config, job, worker, resource, resval full/delta, job state change, job update, queue update, job rusage) in core.h. Implements xce_core_push_events() in a new core_events.c (split out of core.c to stay under the 800-line cap): rejects -EBUSY mid-session, otherwise applies each event's core- state mutation and fires the corresponding picker hook synchronously, exactly once per event, before returning. CONFIG_PUSH decomposes the pushed config's embedded queues/resources/resvals via shared helpers (also reused by QUEUE_UPDATE's upsert path), mirroring the existing sched_init_config()/sched_init_resources()/sched_init_sharedInst()/ sched_init_queues(). Narrows sched_resolve_job_picker() to take xce_sched_core_t* (pure type change, zero behavior change). Purely additive — not wired into the live scheduling path yet (task 5.x). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019dw5WnN3DXStaEaPYfACU1
This commit is contained in:
parent
e9b5c3f589
commit
e6c0a2448a
10 changed files with 1613 additions and 43 deletions
|
|
@ -112,21 +112,11 @@ extern int sched_init_config(xce_scheduler_t* sched, xce_conf4sched_t*);
|
|||
* default to sched->job_pick_plugin when unset. See the field comment on
|
||||
* xce_scheduler_t above -- this does NOT resolve/register the name. */
|
||||
extern void sched_set_default_job_pick_plugin(xce_scheduler_t*);
|
||||
/* Req 1 AC 6 / Req 2 AC 5 (scheduler-core spec, task 2.4): resolves
|
||||
* sched->job_pick_plugin against the plugin registry (the same
|
||||
* plugin_register()/key_find() mechanism every other plugin category
|
||||
* uses) and validates the result actually implements the picker MUST
|
||||
* hooks (xce_job_picker_iface_t: next_job, begin_session, end_session,
|
||||
* on_dispatch, on_pend). Returns 0 and sets *out on success; a negative
|
||||
* errno on failure:
|
||||
* -EINVAL bad arguments, or sched->job_pick_plugin is unset (NULL),
|
||||
* or the name IS registered but is not a usable picker
|
||||
* -ENOENT the configured name is not registered at all
|
||||
* Called from sched_init() (before the picker thread is created, so an
|
||||
* unregistered/non-picker name fails scheduler startup synchronously) and
|
||||
* from sched_job_picker() (the picker thread, at thread start) -- one
|
||||
* implementation, two call sites, no duplicated lookup logic. */
|
||||
extern int sched_resolve_job_picker(xce_scheduler_t*, xce_sched_plugin_t**);
|
||||
/* sched_resolve_job_picker relocated to core.h (scheduler-core spec, task
|
||||
* 4.3) -- it now operates on xce_sched_core_t*, not xce_scheduler_t*, so
|
||||
* xce_core_push_events() (core.c) can call it without core.c depending on
|
||||
* this header. Call sites in this file (sched_job_picker(), sched_allocator(),
|
||||
* sched_init()) now pass &sched->core. See core.h for the full contract. */
|
||||
extern int sched_update(xce_scheduler_t*);
|
||||
extern void sched_go(xce_scheduler_t*);
|
||||
extern void sched_begin_session(xce_scheduler_t*);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue