-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[refactor](Coordinator) refactor coordinator (#41730)
Use NereidsSqlCoordinator instead of Coordinator because the code of Coordinator is too hard to maintaining The main design approach is as follows: 1. Divide the original flat Coordinator into multiple modules, with each module maintaining high cohesion. - `DistributePlanner`: The logic for calculating parallelism has been extracted in #36531, and in the future, we will dynamically calculate parallelism based on cost. - `CoordinatorContext`: Some global parameters and states related to the Coordinator are encapsulated within CoordinatorContext. - `PipelineExecutionTask`: The entire scheduling task is encapsulated by PipelineExecutionTask, which includes the mapping relationship between each Backend and Pipeline task. PipelineExecutionTask contains two layers of tasks, each responsible for specific duties, with state maintenance handled internally rather than being centralized in the Coordinator. - `MultiFragmentsPipelineTask`: A Backend will generate multiple fragment tasks, which are bundled together and sent concurrently to the corresponding Backend. - `SingleFragmentPipelineTask`: A single fragment task for a Backend. - `JobProcessor`: Describes two types of tasks: SQL tasks and Load tasks. - `QueryProcessor`: Represents query tasks and provides a ResultReceiver to obtain query results. - `LoadProcessor`: Represents Insert into and Broker load tasks, providing a blocking function to wait for load completion. - `ThriftPlansBuilder`: Uses the DistributedPlan structure to build thrift parameters and encapsulates some intermediate temporary variables within functions, rather than placing them in the Coordinator. 2. The overall Coordinator logic is more clearly organized. We can see that the NereidsCoordinator consists of only a few functions, allowing quick understanding of the main flow when reading the code. - Construct CoordinatorContext. - Enqueue the tasks. - Handle different sinks accordingly. - Register the Coordinator with `QeProcessorImpl` for cancellation and progress tracking. - Construct thrift parameters. - Build PipelineTask. - Initiate RPC calls to each Backend. TODO: 1. delete old `Coordinator` 2. support cloud mode
- Loading branch information
Showing
168 changed files
with
4,676 additions
and
462 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.