Class PipelinedStageExecution

java.lang.Object
io.trino.execution.scheduler.PipelinedStageExecution
All Implemented Interfaces:
StageExecution

public class PipelinedStageExecution extends Object implements StageExecution
This class is designed to facilitate the pipelined mode of execution.

In the pipeline mode the tasks are executed in all-or-nothing fashion with all the intermediate data being "piped" between stages in a streaming way.

This class has two main responsibilities:

1. Linking pipelined stages together. If a new task is scheduled the implementation notifies upstream stages to add an additional output buffer for the task as well as it notifies the downstream stage to update a list of source tasks. It is also responsible of notifying both upstream and downstream stages when no more tasks will be added.

2. Facilitates state transitioning for a pipelined stage execution according to the all-or-noting model. If any of the tasks fail the implementation is responsible for terminating all remaining tasks as well as propagating the original error. If all the tasks finish successfully the implementation is responsible for notifying the scheduler about a successful completion of a given stage.