-
Notifications
You must be signed in to change notification settings - Fork 13.8k
[FLINK-14762][client] Enrich JobClient API #10311
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
Conversation
|
Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community Automated ChecksLast check on commit e661746 (Wed Dec 04 15:10:14 UTC 2019) Warnings:
Mention the bot in a comment to re-run the automated checks. Review Progress
Please see the Pull Request Review Guide for a full explanation of the review process. DetailsThe Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required Bot commandsThe @flinkbot bot supports the following commands:
|
CI report:
Bot commandsThe @flinkbot bot supports the following commands:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @tisonkun , thanks a lot for the work. As an overarching comment, I noticed that you add a flag moveOwnership to the ClusterClientJobClientAdapter and this also bubbles up till the ClusterClient.submitJob().
I am wondering if this is needed, and from a conceptual point of view, I lean towards the no. As a first point, I noticed that the only places that this is set to false are the ClientUtils.submitJob... which are mainly used in tests. And second, why not closing the ClusterClient always, when the JobClient closes (which is the responsibility of the call-site), and just let the user decide when to close the job client.
If the user wants to do something with the JobClient, he/she can create a new one (although we still need to figure out how to "retrieve" a jobClient).
WDYT?
|
Also we could simply return |
aadc1cf to
daf85a7
Compare
Yes I also tend not to do so. At that moment I was a bit delirious for thinking about whether or not close cluster client on job client closed :/ for shutting down things, I think it is still a configurable action whether or not we close cluster client on job client close because cluster client "spawns" job client and maybe we call I push a commit daf85a7 for customizing actions on closed for define such manner while considering code quality. Does it make sense to you? |
I've ever thought of
As for this point, I don't stick to using |
12debf3 to
fe4dfd5
Compare
kl0u
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @tisonkun ! Thanks for the work.
I left some comments and some additional remarks are:
- I would say to not move the
JobStatusclass from the runtime to thecorebut rather create a copy of the enum and put in thecore, with a method that maps the runtimeJobStatusto a coreJobStatus. TheJobClientwill return a coreJobStatus. - I would not move the
Acknowledgeto thecorebut make the corresponding methods of theJobClientreturn aVoid.
...-clients/src/main/java/org/apache/flink/client/deployment/ClusterClientJobClientAdapter.java
Outdated
Show resolved
Hide resolved
flink-clients/src/main/java/org/apache/flink/client/program/rest/RestClusterClient.java
Outdated
Show resolved
Hide resolved
flink-clients/src/main/java/org/apache/flink/client/program/ClusterClient.java
Outdated
Show resolved
Hide resolved
flink-clients/src/main/java/org/apache/flink/client/ClientUtils.java
Outdated
Show resolved
Hide resolved
flink-clients/src/main/java/org/apache/flink/client/ClientUtils.java
Outdated
Show resolved
Hide resolved
...clients/src/main/java/org/apache/flink/client/deployment/AbstractSessionClusterExecutor.java
Outdated
Show resolved
Hide resolved
fe4dfd5 to
7d98e67
Compare
flink-core/src/main/java/org/apache/flink/core/execution/JobClient.java
Outdated
Show resolved
Hide resolved
kl0u
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the work @tisonkun ! I left some minor comments. After integrating them and having a green light on Travis, feel free to merge.
flink-clients/src/main/java/org/apache/flink/client/deployment/AbstractJobClusterExecutor.java
Outdated
Show resolved
Hide resolved
...-clients/src/main/java/org/apache/flink/client/deployment/ClusterClientJobClientAdapter.java
Show resolved
Hide resolved
flink-runtime/src/main/java/org/apache/flink/runtime/jobgraph/JobStatus.java
Outdated
Show resolved
Hide resolved
...-clients/src/main/java/org/apache/flink/client/deployment/ClusterClientJobClientAdapter.java
Outdated
Show resolved
Hide resolved
...-clients/src/main/java/org/apache/flink/client/deployment/ClusterClientJobClientAdapter.java
Outdated
Show resolved
Hide resolved
| } | ||
|
|
||
| @Override | ||
| public CompletableFuture<Map<String, OptionalFailure<Object>>> getAccumulators(ClassLoader classLoader) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not use Optional here? It seems OptionalFailure is a bit strange because it does not behave like an Optional, it's more like an Either type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I think it's better to just return a CompletableFuture<Map<String, Object>>. We can fail the future if there is any failure in the map but otherwise just return a complete map. I don't think it's useful for the user to have to do all the unpacking. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We use Map<String, OptionalFailure<Object>> as type of accumulators in JobExecutionResult & ClusterClient already. The investigation how we treat of such unpack things is independent and out of the scope here in my opinion. Shall we open a ticket for take it into consideration and prevent this one to be too complex?
|
Address comment. @aljoscha please take a look about the update as well as my reply above. |
bd5087f to
ca1cab6
Compare
|
cherry-pick from slack channel. feel free to react wherever you like.
|
|
tison 10:48 AM |
6d8f1af to
7221e66
Compare
|
This looks good for |
|
I think this is good to merge now! 💐 |
|
travis fails unstably on a known issue https://issues.apache.org/jira/browse/FLINK-14894 which cannot be reproduced locally merging now... thanks for your review! |
What is the purpose of the change
This pull request is a rebase on master of #10185 .
We generally enrich
JobClientAPI as described in FLIP-74 as well as letClusterClient#submitJobreturns aCompletableFutureofJobClient.For now I think we may or may not introduce dedicated tests because the only implementation is a thin wrapper of
ClusterClient. Maybe we can defer the test set until other implementation comes because testing a wrapper gains us little.Another tricky thing is about lifecycle management a.k.a. whether or not close
ClusterClientonClusterClientJobClientAdapterclosed. Currently I use a boolean parametermoveOwnshipfor explicitly setting, but still looking for other solution.Verifying this change
This change is already covered by existing tests.
Does this pull request potentially affect one of the following parts:
@Public(Evolving): (no)Documentation
JobClientwhich is to be public API).cc @aljoscha @kl0u