Skip to content

Commit f61f756

Browse files
committed
dss-server: fix import
1 parent 0fc3ae3 commit f61f756

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

dss-framework/dss-framework-orchestrator-server/src/main/java/com/webank/wedatasphere/dss/orchestrator/server/entity/vo/OrchestratorBaseInfo.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ public static OrchestratorBaseInfo convertFrom(DSSOrchestratorInfo dssInfo){
282282
OrchestratorBaseInfo baseInfo = new OrchestratorBaseInfo();
283283

284284
// 直接对应的属性
285-
baseInfo.setId(dssInfo.getId());
285+
baseInfo.setOrchestratorVersionId(dssInfo.getId());
286286
baseInfo.setProjectId(dssInfo.getProjectId());
287287
baseInfo.setWorkspaceId(dssInfo.getWorkspaceId());
288288
baseInfo.setOrchestratorName(dssInfo.getName());

dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/utils/ExportAndImportSupportUtils.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
package com.webank.wedatasphere.dss.framework.project.utils;
2+
import com.webank.wedatasphere.dss.common.exception.DSSErrorException;
23
import com.webank.wedatasphere.dss.common.utils.IoUtils;
4+
import org.slf4j.Logger;
5+
import org.slf4j.LoggerFactory;
36

47
import java.io.File;
58
import java.io.IOException;
@@ -15,6 +18,7 @@
1518
* Date: 2024/4/19
1619
*/
1720
public class ExportAndImportSupportUtils {
21+
private static final Logger LOGGER = LoggerFactory.getLogger(ExportAndImportSupportUtils.class);
1822
private static final String EXTERNAL_RESOURCES = ".external-resources";
1923
private static final String META_CONF = ".metaConf";
2024

@@ -50,8 +54,8 @@ public static Map<String,Path> separateFlows(String sourceDir, String projectNam
5054
copyDirectory(workflowDir, newWorkflowDir + File.separator + workflow);
5155
workFlowProjectPaths.put(workflow, Paths.get(newWorkflowDir));
5256
} catch (IOException e) {
53-
System.err.println("Error while copying workflow " + workflow + ": " + e.getMessage());
54-
e.printStackTrace();
57+
LOGGER.error("Error while copying workflow " + workflow + ": " + e);
58+
throw new DSSErrorException(70001, "复制工作流失败,原因为:" + e);
5559
}
5660

5761

@@ -62,6 +66,10 @@ public static Map<String,Path> separateFlows(String sourceDir, String projectNam
6266

6367
// 复制整个目录
6468
private static void copyDirectory(String sourceDirectory, String destinationDirectory) throws IOException {
69+
File file = new File(sourceDirectory);
70+
if (!file.exists()) {
71+
return ;
72+
}
6573
Files.walk(Paths.get(sourceDirectory))
6674
.forEach(source -> {
6775
Path destination = Paths.get(destinationDirectory, source.toString().substring(sourceDirectory.length()));

0 commit comments

Comments
 (0)