Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/distributed_planner/network_boundary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ pub trait NetworkBoundary: ExecutionPlan {
input_tasks: usize,
) -> datafusion::common::Result<Arc<dyn NetworkBoundary>>;

/// Returns the input tasks assigned to this [NetworkBoundary].
fn input_task_count(&self) -> usize;

/// Called when a [Stage] is correctly formed. The [NetworkBoundary] can use this
/// information to perform any internal transformations necessary for distributed execution.
///
Expand Down
7 changes: 7 additions & 0 deletions src/execution_plans/network_coalesce.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,13 @@ impl NetworkBoundary for NetworkCoalesceExec {
}
}))
}

fn input_task_count(&self) -> usize {
match self {
Self::Pending(v) => v.input_tasks,
Self::Ready(v) => v.input_stage.tasks.len(),
}
}
}

impl DisplayAs for NetworkCoalesceExec {
Expand Down
7 changes: 7 additions & 0 deletions src/execution_plans/network_shuffle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,13 @@ impl NetworkBoundary for NetworkShuffleExec {
}))
}

fn input_task_count(&self) -> usize {
match self {
Self::Pending(v) => v.input_tasks,
Self::Ready(v) => v.input_stage.tasks.len(),
}
}

fn with_input_stage(
&self,
input_stage: Stage,
Expand Down