pub struct TaskEstimation {
pub task_count: TaskCountAnnotation,
}Expand description
Result of running a TaskEstimator on a leaf node. It tells the distributed planner hints about how many tasks should be used in [Stage]s that contain leaf nodes.
Fields§
§task_count: TaskCountAnnotationThe number of tasks that should be used in the [Stage] containing the leaf node.
Even if implementations get to decide this number, there are situations where it can get overridden:
- If a [Stage] contains multiple leaf nodes, the one that declares the biggest task_count wins.
- If there are less available workers than this number, the number of available workers is chosen.
Implementations§
Source§impl TaskEstimation
impl TaskEstimation
Sourcepub fn maximum(value: usize) -> Self
pub fn maximum(value: usize) -> Self
Tells the distributed planner that the evaluated stage can have at maximum the provided number of tasks, setting a hard upper limit.
Returning TaskEstimation::maximum(1) tells the distributed planner that the evaluated
stage cannot be distributed.
Even if a TaskEstimation::maximum(N) is provided, any other node in the same stage
providing a value of TaskEstimation::maximum(M) where M < N will have preference.
Sourcepub fn desired(value: usize) -> Self
pub fn desired(value: usize) -> Self
Tells the distributed planner that the evaluated can optimally have the provided number of tasks, setting a soft task count hint that can be overridden by others.
The provided TaskEstimation::desired(N) can be overridden by:
- Other nodes providing a
TaskEstimation::desired(M)whereM>N. - Any other node providing a
TaskEstimation::maximum(M)whereMcan be anything.
Auto Trait Implementations§
impl Freeze for TaskEstimation
impl RefUnwindSafe for TaskEstimation
impl Send for TaskEstimation
impl Sync for TaskEstimation
impl Unpin for TaskEstimation
impl UnsafeUnpin for TaskEstimation
impl UnwindSafe for TaskEstimation
Blanket Implementations§
impl<T> Allocation for T
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request