pub trait IndexBackendPlugin: Send + Sync {
// Required methods
fn create_indexes<'life0, 'life1, 'async_trait>(
&'life0 self,
query_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<CreatedIndexes, IndexError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn is_volatile(&self) -> bool;
}Expand description
Index backend plugin trait for implementing storage backends Plugin trait for external index storage backends.
Each storage backend (RocksDB, Garnet, etc.) implements this trait to provide all index types needed for query evaluation from a single shared backend instance.
§Thread Safety
Implementations must be Send + Sync to allow use across async tasks.
§Example
use drasi_core::interface::{CreatedIndexes, IndexBackendPlugin, IndexError};
pub struct MyIndexProvider {
// configuration fields
}
#[async_trait]
impl IndexBackendPlugin for MyIndexProvider {
async fn create_indexes(&self, query_id: &str) -> Result<CreatedIndexes, IndexError> {
// Create and return all indexes (and an optional checkpoint store)
// from a shared backend instance
}
fn is_volatile(&self) -> bool { false }
}Required Methods§
Sourcefn create_indexes<'life0, 'life1, 'async_trait>(
&'life0 self,
query_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<CreatedIndexes, IndexError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn create_indexes<'life0, 'life1, 'async_trait>(
&'life0 self,
query_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<CreatedIndexes, IndexError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Create all indexes (and an optional checkpoint store) for a query from a single shared backend instance.
This method creates the element index, archive index, result index, future queue, and session control backed by a shared storage resource (e.g., a single RocksDB database or Redis connection). This reduces resource overhead and enables cross-index atomic transactions.
Persistent backends additionally return a CheckpointStore that
shares the same session state as the returned SessionControl, so
stage_checkpoint writes land in the same database transaction as
index updates. Volatile backends return checkpoint_store: None.
Sourcefn is_volatile(&self) -> bool
fn is_volatile(&self) -> bool
Returns true if this backend is volatile (data lost on restart).
Volatile backends (like in-memory) require re-bootstrapping after restart, while persistent backends (like RocksDB) retain data.