Re: savepoint command in code

2021-05-05 Thread Yun Tang
Hi,

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


[1] 
https://ci.apache.org/projects/flink/flink-docs-release-1.13/docs/ops/rest_api/#jobs-jobid-savepoints
[2] 
https://github.com/apache/flink/blob/c688bf3c83e72155ccf5d04fe397b7c0a1274fd1/flink-tests/src/test/java/org/apache/flink/test/checkpointing/SavepointITCase.java#L438

Best
Yun Tang

From: Abdullah bin Omar 
Sent: Tuesday, May 4, 2021 11:50
To: user@flink.apache.org 
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




Re: savepoint command in code

2021-05-04 Thread Matthias Pohl
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

[1]
https://ci.apache.org/projects/flink/flink-docs-release-1.13/docs/ops/rest_api/#jobs-jobid-stop

On Tue, May 4, 2021 at 5:51 AM Abdullah bin Omar <
abdullahbinoma...@gmail.com> 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
>