Skip to main content

Compute

Trait Compute 

Source
pub trait Compute: Send + Sync {
    // Required methods
    fn manifest(&self) -> &TransformManifest;
    fn run(&self, inputs: &[RecordBatch]) -> Result<RecordBatch, ComputeError>;
}
Expand description

A loaded, ready-to-invoke transform. Cheap to call per batch (any expensive setup happened in TransformBackend::load). Send + Sync so it can be shared across partition workers.

Required Methods§

Source

fn manifest(&self) -> &TransformManifest

The manifest this compute was loaded from.

Source

fn run(&self, inputs: &[RecordBatch]) -> Result<RecordBatch, ComputeError>

Transform one set of input batches into one output batch (batch-vectorized). The number of input batches matches manifest().inputs. Returns ComputeError to fail closed — governance wraps this; the compute never touches the write path.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§