StateStore

Trait StateStore 

Source
pub trait StateStore: Send + Sync {
    // Required methods
    fn load_state<'life0, 'life1, 'async_trait>(
        &'life0 self,
        partition: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = AnalyzerResult<StateMap>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn save_state<'life0, 'life1, 'async_trait>(
        &'life0 self,
        partition: &'life1 str,
        state: StateMap,
    ) -> Pin<Box<dyn Future<Output = AnalyzerResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn list_partitions<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = AnalyzerResult<Vec<String>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn delete_partition<'life0, 'life1, 'async_trait>(
        &'life0 self,
        partition: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = AnalyzerResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;

    // Provided method
    fn load_states_batch<'life0, 'life1, 'async_trait>(
        &'life0 self,
        partitions: &'life1 [String],
    ) -> Pin<Box<dyn Future<Output = AnalyzerResult<HashMap<String, StateMap>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
}
Expand description

Trait for storing and retrieving analyzer states.

Implementations handle persistence of intermediate computation states, enabling incremental analysis across data partitions.

Required Methods§

Source

fn load_state<'life0, 'life1, 'async_trait>( &'life0 self, partition: &'life1 str, ) -> Pin<Box<dyn Future<Output = AnalyzerResult<StateMap>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Loads the state for a specific partition.

§Arguments
  • partition - The partition identifier (e.g., “2024-01-15”)
§Returns

A map of analyzer names to their serialized states

Source

fn save_state<'life0, 'life1, 'async_trait>( &'life0 self, partition: &'life1 str, state: StateMap, ) -> Pin<Box<dyn Future<Output = AnalyzerResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Saves the state for a specific partition.

§Arguments
  • partition - The partition identifier
  • state - Map of analyzer names to serialized states
Source

fn list_partitions<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = AnalyzerResult<Vec<String>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Lists all known partitions.

§Returns

Vector of partition identifiers ordered by name

Source

fn delete_partition<'life0, 'life1, 'async_trait>( &'life0 self, partition: &'life1 str, ) -> Pin<Box<dyn Future<Output = AnalyzerResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Deletes the state for a specific partition.

§Arguments
  • partition - The partition identifier to delete

Provided Methods§

Source

fn load_states_batch<'life0, 'life1, 'async_trait>( &'life0 self, partitions: &'life1 [String], ) -> Pin<Box<dyn Future<Output = AnalyzerResult<HashMap<String, StateMap>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Loads states for multiple partitions.

§Arguments
  • partitions - List of partition identifiers
§Returns

Map of partition names to their state maps

Implementors§