savepoint command in code

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

savepoint command in code

Abdullah bin Omar
Hello,

I am trying to use the savepoint command (./bin/flink savepoint jobid) in the code instead of doing it manually in the terminal. The jobid can get using getjobid(). The problem is to define the path ./bin/flink  —  it can not be shown as a directory (probably because of a unix executable file).  

Is there a way to define the path (./bin/flink) in the code? or, is there any function to get the savepoint from code instead of manual command?

Thank you


Reply | Threaded
Open this post in threaded view
|

Re: savepoint command in code

Matthias
Hi Abdullah,
is there a reason you're not considering triggering the stop-with-savepoint operation through the REST API [1]? I'm not entirely sure whether I understand you correctly: ./bin/flink is an executable. Why Would you assume it to be shown as a directory? You would need to provide FLINK_HOME (the Flink's binary directory ./bin/flink is located in) through some parameter to access the executable.

Best,
Matthias


On Tue, May 4, 2021 at 5:51 AM Abdullah bin Omar <[hidden email]> wrote:
Hello,

I am trying to use the savepoint command (./bin/flink savepoint jobid) in the code instead of doing it manually in the terminal. The jobid can get using getjobid(). The problem is to define the path ./bin/flink  —  it can not be shown as a directory (probably because of a unix executable file).  

Is there a way to define the path (./bin/flink) in the code? or, is there any function to get the savepoint from code instead of manual command?

Thank you
Reply | Threaded
Open this post in threaded view
|

Re: savepoint command in code

Yun Tang
In reply to this post by Abdullah bin Omar
Hi,

You could trigger savepoint via rest API [1] or refer to SavepointITCase[2] to see how to trigger savepoint in test code.



Best
Yun Tang

From: Abdullah bin Omar <[hidden email]>
Sent: Tuesday, May 4, 2021 11:50
To: [hidden email] <[hidden email]>
Subject: savepoint command in code
 
Hello,

I am trying to use the savepoint command (./bin/flink savepoint jobid) in the code instead of doing it manually in the terminal. The jobid can get using getjobid(). The problem is to define the path ./bin/flink  —  it can not be shown as a directory (probably because of a unix executable file).  

Is there a way to define the path (./bin/flink) in the code? or, is there any function to get the savepoint from code instead of manual command?

Thank you