Thank you Aljosha,.now that's more clear!
I didn't know that jobGraph.getJobID() was the solution for my use case..I
was convinced that the job ID was assigned by the cluster!
And to me it's really weird that the job listener was not called by the
submitJob...Probably this should be documented at least.
In the meanwhile I extended a little bit the RestClusterClient..do you
think it could be worth issuing a PR to add some unimplemented methods?

For example I added:
- public JobExceptionsInfo getFlinkJobExceptionsInfo(JobID flinkJobId);
- public EmptyResponseBody deleteJar(String jarFileName);
- public boolean isJobRunning(JobID fjid)
- public JarUploadResponseBody uploadJar(Path uploadedFile);

and I was also going to add jarRun..

Let me know,
Flavio

On Mon, Nov 23, 2020 at 3:57 PM Aljoscha Krettek <aljos...@apache.org>
wrote:

> On 20.11.20 22:09, Flavio Pompermaier wrote:
> > To achieve this, I was using the
> > RestClusterClient<StandaloneClusterId> because with that I can use the
> > following code and retrieve the JobID:
> >
> >      (1) JobID flinkJobId =
> >
> client.submitJob(jobGraph).thenApply(DetachedJobExecutionResult::new).get().getJobID();
>
> All you want to do is get the JobID, correct? If yes, you can just do a
> `jobGraph.getJobID()`. The job id is not set on the cluster but it's
> actually set client side, on the JobGraph object.
>
> Does that help in your case?
>
> A general comment on your other questions: yes, the listener logic if
> only used when using the environments. It's not integrated with the
> RestClusterClient, which is considered more of an internal
> implementation detail.
>
> Aljoscha
>
>

-- 
Flavio Pompermaier
Development Department

OKKAM S.r.l.
Tel. +(39) 0461 041809

Reply via email to