This is an automated email from the ASF dual-hosted git repository.
benjobs pushed a commit to branch dev-2.1.5
in repository https://gitbox.apache.org/repos/asf/incubator-streampark.git
The following commit(s) were added to refs/heads/dev-2.1.5 by this push:
new 6aff7fa2d [Improve] app backup minor improvements
6aff7fa2d is described below
commit 6aff7fa2d9fb993d93c00575fc502eb1603c1978
Author: benjobs <[email protected]>
AuthorDate: Tue Oct 8 12:18:59 2024 +0800
[Improve] app backup minor improvements
---
.../service/impl/ApplicationBackUpServiceImpl.java | 43 +++++++---------------
1 file changed, 14 insertions(+), 29 deletions(-)
diff --git
a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/ApplicationBackUpServiceImpl.java
b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/ApplicationBackUpServiceImpl.java
index 5a95ff5e7..780acff70 100644
---
a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/ApplicationBackUpServiceImpl.java
+++
b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/ApplicationBackUpServiceImpl.java
@@ -207,37 +207,22 @@ public class ApplicationBackUpServiceImpl
@Override
@Transactional(rollbackFor = {Exception.class})
public void backup(Application application, FlinkSql flinkSql) {
- // basic configuration file backup
- log.info("skip backup..");
- if (application != null) {
- return;
+ ApplicationConfig config = configService.getEffective(application.getId());
+ if (config != null) {
+ application.setConfigId(config.getId());
+ }
+ // flink sql tasks need to back up sql and dependencies
+ int version = 1;
+ if (flinkSql != null) {
+ application.setSqlId(flinkSql.getId());
+ version = flinkSql.getVersion();
+ } else if (config != null) {
+ version = config.getVersion();
}
- String appHome =
- (application.isCustomCodeJob() && application.isCICDJob())
- ? application.getDistHome()
- : application.getAppHome();
- FsOperator fsOperator = application.getFsOperator();
- if (fsOperator.exists(appHome)) {
- // move files to back up directory
- ApplicationConfig config =
configService.getEffective(application.getId());
- if (config != null) {
- application.setConfigId(config.getId());
- }
- // flink sql tasks need to back up sql and dependencies
- int version = 1;
- if (flinkSql != null) {
- application.setSqlId(flinkSql.getId());
- version = flinkSql.getVersion();
- } else if (config != null) {
- version = config.getVersion();
- }
- ApplicationBackUp applicationBackUp = new ApplicationBackUp(application);
- applicationBackUp.setVersion(version);
+ ApplicationBackUp applicationBackUp = new ApplicationBackUp(application);
+ applicationBackUp.setVersion(version);
- this.save(applicationBackUp);
- fsOperator.mkdirs(applicationBackUp.getPath());
- fsOperator.copyDir(appHome, applicationBackUp.getPath());
- }
+ this.save(applicationBackUp);
}
}