pub struct KvSchema { /* private fields */ }Implementations§
Source§impl KvSchema
impl KvSchema
pub fn new(client: StoreClient) -> Self
pub fn table( self, name: impl Into<String>, columns: Vec<TableColumnConfig>, primary_key_columns: Vec<String>, index_specs: Vec<IndexSpec>, ) -> Result<Self, String>
pub fn orders_table( self, table_name: impl Into<String>, index_specs: Vec<IndexSpec>, ) -> Result<Self, String>
Sourcepub fn table_versioned(
self,
name: impl Into<String>,
columns: Vec<TableColumnConfig>,
entity_column: impl Into<String>,
version_column: impl Into<String>,
index_specs: Vec<IndexSpec>,
) -> Result<Self, String>
pub fn table_versioned( self, name: impl Into<String>, columns: Vec<TableColumnConfig>, entity_column: impl Into<String>, version_column: impl Into<String>, index_specs: Vec<IndexSpec>, ) -> Result<Self, String>
Create a table with a versioned composite primary key.
The entity column and version column (UInt64) together form the
composite primary key. The entity can be any supported primary-key
type, including variable-length logical keys encoded through the
crate’s ordered variable-length Utf8 mapping.
Versions sort
numerically via big-endian encoding, so a reverse range scan
from (entity, V) downward with LIMIT 1 yields the latest
version <= V. See examples/versioned_kv.rs for the basic
query pattern plus an immutable-friendly companion watermark
table pattern for out-of-order batch uploads.
pub fn table_count(&self) -> usize
pub fn register_all(self, ctx: &SessionContext) -> DataFusionResult<()>
pub fn batch_writer(&self) -> BatchWriter
Sourcepub async fn backfill_added_indexes(
&self,
table_name: &str,
previous_index_specs: &[IndexSpec],
) -> DataFusionResult<IndexBackfillReport>
pub async fn backfill_added_indexes( &self, table_name: &str, previous_index_specs: &[IndexSpec], ) -> DataFusionResult<IndexBackfillReport>
Backfill secondary index entries after adding new index specs.
previous_index_specs must represent the index list used when existing
rows were written. The current schema’s index list must be an append-only
extension of that list (same order/layout for existing indexes, with new
indexes only added at the tail).
Operational ordering requirement: start writing new rows with the new index specs before backfilling historical rows, or rows written during the backfill window may be missing from the new index.
Sourcepub async fn backfill_added_indexes_with_options(
&self,
table_name: &str,
previous_index_specs: &[IndexSpec],
options: IndexBackfillOptions,
) -> DataFusionResult<IndexBackfillReport>
pub async fn backfill_added_indexes_with_options( &self, table_name: &str, previous_index_specs: &[IndexSpec], options: IndexBackfillOptions, ) -> DataFusionResult<IndexBackfillReport>
Backfill secondary index entries after adding new index specs, with configurable row page size for the full-scan read.
Sourcepub async fn backfill_added_indexes_with_options_and_progress(
&self,
table_name: &str,
previous_index_specs: &[IndexSpec],
options: IndexBackfillOptions,
progress_tx: Option<&UnboundedSender<IndexBackfillEvent>>,
) -> DataFusionResult<IndexBackfillReport>
pub async fn backfill_added_indexes_with_options_and_progress( &self, table_name: &str, previous_index_specs: &[IndexSpec], options: IndexBackfillOptions, progress_tx: Option<&UnboundedSender<IndexBackfillEvent>>, ) -> DataFusionResult<IndexBackfillReport>
Backfill secondary index entries after adding new index specs, with configurable row page size for the full-scan read and an optional progress event channel.
Progress events are emitted only after buffered ingest writes for the
reported cursor are flushed, so Progress.next_cursor can be persisted
and used to resume later.
Auto Trait Implementations§
impl !Freeze for KvSchema
impl !RefUnwindSafe for KvSchema
impl Send for KvSchema
impl Sync for KvSchema
impl Unpin for KvSchema
impl UnsafeUnpin for KvSchema
impl !UnwindSafe for KvSchema
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
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 more