In the 2 savepoint related REST APIs:
POST /jobs/:jobid/savepoints which triggers an async savepoint operation and returns a trigger ID.
GET /jobs/:jobid/savepoints/:triggerid which returns the status of the operation by trigger ID.
The first API takes a parameter target-directory
, but it is unclear whether it is the exact dir or it is the parent dir within which Flink will generate a subdir whose name is the savepoint ID. Based on my experience with Flink CLI, I think it might be a parent dir, but if that is the case, how do I get the savepoint ID? It is not documented in the 2nd API.
I figured it out by printing out the response. Here are examples of success and failure.
1) success:
{
"status":{"id":"COMPLETED"},
"operation":{
"location":"file:/savepoints-dir/savepoint-ad4025-dd46c1bd1c80"
}
}
2) failure:
{
"status":{"id":"COMPLETED"},
"operation":{
"failure-cause":{
"class": "java.util.concurrent.CompletionException",
"stack-trace": "..."
}
}
}