Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FLINK-36067][runtime] Support optimize stream graph based on input info. #25790

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

JunRuiLee
Copy link
Contributor

What is the purpose of the change

[FLINK-36067][runtime] Support optimize stream graph based on input info.

Brief change log

  • Introduce StreamGraphOptimizer and StreamGraphOptimizationStrategy
  • Support optimize stream graph based on input info.

Verifying this change

This change added tests.

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): (yes / no)
  • The public API, i.e., is any changed class annotated with @Public(Evolving): (yes / no)
  • The serializers: (yes / no / don't know)
  • The runtime per-record code paths (performance sensitive): (yes / no / don't know)
  • Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: (yes / no / don't know)
  • The S3 file system connector: (yes / no / don't know)

Documentation

  • Does this pull request introduce a new feature? (yes / no)
  • If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)

@flinkbot
Copy link
Collaborator

flinkbot commented Dec 12, 2024

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run azure re-run the last Azure build

@JunRuiLee JunRuiLee force-pushed the FLINK-36067-1212 branch 3 times, most recently from 9d3e01f to 9b2cc2a Compare December 12, 2024 11:03
@@ -273,6 +273,16 @@ public void onNewJobVerticesAdded(List<JobVertex> newVertices, int pendingOperat

// 4. update json plan
getExecutionGraph().setJsonPlan(JsonPlanGenerator.generatePlan(getJobGraph()));

// 5. update the DistributionPattern of the upstream results consumed by the newly created
// JobVertex and aggregate subpartition bytes.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aggregate subpartition bytes. -> aggregate subpartition bytes when possible.

I would find is useful to describe in more detail was aggregate subpartition bytes means and why we can perform this optimization in some circumstances.

@@ -937,6 +965,26 @@ SpeculativeExecutionHandler getSpeculativeExecutionHandler() {
return speculativeExecutionHandler;
}

private void tryUpdateResultInfo(IntermediateDataSetID id, DistributionPattern targetPattern) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you add some comments detailing the algorithm and its benefits.

@@ -207,6 +210,10 @@ public boolean isForward() {
return intermediateDataSet.isForward();
}

public boolean isEveryConsumerConsumeAllSubPartitions() {
Copy link
Contributor

@davidradl davidradl Dec 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am confused by why this method is checking broadcasts - how does this relate to downstream consumers being able to consume the subpartitions

@@ -35,6 +35,14 @@ public interface IntermediateResultInfo {
*/
boolean isBroadcast();

/**
* Indicates whether every downstream consumer needs to consume all produced sub-partitions.
Copy link
Contributor

@davidradl davidradl Dec 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see this method seems to be relate to broadcasts - it would be good to explain how.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants