pub struct ParallelNodeScanSource { /* private fields */ }Expand description
Parallel source for scanning nodes from the LPG store.
Enables morsel-driven parallel execution of node scans by label. Each partition independently scans a range of node IDs, enabling linear scaling on multi-core systems for large datasets.
§Example
use grafeo_core::execution::parallel::{ParallelNodeScanSource, ParallelSource};
use grafeo_core::graph::lpg::LpgStore;
use std::sync::Arc;
let store = Arc::new(LpgStore::new().unwrap());
// ... populate store ...
// Scan all Person nodes in parallel
let source = ParallelNodeScanSource::with_label(store, "Person");
let morsels = source.generate_morsels(4096, 0);Implementations§
Source§impl ParallelNodeScanSource
impl ParallelNodeScanSource
Sourcepub fn new(store: Arc<dyn GraphStore>) -> Self
pub fn new(store: Arc<dyn GraphStore>) -> Self
Creates a parallel source for all nodes in the store.
Sourcepub fn with_label(store: Arc<dyn GraphStore>, label: &str) -> Self
pub fn with_label(store: Arc<dyn GraphStore>, label: &str) -> Self
Creates a parallel source for nodes with a specific label.
Sourcepub fn from_node_ids(store: Arc<dyn GraphStore>, node_ids: Vec<NodeId>) -> Self
pub fn from_node_ids(store: Arc<dyn GraphStore>, node_ids: Vec<NodeId>) -> Self
Creates from pre-computed node IDs.
Useful when node IDs are already available from a previous operation.
Sourcepub fn store(&self) -> &Arc<dyn GraphStore>
pub fn store(&self) -> &Arc<dyn GraphStore>
Returns the underlying store reference.
Trait Implementations§
Source§impl ParallelSource for ParallelNodeScanSource
impl ParallelSource for ParallelNodeScanSource
Source§fn total_rows(&self) -> Option<usize>
fn total_rows(&self) -> Option<usize>
Returns the total number of rows in this source, if known. Read more
Source§fn create_partition(&self, morsel: &Morsel) -> Box<dyn Source>
fn create_partition(&self, morsel: &Morsel) -> Box<dyn Source>
Creates a partition source for the given morsel. Read more
Source§fn num_columns(&self) -> usize
fn num_columns(&self) -> usize
Returns the number of columns in this source.
Source§fn is_partitionable(&self) -> bool
fn is_partitionable(&self) -> bool
Returns whether this source can be partitioned. Read more
Source§impl Source for ParallelNodeScanSource
impl Source for ParallelNodeScanSource
Auto Trait Implementations§
impl Freeze for ParallelNodeScanSource
impl !RefUnwindSafe for ParallelNodeScanSource
impl Send for ParallelNodeScanSource
impl Sync for ParallelNodeScanSource
impl Unpin for ParallelNodeScanSource
impl UnsafeUnpin for ParallelNodeScanSource
impl !UnwindSafe for ParallelNodeScanSource
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> 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