[
https://issues.apache.org/jira/browse/FLINK-15129?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16991705#comment-16991705
]
Aljoscha Krettek commented on FLINK-15129:
------------------------------------------
This raises the interesting point, that it is a bit "dangerous" to return a
future. If users ignore the future, they will not notice when job submission
fails. For example if they misconfigured something. This can lead to unnoticed
errors.
I'm now thinking that the default should make user errors as unlikely as
possible and that problems should be noticeable easily. So I think we should
actually return a {{JobClient}} and not a future of a {{JobClient}}.
[~tison] & [~zjffdu] What do you think?
> Return JobClient instead of JobClient Future from executeAsync()
> ----------------------------------------------------------------
>
> Key: FLINK-15129
> URL: https://issues.apache.org/jira/browse/FLINK-15129
> Project: Flink
> Issue Type: Sub-task
> Components: API / DataSet, API / DataStream
> Reporter: Aljoscha Krettek
> Priority: Major
>
> Currently, users have to write this when they want to use the {{JobClient}}:
> {code}
> CompletableFuture<JobClient> jobClientFuture = env.executeAsync();
> JobClient jobClient = jobClientFuture.get();
> // or use thenApply/thenCompose etc.
> {code}
> instead we could always return a {{JobClient}} right away and therefore
> remove one step for the user.
> I don't know if it's always the right choice, but currently we always return
> an already completed future that contains the {{JobClient}}. In the future we
> might want to return a future that actually completes at some later point, we
> would not be able to do this if we directly return a {{JobClient}} and would
> have to block in {{executeAsync()}}.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)