pub struct Worker {
pub id: WorkerId,
pub capabilities: Capabilities,
/* private fields */
}Expand description
Worker state: manages execution of plans received from a coordinator.
Fields§
§id: WorkerId§capabilities: CapabilitiesImplementations§
Source§impl Worker
impl Worker
pub fn new(id: impl Into<String>, capabilities: Capabilities) -> Self
Sourcepub fn with_cache(self, cache: Arc<dyn CacheStore>) -> Self
pub fn with_cache(self, cache: Arc<dyn CacheStore>) -> Self
Set a custom cache store (e.g. tiered or shared).
Sourcepub fn with_data_store(self, store: Arc<dyn DataStore>) -> Self
pub fn with_data_store(self, store: Arc<dyn DataStore>) -> Self
Set a persistent DataStore (S3, Zarr, etc.) for large data references.
Sourcepub fn with_temp_dir(self, path: PathBuf) -> Self
pub fn with_temp_dir(self, path: PathBuf) -> Self
Set a custom temp directory for HTTP bulk uploads.
Sourcepub fn temp_store(&self) -> &Arc<LocalDataStore>
pub fn temp_store(&self) -> &Arc<LocalDataStore>
Get the temp store (for HTTP upload endpoint).
Sourcepub fn register_filter(
&mut self,
node_id: impl Into<String>,
filter: Box<dyn Filter>,
)
pub fn register_filter( &mut self, node_id: impl Into<String>, filter: Box<dyn Filter>, )
Register a filter that this worker can execute.
Sourcepub fn get_filter(&self, node_id: &str) -> Option<Arc<dyn Filter>>
pub fn get_filter(&self, node_id: &str) -> Option<Arc<dyn Filter>>
Get a filter by node_id (for stream executor construction).
Sourcepub fn get_filter_state(&self, node_id: &str) -> Value
pub fn get_filter_state(&self, node_id: &str) -> Value
Get trained state for a filter.
Sourcepub fn set_filter_state(&mut self, node_id: &str, state: Value)
pub fn set_filter_state(&mut self, node_id: &str, state: Value)
Set trained state for a filter.
Sourcepub fn wrap_output(&self, output: Value) -> OutputDelivery
pub fn wrap_output(&self, output: Value) -> OutputDelivery
Wrap output in the right delivery: inline for small, DataRef for large.
Sourcepub fn registration_message(&self) -> WorkerToCoordinator
pub fn registration_message(&self) -> WorkerToCoordinator
Build a registration message.
Sourcepub fn execute_plan(&mut self, plan: &SerializedPlan) -> PlanResult
pub fn execute_plan(&mut self, plan: &SerializedPlan) -> PlanResult
Execute a serialized plan.
If the plan contains serialized filter definitions, they are registered temporarily for this execution (alongside any pre-registered filters).
In Fit mode: fits each filter (topological order), stores trained states, then forwards to propagate outputs. Returns states so the client can cache them.
In Forward mode: executes the compiled plan directly.
Sourcepub fn matches_target(&self, target: &RemoteTarget) -> bool
pub fn matches_target(&self, target: &RemoteTarget) -> bool
Check if this worker matches a remote target.
Auto Trait Implementations§
impl Freeze for Worker
impl !RefUnwindSafe for Worker
impl Send for Worker
impl Sync for Worker
impl Unpin for Worker
impl UnsafeUnpin for Worker
impl !UnwindSafe for Worker
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more