Fwd: Is it possible to get Flink job name in an operator?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Fwd: Is it possible to get Flink job name in an operator?

马阳阳
As the title. Is it possible now? Or if we can do something to achieve this. I tried to put the job name into the ExecutionConfig.GlobalJobParameters. But it is not possible to get the job name before Environment.execute() is called.

Best regards,
mayangyang
Reply | Threaded
Open this post in threaded view
|

Re: Is it possible to get Flink job name in an operator?

Zhu Zhu
I think ExecutionConfig.GlobalJobParameters is the way to do this if you want to retrieve it in runtime.
Or you can just pass the name to each operator you implement to have it serialized together with the udf.

Thanks,
Zhu Zhu

马阳阳 <[hidden email]> 于2019年10月15日周二 下午3:11写道:
As the title. Is it possible now? Or if we can do something to achieve this. I tried to put the job name into the ExecutionConfig.GlobalJobParameters. But it is not possible to get the job name before Environment.execute() is called.

Best regards,
mayangyang
Reply | Threaded
Open this post in threaded view
|

Re: Is it possible to get Flink job name in an operator?

Aleksandar Mastilovic
In reply to this post by 马阳阳
I got mine in AbstractStreamOperator.open() method through this.getContainingTask().getEnvironment().getJobID();


On Oct 14, 2019, at 11:53 PM, 马阳阳 <[hidden email]> wrote:

As the title. Is it possible now? Or if we can do something to achieve this. I tried to put the job name into the ExecutionConfig.GlobalJobParameters. But it is not possible to get the job name before Environment.execute() is called.

Best regards,
mayangyang

Reply | Threaded
Open this post in threaded view
|

Re: Fwd: Is it possible to get Flink job name in an operator?

Chesnay Schepler
In reply to this post by 马阳阳
If you have control over the job you can modify it to use ExEnv#execute(String jobName), and üass this explicitly to your functions in some form (like the global job parameters).

Beyond that there is no way to access the job name from within a function/operator.

On 15/10/2019 08:53, 马阳阳 wrote:
As the title. Is it possible now? Or if we can do something to achieve this. I tried to put the job name into the ExecutionConfig.GlobalJobParameters. But it is not possible to get the job name before Environment.execute() is called.

Best regards,
mayangyang