pub struct PersistentGraphStore { /* private fields */ }Expand description
A session-bound durable graph handle. Cloning duplicates only the handle;
atomic rollback is provided by GraphStore::transaction, not by Clone.
Implementations§
Source§impl PersistentGraphStore
impl PersistentGraphStore
Sourcepub fn from_catalog(
catalog: Arc<dyn CatalogFacade>,
backend: Arc<dyn PersistentStorageBackend>,
) -> Self
pub fn from_catalog( catalog: Arc<dyn CatalogFacade>, backend: Arc<dyn PersistentStorageBackend>, ) -> Self
The catalog and backend must belong to the same storage session.
pub fn from_storage(storage: Arc<dyn GraphStorage>) -> Self
Sourcepub fn retain_resource(self, resource: Arc<dyn Send + Sync>) -> Self
pub fn retain_resource(self, resource: Arc<dyn Send + Sync>) -> Self
Keep a physical snapshot’s resource owner alive with every cloned handle (for example an encrypted temporary snapshot directory).
Sourcepub fn with_read_snapshot(&self, snapshot: &Self) -> Self
pub fn with_read_snapshot(&self, snapshot: &Self) -> Self
Read from a pinned durable snapshot, with this transaction’s writes overlaid by identity. No snapshot entities are copied into memory.
Sourcepub fn fork_for_mutation(&self) -> Self
pub fn fork_for_mutation(&self) -> Self
A mutation candidate copies only its changed-id sets. Previously published candidates are immutable rollback/savepoint checkpoints.
Sourcepub fn unmodified_read_snapshot(&self) -> Option<Self>
pub fn unmodified_read_snapshot(&self) -> Option<Self>
Reuse a transaction’s original pinned reader when it has no graph changes. A cursor can retain this owner independently of COMMIT.
pub fn label_registry( &self, graph: &str, ) -> GraphStoreResult<GraphLabelRegistry>
pub fn graph_labels(&self, graph: &str) -> GraphStoreResult<Vec<GraphLabelInfo>>
pub fn graph_label_kind( &self, graph: &str, label: &str, ) -> GraphStoreResult<Option<LabelKind>>
pub fn import_label_registry( &mut self, graph: &str, registry: &GraphLabelRegistry, ) -> GraphStoreResult<()>
Sourcepub fn rebuild_label_registry_from_ids(
&mut self,
graph: &str,
) -> GraphStoreResult<()>
pub fn rebuild_label_registry_from_ids( &mut self, graph: &str, ) -> GraphStoreResult<()>
One-time legacy migration, streaming entity observations without retaining their properties or an entity map in the engine.
pub fn create_label( &mut self, graph: &str, label: &str, kind: LabelKind, ) -> GraphStoreResult<Option<u32>>
pub fn drop_label( &mut self, graph: &str, label: &str, ) -> GraphStoreResult<Option<(u32, LabelKind)>>
pub fn rename_graph(&mut self, from: &str, to: &str) -> GraphStoreResult<()>
Trait Implementations§
Source§impl Clone for PersistentGraphStore
impl Clone for PersistentGraphStore
Source§impl Debug for PersistentGraphStore
impl Debug for PersistentGraphStore
Source§impl GraphStore for PersistentGraphStore
impl GraphStore for PersistentGraphStore
Source§fn vertex_id_page(
&self,
graph: &str,
after: Option<u64>,
limit: usize,
) -> GraphStoreResult<Vec<u64>>
fn vertex_id_page( &self, graph: &str, after: Option<u64>, limit: usize, ) -> GraphStoreResult<Vec<u64>>
Source§fn edge_id_page(
&self,
graph: &str,
after: Option<u64>,
limit: usize,
) -> GraphStoreResult<Vec<u64>>
fn edge_id_page( &self, graph: &str, after: Option<u64>, limit: usize, ) -> GraphStoreResult<Vec<u64>>
Source§fn transaction<T>(
&mut self,
operation: impl FnOnce(&mut Self) -> GraphStoreResult<T>,
) -> GraphStoreResult<T>
fn transaction<T>( &mut self, operation: impl FnOnce(&mut Self) -> GraphStoreResult<T>, ) -> GraphStoreResult<T>
Source§fn create_graph(&mut self, name: &str) -> GraphStoreResult<()>
fn create_graph(&mut self, name: &str) -> GraphStoreResult<()>
Source§fn drop_graph(&mut self, name: &str) -> GraphStoreResult<()>
fn drop_graph(&mut self, name: &str) -> GraphStoreResult<()>
Source§fn graph_names(&self) -> GraphStoreResult<Vec<String>>
fn graph_names(&self) -> GraphStoreResult<Vec<String>>
fn has_graph(&self, name: &str) -> GraphStoreResult<bool>
Source§fn union_graphs(
&mut self,
g1: &str,
g2: &str,
target: &str,
) -> GraphStoreResult<()>
fn union_graphs( &mut self, g1: &str, g2: &str, target: &str, ) -> GraphStoreResult<()>
target := g1 union g2 over vertex and edge sets.Source§fn intersect_graphs(
&mut self,
g1: &str,
g2: &str,
target: &str,
) -> GraphStoreResult<()>
fn intersect_graphs( &mut self, g1: &str, g2: &str, target: &str, ) -> GraphStoreResult<()>
target := g1 intersect g2.Source§fn difference_graphs(
&mut self,
g1: &str,
g2: &str,
target: &str,
) -> GraphStoreResult<()>
fn difference_graphs( &mut self, g1: &str, g2: &str, target: &str, ) -> GraphStoreResult<()>
target := g1 \ g2.fn copy_graph(&mut self, source: &str, target: &str) -> GraphStoreResult<()>
fn add_vertex(&mut self, vertex: Vertex, graph: &str) -> GraphStoreResult<()>
fn add_edge(&mut self, edge: Edge, graph: &str) -> GraphStoreResult<()>
fn remove_vertex(&mut self, vertex_id: u64, graph: &str) -> GraphStoreResult<()>
fn remove_edge(&mut self, edge_id: u64, graph: &str) -> GraphStoreResult<()>
Source§fn neighbors(
&self,
vertex_id: u64,
label: Option<&str>,
direction: Direction,
graph: &str,
) -> GraphStoreResult<Vec<u64>>
fn neighbors( &self, vertex_id: u64, label: Option<&str>, direction: Direction, graph: &str, ) -> GraphStoreResult<Vec<u64>>
vertex_id along edges with the
given label (or any label when label is None) in the given
direction.fn vertices_by_label( &self, label: &str, graph: &str, ) -> GraphStoreResult<Vec<Vertex>>
Source§fn vertex_ids_by_label(
&self,
label: &str,
graph: &str,
) -> GraphStoreResult<Vec<u64>>
fn vertex_ids_by_label( &self, label: &str, graph: &str, ) -> GraphStoreResult<Vec<u64>>
fn vertices_in_graph(&self, graph: &str) -> GraphStoreResult<Vec<Vertex>>
fn edges_in_graph(&self, graph: &str) -> GraphStoreResult<Vec<Edge>>
fn vertex_graphs(&self, id: u64) -> GraphStoreResult<BTreeSet<String>>
Source§fn edges_by_label(
&self,
label: &str,
graph: &str,
) -> GraphStoreResult<Vec<Edge>>
fn edges_by_label( &self, label: &str, graph: &str, ) -> GraphStoreResult<Vec<Edge>>
fn edge_graphs(&self, id: u64) -> GraphStoreResult<BTreeSet<String>>
fn out_edge_ids(&self, id: u64, graph: &str) -> GraphStoreResult<BTreeSet<u64>>
fn in_edge_ids(&self, id: u64, graph: &str) -> GraphStoreResult<BTreeSet<u64>>
fn edge_ids_by_label( &self, label: &str, graph: &str, ) -> GraphStoreResult<BTreeSet<u64>>
fn vertex_ids_in_graph(&self, graph: &str) -> GraphStoreResult<BTreeSet<u64>>
Source§fn require_vertex_in_graph(&self, id: u64, graph: &str) -> GraphStoreResult<()>
fn require_vertex_in_graph(&self, id: u64, graph: &str) -> GraphStoreResult<()>
graph.
Implementations may override this with a cheaper membership lookup.
Missing query input is distinct from a valid vertex with no edges and
must not be reported as an empty neighborhood/path result.fn degree_distribution( &self, graph: &str, ) -> GraphStoreResult<BTreeMap<u64, u64>>
fn label_degree(&self, label: &str, graph: &str) -> GraphStoreResult<f64>
fn vertex_label_counts( &self, graph: &str, ) -> GraphStoreResult<BTreeMap<String, u64>>
Source§fn get_vertex(&self, id: u64) -> GraphStoreResult<Option<Vertex>>
fn get_vertex(&self, id: u64) -> GraphStoreResult<Option<Vertex>>
fn get_edge(&self, id: u64) -> GraphStoreResult<Option<Edge>>
Source§fn next_vertex_id(&mut self) -> GraphStoreResult<u64>
fn next_vertex_id(&mut self) -> GraphStoreResult<u64>
Source§fn next_edge_id(&mut self) -> GraphStoreResult<u64>
fn next_edge_id(&mut self) -> GraphStoreResult<u64>
Source§fn allocate_vertex_id(
&mut self,
label: &str,
graph: &str,
) -> GraphStoreResult<u64>
fn allocate_vertex_id( &mut self, label: &str, graph: &str, ) -> GraphStoreResult<u64>
label inside
graph. Stores that implement the Apache AGE graphid scheme
override this to return (label_id << 48) | sequence; the
default falls back to the store-wide counter.