RocMarshal commented on code in PR #2268:
URL:
https://github.com/apache/incubator-streampark/pull/2268#discussion_r1102770619
##########
streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/controller/SavePointController.java:
##########
@@ -64,4 +66,11 @@ public RestResponse delete(Long id) throws InternalException
{
Boolean deleted = savePointService.delete(id, application);
return RestResponse.success(deleted);
}
+
+ @PostMapping("trigger")
+ @RequiresPermissions("savepoint:trigger")
+ public RestResponse trigger(Long appId, @Nullable String savepointPath) {
Review Comment:
done. thank you.
##########
streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/SavePointServiceImpl.java:
##########
@@ -114,6 +128,41 @@ public SavePoint getLatest(Long id) {
return this.getOne(queryWrapper);
}
+ @Override
+ public void trigger(Long appId, @Nullable String savepointPath) {
+ log.info("Start to trigger savepoint for app {}", appId);
+ Application app = appService.getById(appId);
+ AssertUtils.notNull(app, String.format("The application %s doesn't
exist.", appId));
+ String trackingUrl = app.getJobManagerUrl();
+ AssertUtils.state(
+ StringUtils.isNotEmpty(trackingUrl),
+ String.format("The flink trackingUrl for app[%s] isn't available.",
appId));
+ AssertUtils.state(
+ StringUtils.isNotEmpty(app.getJobId()),
+ String.format("The jobId of application[%s] is absent.", appId));
+ String triggerId = triggerSavepoint(trackingUrl, app, savepointPath);
+ log.info("Request savepoint successful in triggerId {}", triggerId);
+ }
+
+ private String triggerSavepoint(
Review Comment:
updated. Thx for the review.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]