Skip to main content

ParallelNodeScanSource

Struct ParallelNodeScanSource 

Source
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

Source

pub fn new(store: Arc<dyn GraphStore>) -> Self

Creates a parallel source for all nodes in the store.

Source

pub fn with_label(store: Arc<dyn GraphStore>, label: &str) -> Self

Creates a parallel source for nodes with a specific label.

Source

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.

Source

pub fn store(&self) -> &Arc<dyn GraphStore>

Returns the underlying store reference.

Trait Implementations§

Source§

impl ParallelSource for ParallelNodeScanSource

Source§

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>

Creates a partition source for the given morsel. Read more
Source§

fn num_columns(&self) -> usize

Returns the number of columns in this source.
Source§

fn is_partitionable(&self) -> bool

Returns whether this source can be partitioned. Read more
Source§

fn generate_morsels(&self, morsel_size: usize, source_id: usize) -> Vec<Morsel>

Generates morsels that cover all rows in this source. Read more
Source§

impl Source for ParallelNodeScanSource

Source§

fn next_chunk( &mut self, chunk_size: usize, ) -> Result<Option<DataChunk>, OperatorError>

Produce the next chunk of data. Read more
Source§

fn reset(&mut self)

Reset the source to its initial state.
Source§

fn name(&self) -> &'static str

Name of this source for debugging.

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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.