Skip to main content

SnapshotGraphBuilder

Struct SnapshotGraphBuilder 

Source
pub struct SnapshotGraphBuilder { /* private fields */ }
Expand description

Builds an InMemoryGraph from snapshot records one at a time.

A decoder that streams a snapshot pushes each record as it decodes it, so the records are never all held at once beside the graph they fill. Push every node before the relationships that reference it, then call Self::finish with the catalogs, which registers the indexes and constraints over the loaded data.

Implementations§

Source§

impl SnapshotGraphBuilder

Source

pub fn new( next_node_id: NodeId, next_rel_id: RelationshipId, ) -> Result<Self, SnapshotError>

Source

pub fn push_node(&mut self, node: NodeRecord) -> Result<(), SnapshotError>

Source

pub fn push_relationship( &mut self, rel: RelationshipRecord, ) -> Result<(), SnapshotError>

Source

pub fn finish( self, indexes: Vec<IndexDefinition>, constraints: Vec<ConstraintDefinition>, vector_indexes: Vec<VectorIndexSnapshot>, ) -> Result<InMemoryGraph, SnapshotError>

Source§

impl SnapshotGraphBuilder

Source

pub fn prime( &mut self, names: &SnapshotNames, ) -> Result<SnapshotEncoder, SnapshotError>

Number the snapshot’s names in the graph being built, and return an encoder that turns records named by those numbers into the graph’s stored form on any thread. Call before pushing records.

Source

pub fn push_nodes(&mut self, batch: NodeBatch) -> Result<(), SnapshotError>

Store nodes an encoder from Self::prime encoded.

Source

pub fn push_relationships( &mut self, batch: RelationshipBatch, ) -> Result<(), SnapshotError>

Store relationships an encoder from Self::prime encoded. Their endpoints must already be pushed.

Source

pub fn push_relationship_batches( &mut self, batches: Vec<RelationshipBatch>, ) -> Result<(), SnapshotError>

Self::push_relationships for several batches, in order: their adjacency is linked in one pass, on every core when the build allows.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.