Skip to main content

ParallelWorkers

Trait ParallelWorkers 

Source
pub trait ParallelWorkers:
    WorkerTransfers
    + ObjectBlockOps
    + Send
    + Sync {
    // Required methods
    fn export_metadata(&self) -> Result<Vec<SerializedLayoutResponse>>;
    fn import_metadata(
        &self,
        metadata: Vec<SerializedLayout>,
    ) -> Result<Vec<ImportMetadataResponse>>;
    fn worker_count(&self) -> usize;
    fn workers(&self) -> &[Arc<dyn Worker>];
}
Expand description

A cohort of parallel workers.

This trait is used to drive one or more parallel workers.

Required Methods§

Source

fn export_metadata(&self) -> Result<Vec<SerializedLayoutResponse>>

Export the local metadata for a set of workers.

Layouts will be returned in rank order.

§Returns

A kvbm_physical::manager::SerializedLayout containing the local metadata

Source

fn import_metadata( &self, metadata: Vec<SerializedLayout>, ) -> Result<Vec<ImportMetadataResponse>>

Import the remote metadata for this worker.

Handles will be returned in rank order.

§Arguments
§Returns

A vector of kvbm_physical::manager::LayoutHandle for the imported remote layouts

Source

fn worker_count(&self) -> usize

Get the number of workers.

Source

fn workers(&self) -> &[Arc<dyn Worker>]

Get access to the underlying workers for metadata/handle queries.

This is useful for operations that need to query individual workers (e.g., collecting layout handles) without executing transfers.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§