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-36069][runtime/rest] Extending job detail rest API to expose json stream graph #25798

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

yuchen-ecnu
Copy link
Contributor

What is the purpose of the change

  • Extending job detail rest API to adapt to Incremental JobGraph Generation in batch mode.
  • Modify web ui to support job graph auto-refresh for Incremental JobGraph Generation.

Brief change log

  • Modify JobDetailHandler to return the incrementally updated job graphs.
  • Modify the web ui to display the incremental job graph and the unconverted stream node.
  • Add a new checkbox in the webui to select whether to display the unconverted stream node or not.

Verifying this change

This change added tests and can be verified as follows:

  • Added test that validates that JsonPlanGenerator generates JsonStreamGraph works well
  • Added test that validates that JobDetailHandler returns Incremental JobGraph as expected

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
  • If yes, how is the feature documented? not applicable

@yuchen-ecnu
Copy link
Contributor Author

Hi @JunRuiLee, can you help to review this PR?

@flinkbot
Copy link
Collaborator

flinkbot commented Dec 15, 2024

CI report:

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

Copy link
Contributor

@JunRuiLee JunRuiLee left a comment

Choose a reason for hiding this comment

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

Thanks @yuchen-ecnu for contributing, I've left two comments, PTAL!

@@ -101,6 +102,8 @@ void enableCheckpointing(

void setJsonPlan(String jsonPlan);

void setJsonStreamGraph(JsonStreamGraph jsonStreamGraph);
Copy link
Contributor

Choose a reason for hiding this comment

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

I prefer to retrieve the JSON of the stream graph from ExecutionPlanSchedulingContext. For example, we could add a method getJsonStreamGraph in ExecutionPlanSchedulingContext. This context will return the JSON held by AdaptiveGraphManager. When the stream graph is updated by the DefaultStreamGraphContext, the AdaptiveGraphManager should update this JSON.

With this update, we could avoid manually passing this JSON to the execution graph and keep this change simple.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Great tips! ExecutionPlanSchedulingContext really helps a lot. I have remove the unexpected setJsonStreamGraph methods from ExecutionGraph in the revised version.

@@ -70,6 +70,8 @@ public enum ExecutionState {

RECONCILING,

PENDING,
Copy link
Contributor

Choose a reason for hiding this comment

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

How about handle pending-operators in the JobDetailsHandler#createJobDetailsInfo. This way, we wouldn't need to introduce any meaningless statuses to a common enum class.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agree with you. Since it’s not a valid status for stream jobs, how about including it in the serialized JSON stream graph (JsonPlanGenerator#generateJsonStreamGraph)? This would help avoid adding interfaces like getPendingOperatorCounts() to the ExecutionGraph and ArchivedExecutionGraph for processing in JobDetailsHandler#createJobDetailsInfo. And it will be processed in frontend code.

@yuchen-ecnu yuchen-ecnu force-pushed the FLINK-36069 branch 2 times, most recently from 02bc2ff to 5ff6712 Compare December 16, 2024 16:37
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