pub struct MeterStoreBuilder { /* private fields */ }Expand description
Builder for MeterStore.
Implementations§
Source§impl MeterStoreBuilder
impl MeterStoreBuilder
Sourcepub fn cold(
self,
cold: Arc<dyn ColdStore>,
provider: Arc<dyn TableProvider>,
) -> Self
pub fn cold( self, cold: Arc<dyn ColdStore>, provider: Arc<dyn TableProvider>, ) -> Self
The cold tier, and its DataFusion provider.
Both are needed and they are not interchangeable: the store reads the
watermark through ColdStore, and scans through the provider.
Sourcepub fn table(self, config: ValidatedTableConfig) -> Self
pub fn table(self, config: ValidatedTableConfig) -> Self
The table configuration.
Sourcepub fn table_name(&self) -> Option<&str>
pub fn table_name(&self) -> Option<&str>
The configured table name, before the store is built.
Lets a MeterCatalog detect a duplicate before
registering anything, so the error names the mistake rather than
surfacing as DataFusion’s “table already exists” from inside a builder
the caller did not know was being run.
Sourcepub fn registered_names(&self) -> Option<(String, String)>
pub fn registered_names(&self) -> Option<(String, String)>
The SQL names this builder will register: the raw relation, then the resolved one.
Not the same thing as the configured name, and the difference is what
makes a naive uniqueness check wrong. §13.7.2 derives both from the
physical name by adding or stripping _versions, so readings and
readings_versions are two configurations that register exactly the same
pair. register_as overrides the second, which is a third way for two
tables to collide.
Sourcepub fn row_scope(self, scope: Vec<(String, ScalarValue)>) -> Self
pub fn row_scope(self, scope: Vec<(String, ScalarValue)>) -> Self
Confine every query in this session to rows matching an identity equality.
See MeterStore::scoped, which validates the column and is the
supported way to reach this.
Sourcepub fn session(self, ctx: SessionContext) -> Self
pub fn session(self, ctx: SessionContext) -> Self
Build into an existing DataFusion session instead of a fresh one.
This is what lets several tables share a catalog, and therefore what
makes a join across them expressible — see MeterCatalog, which is the
supported way to reach it. Each table keeps its own watermark, archiver
and lease (§15.3); only the query surface is shared.
Sourcepub fn subject_registry(self, registry: SubjectRegistry) -> Self
pub fn subject_registry(self, registry: SubjectRegistry) -> Self
The registry backing this table’s subject column.
Required whenever the configuration declares a
subject_column:
without it, writes carry references that nothing can resolve and erasure
has no mapping to destroy — the column would be decoration.
Sourcepub fn register_as(self, name: impl Into<String>) -> Self
pub fn register_as(self, name: impl Into<String>) -> Self
Override the name the table is registered under.
Sourcepub async fn build(self) -> Result<MeterStore>
pub async fn build(self) -> Result<MeterStore>
Assemble the store.
Async because the resolved table is planned from its SQL at build time.
Trait Implementations§
Source§impl Default for MeterStoreBuilder
impl Default for MeterStoreBuilder
Source§fn default() -> MeterStoreBuilder
fn default() -> MeterStoreBuilder
Auto Trait Implementations§
impl !RefUnwindSafe for MeterStoreBuilder
impl !UnwindSafe for MeterStoreBuilder
impl Freeze for MeterStoreBuilder
impl Send for MeterStoreBuilder
impl Sync for MeterStoreBuilder
impl Unpin for MeterStoreBuilder
impl UnsafeUnpin for MeterStoreBuilder
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
Source§impl<T> Downcast for T
impl<T> Downcast for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> 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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request