pub struct FlightSqlServerBuilder { /* private fields */ }Implementations§
Source§impl FlightSqlServerBuilder
impl FlightSqlServerBuilder
Sourcepub fn with_view_factory_fn<F, Fut>(self, f: F) -> Selfwhere
F: FnOnce(Arc<RuntimeEnv>, Arc<DataLakeConnection>) -> Fut + Send + 'static,
Fut: Future<Output = Result<ViewFactory>> + Send + 'static,
pub fn with_view_factory_fn<F, Fut>(self, f: F) -> Selfwhere
F: FnOnce(Arc<RuntimeEnv>, Arc<DataLakeConnection>) -> Fut + Send + 'static,
Fut: Future<Output = Result<ViewFactory>> + Send + 'static,
Override the default view factory with a custom closure.
The closure receives the runtime and data lake created by the builder.
Sourcepub fn with_session_configurator(
self,
cfg: Arc<dyn SessionConfigurator>,
) -> Self
pub fn with_session_configurator( self, cfg: Arc<dyn SessionConfigurator>, ) -> Self
Override the default session configurator.
By default the builder loads static tables from MICROMEGAS_STATIC_TABLES_URL.
Use this to replace that behavior entirely.
Sourcepub fn with_auth_provider(self, provider: Arc<dyn AuthProvider>) -> Self
pub fn with_auth_provider(self, provider: Arc<dyn AuthProvider>) -> Self
Set an explicit auth provider.
Sourcepub fn with_read_policy(self, policy: Arc<dyn ReadPolicy>) -> Self
pub fn with_read_policy(self, policy: Arc<dyn ReadPolicy>) -> Self
Set an explicit ReadPolicy, resolved once per request against the caller’s
AuthContext. This policy wins on every build_and_serve branch,
overriding that branch’s own default. When never called, the default depends on how auth
is configured: with with_default_auth() or with_auth_provider(..),
AudienceReadPolicy::default() backed by the DB grant store (so the seeded public
read row still resolves); with auth left disabled, AudienceReadPolicy with an empty
grant map, though that branch never actually resolves it. Not ReadScope::All: the
absent-AuthContext-extension convention already supplies All when no provider is
configured, so this default must not duplicate
that decision – it only ever resolves a scope when an AuthContext is present to resolve
one from.
Sourcepub fn with_isolation_config(self, config: Arc<IsolationConfig>) -> Self
pub fn with_isolation_config(self, config: Arc<IsolationConfig>) -> Self
Set an explicit IsolationConfig – the data-isolation deployment knob
(MICROMEGAS_PUBLIC_VIEW_SETS) consumed by the row-level filter
(OwnershipRewrite). Mirrors with_read_policy: wins regardless of how auth is
configured, overriding the single default build_and_serve would otherwise resolve via
IsolationConfig::from_env().
Sourcepub fn with_default_auth(self) -> Self
pub fn with_default_auth(self) -> Self
Use the default auth provider from env vars during build.
Errors if no auth providers are configured (fail-fast).
Sourcepub fn with_max_decoding_message_size(self, bytes: usize) -> Self
pub fn with_max_decoding_message_size(self, bytes: usize) -> Self
Set the max decoding message size (default: 100 MB).
Sourcepub fn with_listen_addr(self, addr: SocketAddr) -> Self
pub fn with_listen_addr(self, addr: SocketAddr) -> Self
Set the listen address (default: DEFAULT_FLIGHTSQL_LISTEN_ADDR, 0.0.0.0:50051).
Sourcepub fn with_shutdown_grace(self, grace: Duration) -> Self
pub fn with_shutdown_grace(self, grace: Duration) -> Self
Set the grace period for graceful shutdown on SIGTERM (default: 25s).
Sourcepub fn with_lakehouse(self, lakehouse: Arc<LakehouseContext>) -> Self
pub fn with_lakehouse(self, lakehouse: Arc<LakehouseContext>) -> Self
Inject a pre-built LakehouseContext instead of calling LakehouseContext::from_env.
Useful for the monolith, which constructs one shared context for all lake-backed roles.
Sourcepub fn with_shutdown(
self,
shutdown: impl Future<Output = ()> + Send + 'static,
) -> Self
pub fn with_shutdown( self, shutdown: impl Future<Output = ()> + Send + 'static, ) -> Self
Inject a custom shutdown future instead of the default wait_for_sigterm().
The monolith passes fanout.subscribe() here so all roles shut down from one signal.
Sourcepub fn with_health_addr(self, addr: SocketAddr) -> Self
pub fn with_health_addr(self, addr: SocketAddr) -> Self
Spawn a lightweight HTTP sidecar (/health, /ready) on addr.
Enables plain-HTTP ALB health checks without changing the gRPC protocol. If not set, no sidecar is started.
Sourcepub async fn build_and_serve(self) -> Result<()>
pub async fn build_and_serve(self) -> Result<()>
Build and run the FlightSQL server.
Runs the full setup sequence and blocks until the server shuts down.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for FlightSqlServerBuilder
impl !Sync for FlightSqlServerBuilder
impl !UnwindSafe for FlightSqlServerBuilder
impl Freeze for FlightSqlServerBuilder
impl Send for FlightSqlServerBuilder
impl Unpin for FlightSqlServerBuilder
impl UnsafeUnpin for FlightSqlServerBuilder
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].