wolfboys commented on code in PR #2268:
URL: 
https://github.com/apache/incubator-streampark/pull/2268#discussion_r1098063884


##########
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();

Review Comment:
   only on yarn mode, `jobManagerUrl` has value, else not. 



##########
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:
   I suggest move this method in `FlinkSubmitter`, and the service layer of the 
platform just call it.



-- 
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]

Reply via email to