pub struct MemWalIndexDetails {
pub snapshot_ts_millis: i64,
pub num_shards: u32,
pub inline_snapshots: Option<Vec<u8>>,
pub sharding_specs: Vec<ShardingSpec>,
pub maintained_indexes: Vec<String>,
pub merged_generations: Vec<MergedGeneration>,
pub index_catchup: Vec<IndexCatchupProgress>,
pub writer_config_defaults: HashMap<String, String>,
}Expand description
Index details for MemWAL Index, stored in IndexMetadata.index_details. This is the centralized structure for all MemWAL metadata:
- Configuration (sharding specs, indexes to maintain)
- Merge progress (merged generations per shard)
- Shard state snapshots
Writers read this index to get configuration before writing. Readers may use shard snapshots in this index as a point-in-time optimization. Readers that need the latest shard set should list shard directories in storage and read each shard’s latest manifest. A background process updates the index periodically to keep shard snapshots current.
Shard snapshots are stored as a Lance file with one row per shard. The schema records shard discovery fields. Full mutable shard state remains authoritative in the shard manifest files. shard_id: utf8 shard_spec_id: uint32 shard_field_{field_id}: typed per the matching ShardingField.result_type
Fields§
§snapshot_ts_millis: i64Snapshot timestamp (Unix timestamp in milliseconds).
num_shards: u32Number of shards in the snapshot. Used to determine storage format without reading the snapshot data.
inline_snapshots: Option<Vec<u8>>Inline shard snapshots for small shard counts. When num_shards <= threshold (implementation-defined, e.g., 100), snapshots are stored inline as serialized bytes. Format: Lance file bytes with the shard snapshot schema.
sharding_specs: Vec<ShardingSpec>Sharding specs defining how to derive shard identifiers. This configuration determines how rows are partitioned into shards.
maintained_indexes: Vec<String>Indexes from the base table to maintain in MemTables. These are index names referencing indexes defined on the base table. The primary key btree index is always maintained implicitly and should not be listed here.
For vector indexes, MemTables inherit quantization parameters (PQ codebook, SQ params) from the base table index to ensure distance comparability.
merged_generations: Vec<MergedGeneration>Last generation merged to base table for each shard. This is updated atomically with merge-insert data commits, enabling conflict resolution when multiple mergers operate concurrently.
Note: This is separate from shard snapshots because:
- merged_generations is updated by mergers (atomic with data commit)
- shard snapshots are updated by background index builder
index_catchup: Vec<IndexCatchupProgress>Per-index catchup progress tracking. When data is merged to the base table, base table indexes are rebuilt asynchronously. This field tracks which generation each index covers.
For indexed queries, if an index’s caught_up_generation < merged_generation, readers should use flushed MemTable indexes for the gap instead of scanning unindexed data in the base table.
If an index is not present in this list, it is assumed to be fully caught up.
writer_config_defaults: HashMap<String, String>Default ShardWriter configuration values for this MemWAL index.
A free-form string map persisted so that every writer — across processes and restarts — starts from the same default writer configuration. These are defaults only: an individual writer may still override any value at runtime in its own ShardWriterConfig (which is not persisted).
Implementations§
Source§impl MemWalIndexDetails
impl MemWalIndexDetails
Sourcepub fn inline_snapshots(&self) -> &[u8] ⓘ
pub fn inline_snapshots(&self) -> &[u8] ⓘ
Returns the value of inline_snapshots, or the default value if inline_snapshots is unset.
Trait Implementations§
Source§impl Clone for MemWalIndexDetails
impl Clone for MemWalIndexDetails
Source§fn clone(&self) -> MemWalIndexDetails
fn clone(&self) -> MemWalIndexDetails
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MemWalIndexDetails
impl Debug for MemWalIndexDetails
Source§impl Default for MemWalIndexDetails
impl Default for MemWalIndexDetails
Source§impl Message for MemWalIndexDetails
impl Message for MemWalIndexDetails
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self.Source§impl Name for MemWalIndexDetails
impl Name for MemWalIndexDetails
Source§const NAME: &'static str = "MemWalIndexDetails"
const NAME: &'static str = "MemWalIndexDetails"
Message.
This name is the same as it appears in the source .proto file, e.g. FooBar.Source§const PACKAGE: &'static str = "lance.table"
const PACKAGE: &'static str = "lance.table"
., e.g. google.protobuf.Source§fn full_name() -> String
fn full_name() -> String
Message.
It’s prefixed with the package name and names of any parent messages,
e.g. google.rpc.BadRequest.FieldViolation.
By default, this is the package name followed by the message name.
Fully-qualified names must be unique within a domain of Type URLs.Source§impl PartialEq for MemWalIndexDetails
impl PartialEq for MemWalIndexDetails
Source§fn eq(&self, other: &MemWalIndexDetails) -> bool
fn eq(&self, other: &MemWalIndexDetails) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for MemWalIndexDetails
Auto Trait Implementations§
impl Freeze for MemWalIndexDetails
impl RefUnwindSafe for MemWalIndexDetails
impl Send for MemWalIndexDetails
impl Sync for MemWalIndexDetails
impl Unpin for MemWalIndexDetails
impl UnsafeUnpin for MemWalIndexDetails
impl UnwindSafe for MemWalIndexDetails
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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