pub struct PersistenceManager { /* private fields */ }Expand description
Integrated persistence manager combining WAL, storage, and tenancy
Implementations§
Source§impl PersistenceManager
impl PersistenceManager
Sourcepub fn new(base_path: impl AsRef<Path>) -> Result<Self, PersistenceError>
pub fn new(base_path: impl AsRef<Path>) -> Result<Self, PersistenceError>
Create a new persistence manager
Sourcepub fn tenants(&self) -> &TenantManager
pub fn tenants(&self) -> &TenantManager
Get tenant manager
Sourcepub fn start_indexer(
&self,
store: &GraphStore,
receiver: UnboundedReceiver<IndexEvent>,
)
pub fn start_indexer( &self, store: &GraphStore, receiver: UnboundedReceiver<IndexEvent>, )
Start the background indexer for a store
Sourcepub fn persist_create_node(
&self,
tenant: &str,
node: &Node,
) -> Result<(), PersistenceError>
pub fn persist_create_node( &self, tenant: &str, node: &Node, ) -> Result<(), PersistenceError>
Persist a node creation
Sourcepub fn persist_create_edge(
&self,
tenant: &str,
edge: &Edge,
) -> Result<(), PersistenceError>
pub fn persist_create_edge( &self, tenant: &str, edge: &Edge, ) -> Result<(), PersistenceError>
Persist an edge creation
Sourcepub fn persist_delete_node(
&self,
tenant: &str,
node_id: u64,
) -> Result<(), PersistenceError>
pub fn persist_delete_node( &self, tenant: &str, node_id: u64, ) -> Result<(), PersistenceError>
Persist a node deletion
Sourcepub fn persist_delete_edge(
&self,
tenant: &str,
edge_id: u64,
) -> Result<(), PersistenceError>
pub fn persist_delete_edge( &self, tenant: &str, edge_id: u64, ) -> Result<(), PersistenceError>
Persist an edge deletion
Sourcepub fn persist_update_node_properties(
&self,
tenant: &str,
node_id: u64,
properties: &PropertyMap,
) -> Result<(), PersistenceError>
pub fn persist_update_node_properties( &self, tenant: &str, node_id: u64, properties: &PropertyMap, ) -> Result<(), PersistenceError>
Update node properties
Sourcepub fn list_persisted_tenants(&self) -> Result<Vec<String>, PersistenceError>
pub fn list_persisted_tenants(&self) -> Result<Vec<String>, PersistenceError>
List all tenants that have persisted data in RocksDB
Sourcepub fn recover(
&self,
tenant: &str,
) -> Result<(Vec<Node>, Vec<Edge>), PersistenceError>
pub fn recover( &self, tenant: &str, ) -> Result<(Vec<Node>, Vec<Edge>), PersistenceError>
Recover from storage and WAL
Sourcepub fn checkpoint(&self) -> Result<(), PersistenceError>
pub fn checkpoint(&self) -> Result<(), PersistenceError>
Create a checkpoint
Sourcepub fn flush(&self) -> Result<(), PersistenceError>
pub fn flush(&self) -> Result<(), PersistenceError>
Flush all pending writes
Sourcepub fn storage(&self) -> &PersistentStorage
pub fn storage(&self) -> &PersistentStorage
Get storage reference
Sourcepub fn checkpoint_vectors(
&self,
vector_index: &VectorIndexManager,
) -> Result<(), PersistenceError>
pub fn checkpoint_vectors( &self, vector_index: &VectorIndexManager, ) -> Result<(), PersistenceError>
Save vector indices to disk
Sourcepub fn recover_vectors(
&self,
vector_index: &VectorIndexManager,
) -> Result<(), PersistenceError>
pub fn recover_vectors( &self, vector_index: &VectorIndexManager, ) -> Result<(), PersistenceError>
Load vector indices from disk
Auto Trait Implementations§
impl Freeze for PersistenceManager
impl RefUnwindSafe for PersistenceManager
impl Send for PersistenceManager
impl Sync for PersistenceManager
impl Unpin for PersistenceManager
impl UnsafeUnpin for PersistenceManager
impl UnwindSafe for PersistenceManager
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
Mutably borrows from an owned value. Read more
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> 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>
Converts
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>
Converts
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