pub struct ParallelExecutionEngine { /* private fields */ }Expand description
Parallel execution engine using Rayon thread pool
Implementations§
Source§impl ParallelExecutionEngine
impl ParallelExecutionEngine
Sourcepub fn new(policy: ParallelizationPolicy) -> DbxResult<Self>
pub fn new(policy: ParallelizationPolicy) -> DbxResult<Self>
Create a new parallel execution engine with the specified policy
Sourcepub fn new_auto() -> DbxResult<Self>
pub fn new_auto() -> DbxResult<Self>
Create a new parallel execution engine with automatic thread count
Sourcepub fn new_fixed(num_threads: usize) -> DbxResult<Self>
pub fn new_fixed(num_threads: usize) -> DbxResult<Self>
Create a new parallel execution engine with a fixed number of threads
Sourcepub fn policy(&self) -> ParallelizationPolicy
pub fn policy(&self) -> ParallelizationPolicy
Get the current parallelization policy
Sourcepub fn thread_count(&self) -> usize
pub fn thread_count(&self) -> usize
Get the number of threads in the thread pool
Sourcepub fn thread_pool(&self) -> &ThreadPool
pub fn thread_pool(&self) -> &ThreadPool
Get a reference to the thread pool
Sourcepub fn auto_tune(&self, workload_size: usize) -> usize
pub fn auto_tune(&self, workload_size: usize) -> usize
Auto-tune the thread count based on workload size
Returns the recommended number of parallel tasks for the given workload size
Sourcepub fn auto_tune_weighted(
&self,
workload_size: usize,
avg_complexity: f64,
) -> usize
pub fn auto_tune_weighted( &self, workload_size: usize, avg_complexity: f64, ) -> usize
Auto-tune with complexity weight factor
Higher complexity = fewer items per thread needed to justify parallelism
Sourcepub fn estimate_query_complexity(sql: &str) -> f64
pub fn estimate_query_complexity(sql: &str) -> f64
Estimate SQL query complexity based on heuristics
Returns a complexity score (1.0 = simple SELECT, higher = more complex)
Sourcepub fn should_parallelize(&self, workload_size: usize) -> bool
pub fn should_parallelize(&self, workload_size: usize) -> bool
Check if parallelization is beneficial for the given workload size
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ParallelExecutionEngine
impl !RefUnwindSafe for ParallelExecutionEngine
impl Send for ParallelExecutionEngine
impl Sync for ParallelExecutionEngine
impl Unpin for ParallelExecutionEngine
impl UnsafeUnpin for ParallelExecutionEngine
impl !UnwindSafe for ParallelExecutionEngine
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
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>
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>
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