feat(scheduler-allocator-runner): declare the allocator plugin contract (task 1.2)
xce_sched_allocator_iface_t (optional accepts guard + plan_init/next/fini) and the sched_allocator_run() entry point in sched/alloc_iter.h; the plugin's const allocator_iface reference, forward-declared in plugin.h with the picker_iface ownership rule. No plugin uses them yet. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
86ee3491dd
commit
31ad79d325
4 changed files with 54 additions and 3 deletions
|
|
@ -60,6 +60,12 @@ typedef struct {
|
|||
* -- same idiom as cluster_t across myconf.h/persist.h/ha.h/cluster_def.h. */
|
||||
typedef struct xce_job_picker_iface_s xce_job_picker_iface_t;
|
||||
|
||||
/* Forward declaration -- xce_sched_allocator_iface_t (the allocator plugin
|
||||
* contract, scheduler-allocator-runner Req 1.2) is fully defined in
|
||||
* sched/alloc_iter.h, next to the plan-iterator contract it wraps. Only
|
||||
* needed here as a pointer field on xce_sched_plugin_t. */
|
||||
typedef struct xce_sched_allocator_iface_s xce_sched_allocator_iface_t;
|
||||
|
||||
/* xce_sched_core_t is defined in core.h -- forward-declared here (re-declared
|
||||
* again, harmlessly, near plugin_register_core()'s own declaration below)
|
||||
* so plugin_begin_session()/plugin_end_session() can be declared against it
|
||||
|
|
@ -86,6 +92,12 @@ typedef struct {
|
|||
* job_elect_fn"). Stays NULL for plugin categories that are neither
|
||||
* (allocator/limit plugins never set job_elect_fn). */
|
||||
xce_job_picker_iface_t* picker_iface;
|
||||
/* Allocator plugin registration category (scheduler-allocator-runner
|
||||
* Req 1.2 / 1.6): the plugin's allocator contract. Same ownership as
|
||||
* picker_iface -- static storage owned by the plugin file (a `static
|
||||
* const` object there), copied by pointer on registration and never
|
||||
* freed by the registry. NULL for non-allocator plugins. */
|
||||
const xce_sched_allocator_iface_t* allocator_iface;
|
||||
/* scheduler-sim-live-allocation spec, task 1.2 ("Plugin Hook
|
||||
* Dispatchers" / "Limit Plugin Core-Safe Matching"): an honestly-typed
|
||||
* reference to the shared core state, set by BOTH plugin_register()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue