You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampark.apache.org by be...@apache.org on 2024/10/08 04:22:30 UTC
(incubator-streampark) branch dev-2.1.5 updated (6aff7fa2d -> 90c86ea7a)
This is an automated email from the ASF dual-hosted git repository.
benjobs pushed a change to branch dev-2.1.5
in repository https://gitbox.apache.org/repos/asf/incubator-streampark.git
discard 6aff7fa2d [Improve] app backup minor improvements
new 90c86ea7a [Improve] app backup minor improvements
This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version. This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:
* -- * -- B -- O -- O -- O (6aff7fa2d)
\
N -- N -- N refs/heads/dev-2.1.5 (90c86ea7a)
You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.
Any revisions marked "omit" are not gone; other references still
refer to them. Any revisions marked "discard" are gone forever.
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
(incubator-streampark) 01/01: [Improve] app backup minor improvements
Posted by be...@apache.org.
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
commit 90c86ea7aeeacc02bba9277a1e822076ec33c68c
Author: benjobs <be...@apache.org>
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);
}
}