pub struct TableStore { /* private fields */ }Expand description
Opaque handle to the shared table storage.
External crates receive this capability via
DatabaseScanner::table_store(). The raw storage map is not
part of the public API.
§Table-store invariants (TS-*)
- TS-1 (opaque capability): External crates do not receive
the raw
Arc<StdMutex<HashMap<...>>>. - TS-2 (behavior parity):
TableStore::ingest_batchpreserves existing ingestion semantics (ID-1 through ID-6). - TS-3 (read capability minimality):
table_namesandtable_providerexpose only what downstream query setup needs. Callers receiveArc<dyn TableProvider>, not the backingMemTable. - TS-4 (ownership preserved): Storage ownership remains in
monarch_distributed_telemetry.TableStoreis a handle, not an independent store.
Implementations§
Source§impl TableStore
impl TableStore
Sourcepub fn new_empty() -> Self
pub fn new_empty() -> Self
Create an empty standalone table store.
Useful for testing or standalone ingestion scenarios where
the full DatabaseScanner lifecycle is not needed.
Sourcepub async fn ingest_batch(
&self,
table_name: &str,
batch: RecordBatch,
) -> Result<()>
pub async fn ingest_batch( &self, table_name: &str, batch: RecordBatch, ) -> Result<()>
Ingest a RecordBatch into a named table (TS-2).
Async so callers in async contexts can await directly without
hitting the block_in_place bridge in push_batch_to_tables.
See the ID-* invariants on
DatabaseScanner::push_batch_to_tables for behavioral
guarantees (this method preserves the same semantics).
Sourcepub fn table_names(&self) -> Result<Vec<String>>
pub fn table_names(&self) -> Result<Vec<String>>
Return sorted table names currently in storage (TS-3).
Sourcepub fn table_provider(
&self,
table_name: &str,
) -> Result<Option<Arc<dyn TableProvider>>>
pub fn table_provider( &self, table_name: &str, ) -> Result<Option<Arc<dyn TableProvider>>>
Return a [TableProvider] for a named table, or None if
the table does not exist (TS-3).
The returned provider can be registered directly with a
DataFusion SessionContext. Callers do not see the backing
storage type.
Trait Implementations§
Source§impl Clone for TableStore
impl Clone for TableStore
Source§fn clone(&self) -> TableStore
fn clone(&self) -> TableStore
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for TableStore
impl RefUnwindSafe for TableStore
impl Send for TableStore
impl Sync for TableStore
impl Unpin for TableStore
impl UnwindSafe for TableStore
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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>
Source§impl<A, M> Handler<IndexedErasedUnbound<M>> for A
impl<A, M> Handler<IndexedErasedUnbound<M>> for A
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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 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].