Skip to main content

SplitPlanner

Trait SplitPlanner 

Source
pub trait SplitPlanner: Send {
    // Required methods
    fn fingerprint(&self) -> String;
    fn plan(
        &mut self,
        ctx: PlanContext<'_>,
    ) -> Result<SplitPlan, CoordinationError>;
}
Expand description

Source-provided work enumerator, run only on the fleet’s elected leader, at job start and again on the replan interval while the plan is Open.

Every worker presents an equivalent planner at SplitCoordinator::start; whichever instance holds leadership uses its own copy. plan may block on I/O (an object-store LIST, an index query), so backends call it off their async loop.

Required Methods§

Source

fn fingerprint(&self) -> String

Cheap, deterministic job identity, derived from configuration, never from the enumeration itself. Every worker joining the job must present a byte-equal fingerprint or be rejected as Fatal, so divergent configurations cannot interpret the same split table two ways.

Source

fn plan(&mut self, ctx: PlanContext<'_>) -> Result<SplitPlan, CoordinationError>

Enumerate the current work. Idempotency contract: unchanged work yields the same SplitIds, so re-emitting already-planned splits is a cheap store-side no-op.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§