Skip to main content

RequestForwarder

Trait RequestForwarder 

Source
pub trait RequestForwarder:
    Send
    + Sync
    + 'static {
    // Required method
    fn execute_forwarded(
        &self,
        req: ForwardRequest,
    ) -> impl Future<Output = ForwardResponse> + Send;
}
Expand description

Trait for executing forwarded SQL queries on the local Data Plane.

Implemented by the main binary crate using SharedState + QueryContext. The cluster RPC handler calls this when it receives a ForwardRequest.

Required Methods§

Source

fn execute_forwarded( &self, req: ForwardRequest, ) -> impl Future<Output = ForwardResponse> + Send

Execute a forwarded SQL query locally and return the result.

The implementation should:

  1. Create a synthetic identity from the tenant_id (trusted node-to-node)
  2. Plan the SQL through DataFusion
  3. Dispatch to the local Data Plane
  4. Collect response payloads
  5. Return them in a ForwardResponse

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§