pub trait RuntimeController: Send + Sync {
// Required methods
fn controller_id(&self) -> &ControllerId;
fn invoke(&self, task: &NodeTask) -> Result<NodeResult, DagMlError>;
// Provided methods
fn export_artifact_payload(
&self,
_artifact_id: &ArtifactId,
) -> Result<Option<Vec<u8>>, DagMlError> { ... }
fn hydrate_artifact_payload(
&self,
_request: &ArtifactMaterializationRequest,
_payload: &[u8],
) -> Result<HandleRef, DagMlError> { ... }
fn release_hydrated_artifact_payload(
&self,
_handle: &HandleRef,
) -> Result<(), DagMlError> { ... }
fn invoke_with_data_provider(
&self,
task: &NodeTask,
_data_provider: &dyn RuntimeDataProvider,
) -> Result<NodeResult, DagMlError> { ... }
fn create_tuner_session(
&self,
task: &RuntimeHpoCampaignTask,
_context: &RuntimeHpoExecutionContext,
) -> Result<Box<dyn RuntimeTunerSession>, DagMlError> { ... }
fn invoke_aggregation(
&self,
task: &AggregationControllerTask,
) -> Result<AggregationControllerResult, DagMlError> { ... }
}Required Methods§
fn controller_id(&self) -> &ControllerId
fn invoke(&self, task: &NodeTask) -> Result<NodeResult, DagMlError>
Provided Methods§
Sourcefn export_artifact_payload(
&self,
_artifact_id: &ArtifactId,
) -> Result<Option<Vec<u8>>, DagMlError>
fn export_artifact_payload( &self, _artifact_id: &ArtifactId, ) -> Result<Option<Vec<u8>>, DagMlError>
Export a raw, portable artifact payload after REFIT. The scheduler immediately transfers this into the durable bundle; implementations must not rely on the returned handle surviving a process boundary.
Sourcefn hydrate_artifact_payload(
&self,
_request: &ArtifactMaterializationRequest,
_payload: &[u8],
) -> Result<HandleRef, DagMlError>
fn hydrate_artifact_payload( &self, _request: &ArtifactMaterializationRequest, _payload: &[u8], ) -> Result<HandleRef, DagMlError>
Materialize a durable raw artifact payload in this controller’s fresh process-local runtime. The payload is owned by the bundle; the returned handle is deliberately ephemeral and is only valid for the current replay invocation. Controllers that do not publish raw portable artifacts keep the default fail-closed implementation.
Sourcefn release_hydrated_artifact_payload(
&self,
_handle: &HandleRef,
) -> Result<(), DagMlError>
fn release_hydrated_artifact_payload( &self, _handle: &HandleRef, ) -> Result<(), DagMlError>
Release an invocation-local handle previously returned by
Self::hydrate_artifact_payload. Replay calls this exactly once when
execution finishes or aborts; implementations must accept a handle
that the controller already consumed during successful invocation.
Sourcefn invoke_with_data_provider(
&self,
task: &NodeTask,
_data_provider: &dyn RuntimeDataProvider,
) -> Result<NodeResult, DagMlError>
fn invoke_with_data_provider( &self, task: &NodeTask, _data_provider: &dyn RuntimeDataProvider, ) -> Result<NodeResult, DagMlError>
Provider-aware execution is opt-in. Existing controllers retain the opaque-handle path; native Methods controllers can only receive the narrow provider capability above when the scheduler has one.
Sourcefn create_tuner_session(
&self,
task: &RuntimeHpoCampaignTask,
_context: &RuntimeHpoExecutionContext,
) -> Result<Box<dyn RuntimeTunerSession>, DagMlError>
fn create_tuner_session( &self, task: &RuntimeHpoCampaignTask, _context: &RuntimeHpoExecutionContext, ) -> Result<Box<dyn RuntimeTunerSession>, DagMlError>
Create an execution-local tuner session for one scheduler-owned HPO
campaign. The controller stays Send + Sync because it is only a
factory; the returned session has no Send/Sync bound and may therefore
own a thread-affine native context and optimizer. The scheduler keeps
this session on its calling thread and passes only portable proposal and
evaluation values across the controller boundary.
fn invoke_aggregation( &self, task: &AggregationControllerTask, ) -> Result<AggregationControllerResult, DagMlError>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".