Skip to main content

DatasetMemWalExt

Trait DatasetMemWalExt 

Source
pub trait DatasetMemWalExt {
    // Required methods
    fn initialize_mem_wal<'life0, 'async_trait>(
        &'life0 mut self,
        config: MemWalConfig,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn mem_wal_writer<'life0, 'async_trait>(
        &'life0 self,
        region_id: Uuid,
        config: RegionWriterConfig,
    ) -> Pin<Box<dyn Future<Output = Result<RegionWriter>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Extension trait for Dataset to support MemWAL operations.

Required Methods§

Source

fn initialize_mem_wal<'life0, 'async_trait>( &'life0 mut self, config: MemWalConfig, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Initialize MemWAL on this dataset.

Creates the MemWalIndex system index with the given configuration. All indexes in maintained_indexes must already exist on the dataset.

§Example
let mut dataset = Dataset::open("s3://bucket/dataset").await?;
dataset.initialize_mem_wal(MemWalConfig {
    region_specs: vec![],
    maintained_indexes: vec!["id_btree".to_string()],
}).await?;
Source

fn mem_wal_writer<'life0, 'async_trait>( &'life0 self, region_id: Uuid, config: RegionWriterConfig, ) -> Pin<Box<dyn Future<Output = Result<RegionWriter>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get a RegionWriter for the specified region.

Automatically loads index configurations from the MemWalIndex and creates the appropriate in-memory indexes.

§Arguments
  • region_id - UUID identifying this region
  • config - Writer configuration (durability, buffer sizes, etc.)
§Example
let writer = dataset.mem_wal_writer(
    Uuid::new_v4(),
    RegionWriterConfig::default(),
).await?;
writer.put(vec![batch1, batch2]).await?;

Implementors§