Skip to content

Commit ff6a328

Browse files
author
xlinliu
committed
企业明文复制接口跳过第三方节点复制
1 parent a13deba commit ff6a328

File tree

13 files changed

+51
-22
lines changed

13 files changed

+51
-22
lines changed

dss-appconn/appconns/dss-workflow-appconn/src/main/java/com/webank/wedatasphere/dss/appconn/workflow/opertion/WorkflowRefCopyOperation.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ public RefJobContentResponseRef copyRef(ThirdlyRequestRef.CopyWitContextRequestR
4747
String contextIdStr = workflowCopyRequestRef.getContextId();
4848
String projectName = workflowCopyRequestRef.getProjectName();
4949
List<String> enableNodeList = (List<String>) workflowCopyRequestRef.getRefJobContent().get(OrchestratorRefConstant.ORCHESTRATION_ENABLE_NODE);
50+
Boolean skipThirdAppconn=(Boolean) workflowCopyRequestRef.getRefJobContent().get(OrchestratorRefConstant.ORCHESTRATION_SKIP_THIRD_NODE);
5051
String flowProxyUser = (String) workflowCopyRequestRef.getRefJobContent().get(OrchestratorRefConstant.FLOW_PROXY_USER);
5152
//插入version
5253
String version = workflowCopyRequestRef.getNewVersion();
@@ -58,7 +59,7 @@ public RefJobContentResponseRef copyRef(ThirdlyRequestRef.CopyWitContextRequestR
5859
workflowCopyRequestRef.getWorkspace(), appId, contextIdStr,
5960
projectName, version, description, workflowCopyRequestRef.getDSSLabels(),
6061
targetProjectId, (String) nodeSuffix.orElse(null), (String) newFlowName.orElse(null),
61-
enableNodeList,flowProxyUser);
62+
enableNodeList,flowProxyUser,Boolean.TRUE.equals(skipThirdAppconn));
6263
List<DSSLabel> dssLabels = workflowCopyRequestRef.getDSSLabels();
6364
Sender tempSend = DSSSenderServiceFactory.getOrCreateServiceInstance().getWorkflowSender(dssLabels);
6465
ResponseCopyWorkflow responseCopyWorkflow = RpcAskUtils.processAskException(tempSend.ask(requestCopyWorkflow),

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

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ public class OrchestratorCopyVo implements Serializable {
2727
private List<String> enableNodeIdList;
2828

2929
private String flowProxyUser;
30+
private boolean skipThirdNode;
3031

3132
private OrchestratorCopyVo(Builder builder) {
3233
this.username = builder.username;
@@ -43,6 +44,7 @@ private OrchestratorCopyVo(Builder builder) {
4344
this.instanceName = builder.instanceName;
4445
this.enableNodeIdList = builder.enableNodeIdList;
4546
this.flowProxyUser = builder.flowProxyUser;
47+
this.skipThirdNode=builder.skipThirdNode;
4648
}
4749

4850

@@ -64,6 +66,7 @@ public static class Builder {
6466
private List<String> enableNodeIdList;
6567

6668
private String flowProxyUser;
69+
private boolean skipThirdNode;
6770

6871
public Builder(String username, Long sourceProjectId, String sourceProjectName, Long targetProjectId,
6972
String targetProjectName, DSSOrchestratorInfo orchestrator, String targetOrchestratorName,
@@ -85,7 +88,7 @@ public Builder(String username, Long sourceProjectId, String sourceProjectName,
8588
public Builder(String username, Long sourceProjectId, String sourceProjectName, Long targetProjectId,
8689
String targetProjectName, DSSOrchestratorInfo orchestrator, String targetOrchestratorName,
8790
String workflowNodeSuffix, DSSLabel dssLabel, Workspace workspace, String instanceName,
88-
List<String> enableNodeIdList,String flowProxyUser) {
91+
List<String> enableNodeIdList,String flowProxyUser, boolean skipThirdNode) {
8992

9093
this.username = username;
9194
this.sourceProjectId = sourceProjectId;
@@ -100,6 +103,7 @@ public Builder(String username, Long sourceProjectId, String sourceProjectName,
100103
this.instanceName = instanceName;
101104
this.enableNodeIdList = enableNodeIdList;
102105
this.flowProxyUser = flowProxyUser;
106+
this.skipThirdNode=skipThirdNode;
103107
}
104108

105109

@@ -177,5 +181,13 @@ public String getFlowProxyUser() {
177181
public void setFlowProxyUser(String flowProxyUser) {
178182
this.flowProxyUser = flowProxyUser;
179183
}
184+
185+
public boolean getSkipThirdNode() {
186+
return skipThirdNode;
187+
}
188+
189+
public void setSkipThirdNode(boolean skipThirdNode) {
190+
this.skipThirdNode = skipThirdNode;
191+
}
180192
}
181193

dss-framework/dss-framework-orchestrator-server/src/main/java/com/webank/wedatasphere/dss/orchestrator/server/job/OrchestratorCopyJob.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ private void copyOrchestrator() {
7676
try {
7777
doOrchestratorCopy(orchestratorCopyVo.getUsername(), orchestratorCopyVo.getWorkspace(), newOrchestrator,
7878
orchestratorCopyVo.getTargetProjectName(), Lists.newArrayList(orchestratorCopyVo.getDssLabel()), appId,
79-
orchestratorCopyVo.getEnableNodeIdList(),orchestratorCopyVo.getFlowProxyUser());
79+
orchestratorCopyVo.getEnableNodeIdList(),orchestratorCopyVo.getFlowProxyUser(),orchestratorCopyVo.getSkipThirdNode());
8080
} catch (Exception e) {
8181
//保存错误信息
8282
String errorMsg = "CopyOrcError: " + e.getMessage();
@@ -106,7 +106,8 @@ private void doOrchestratorCopy(String userName,
106106
String projectName,
107107
List<DSSLabel> dssLabels, Long appId,
108108
List<String> enableNodeIdList,
109-
String flowProxyUser) throws Exception {
109+
String flowProxyUser,
110+
boolean skipThirdNode) throws Exception {
110111
String copyInitVersion = OrchestratorUtils.generateNewCopyVersion(orchestratorCopyVo.getWorkflowNodeSuffix());
111112
String contextId = orchestratorCopyEnv.getContextService().createContextID(workspace.getWorkspaceName(), projectName, dssOrchestratorInfo.getName(), copyInitVersion, userName);
112113
DSSOrchestratorVersion dssOrchestratorVersion = new DSSOrchestratorVersion();
@@ -134,6 +135,7 @@ private void doOrchestratorCopy(String userName,
134135
refJobContent.put(OrchestratorRefConstant.ORCHESTRATION_NODE_SUFFIX, orchestratorCopyVo.getWorkflowNodeSuffix());
135136
// 添加启用节点ID列表
136137
refJobContent.put(OrchestratorRefConstant.ORCHESTRATION_ENABLE_NODE, enableNodeIdList);
138+
refJobContent.put(OrchestratorRefConstant.ORCHESTRATION_SKIP_THIRD_NODE, skipThirdNode);
137139
// 添加copy工作流的代理用户
138140
refJobContent.put(OrchestratorRefConstant.FLOW_PROXY_USER,flowProxyUser);
139141
requestRef.setNewVersion(dssOrchestratorVersion.getVersion()).setRefJobContent(refJobContent);

dss-framework/dss-framework-orchestrator-server/src/main/java/com/webank/wedatasphere/dss/orchestrator/server/restful/DSSFrameworkOrchestratorRestful.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ public Message copyOrchestrator(@RequestBody OrchestratorCopyRequest orchestrato
230230
return Message.error("当前工作流正在被复制,不允许再次复制");
231231
}
232232

233-
String copyJobId = orchestratorFrameworkService.copyOrchestrator(username, orchestratorCopyRequest, workspace,null,null);
233+
String copyJobId = orchestratorFrameworkService.copyOrchestrator(username, orchestratorCopyRequest, workspace,null,null,false);
234234
AuditLogUtils.printLog(username, workspace.getWorkspaceId(), workspace.getWorkspaceName(), TargetTypeEnum.ORCHESTRATOR,
235235
orchestratorCopyRequest.getSourceOrchestratorId(), orchestratorCopyRequest.getSourceOrchestratorName(), OperateTypeEnum.COPY, orchestratorCopyRequest);
236236

dss-framework/dss-framework-orchestrator-server/src/main/java/com/webank/wedatasphere/dss/orchestrator/server/service/OrchestratorFrameworkService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public interface OrchestratorFrameworkService {
4343

4444
OrchestratorUnlockVo unlockOrchestrator(String username, Workspace workspace, OrchestratorUnlockRequest request) throws DSSErrorException;
4545

46-
String copyOrchestrator(String username, OrchestratorCopyRequest orchestratorCopyRequest, Workspace workspace,List<String> enableNodeIdList,String flowProxyUser) throws Exception;
46+
String copyOrchestrator(String username, OrchestratorCopyRequest orchestratorCopyRequest, Workspace workspace,List<String> enableNodeIdList,String flowProxyUser,boolean skipThirdNode) throws Exception;
4747

4848
Pair<Long, List<OrchestratorCopyHistory>> getOrchestratorCopyHistory(String username, Workspace workspace, Long orchestratorId, Integer currentPage, Integer pageSize) throws Exception;
4949

dss-framework/dss-framework-orchestrator-server/src/main/java/com/webank/wedatasphere/dss/orchestrator/server/service/impl/OrchestratorFrameworkServiceImpl.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ public DSSOrchestratorVersion getLatestOrchestratorVersion(Long orchestratorId)
409409

410410
@Override
411411
public String copyOrchestrator(String username, OrchestratorCopyRequest orchestratorCopyRequest, Workspace workspace,
412-
List<String> enableNodeIdList,String flowProxyUser) throws Exception {
412+
List<String> enableNodeIdList,String flowProxyUser, boolean skipThirdNode) throws Exception {
413413
if (orchestratorCopyRequest.getTargetOrchestratorName().length() > MAX_NAME_LENGTH) {
414414
DSSFrameworkErrorException.dealErrorException(60000, "编排名称过长,请限制在" + MAX_NAME_LENGTH + "以内");
415415
}
@@ -438,7 +438,7 @@ public String copyOrchestrator(String username, OrchestratorCopyRequest orchestr
438438
OrchestratorCopyVo orchestratorCopyVo = new OrchestratorCopyVo.Builder(username, sourceProject.getId(), sourceProject.getName(), targetProject.getId(),
439439
targetProject.getName(), sourceOrchestratorInfo, orchestratorCopyRequest.getTargetOrchestratorName(),
440440
orchestratorCopyRequest.getWorkflowNodeSuffix(), new EnvDSSLabel(dssLabel),
441-
workspace, Sender.getThisInstance(), enableNodeIdList, flowProxyUser).setCopyTaskId(null).build();
441+
workspace, Sender.getThisInstance(), enableNodeIdList, flowProxyUser,skipThirdNode).setCopyTaskId(null).build();
442442
OrchestratorCopyJob orchestratorCopyJob = new OrchestratorCopyJob();
443443
orchestratorCopyJob.setTargetProject(targetProject);
444444
orchestratorCopyJob.setOrchestratorCopyVo(orchestratorCopyVo);
@@ -1050,7 +1050,7 @@ public DSSOrchestratorCopyInfo encryptCopyOrchestrator(EncryptCopyOrchestratorRe
10501050
orchestratorCopyRequest.setTargetProjectName(dssProject.getName());
10511051
orchestratorCopyRequest.setWorkflowNodeSuffix(request.getCopyNodeSuffix());
10521052

1053-
String copyJobId = copyOrchestrator(username, orchestratorCopyRequest, workspace, enableNodeIdList,request.getFlowProxyUser());
1053+
String copyJobId = copyOrchestrator(username, orchestratorCopyRequest, workspace, enableNodeIdList,request.getFlowProxyUser(),true);
10541054

10551055
DSSOrchestratorCopyInfo dssOrchestratorCopyInfo = new DSSOrchestratorCopyInfo();
10561056
dssOrchestratorCopyInfo.setId(copyJobId);

dss-orchestrator/dss-orchestrator-common/src/main/java/com/webank/wedatasphere/dss/orchestrator/common/ref/OrchestratorRefConstant.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ public interface OrchestratorRefConstant {
6262
public static final String FLOW_STATUS_UNPUBLISHED = "unpublished";
6363

6464
public static final String ORCHESTRATION_ENABLE_NODE = "autoEnableNodeId";
65+
public static final String ORCHESTRATION_SKIP_THIRD_NODE = "skipthirdNode";
6566

6667
public static final String FLOW_PROXY_USER="flowProxyUser";
6768

dss-orchestrator/orchestrators/dss-workflow/dss-workflow-common/src/main/java/com/webank/wedatasphere/dss/workflow/common/protocol/RequestCopyWorkflow.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ public class RequestCopyWorkflow {
3939
private List<String> enableNodeList;
4040

4141
private String flowProxyUser;
42+
private boolean skipThirdAppconn;
4243

4344
public RequestCopyWorkflow(String userName,
4445
Workspace workspace,
@@ -79,7 +80,8 @@ public RequestCopyWorkflow(String userName,
7980
String nodeSuffix,
8081
String newFlowName,
8182
List<String> enableNodeList,
82-
String flowProxyUser) {
83+
String flowProxyUser,
84+
boolean skipThirdAppconn) {
8385

8486
this.userName = userName;
8587
this.workspace = workspace;
@@ -94,6 +96,7 @@ public RequestCopyWorkflow(String userName,
9496
this.newFlowName = newFlowName;
9597
this.enableNodeList = enableNodeList;
9698
this.flowProxyUser = flowProxyUser;
99+
this.skipThirdAppconn=skipThirdAppconn;
97100

98101
}
99102

@@ -193,6 +196,14 @@ public void setEnableNodeList(List<String> enableNodeList) {
193196
this.enableNodeList = enableNodeList;
194197
}
195198

199+
public boolean getSkipThirdAppconn() {
200+
return skipThirdAppconn;
201+
}
202+
203+
public void setSkipThirdAppconn(boolean skipThirdAppconn) {
204+
this.skipThirdAppconn = skipThirdAppconn;
205+
}
206+
196207
public String getFlowProxyUser() {
197208
return flowProxyUser;
198209
}

dss-orchestrator/orchestrators/dss-workflow/dss-workflow-server/src/main/java/com/webank/wedatasphere/dss/workflow/DefaultWorkFlowManager.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,10 +165,10 @@ public DSSFlow copyRootFlowWithSubFlows(String userName, Long rootFlowId, Worksp
165165
String projectName, String contextIdStr, String orcVersion,
166166
String description, List<DSSLabel> dssLabels, String nodeSuffix,
167167
String newFlowName, Long newProjectId,List<String> enableNodeList,
168-
String flowProxyUser) throws DSSErrorException, IOException {
168+
String flowProxyUser,boolean skipThirdAppconn) throws DSSErrorException, IOException {
169169
return flowService.copyRootFlow(rootFlowId, userName, workspace, projectName,
170170
orcVersion, contextIdStr, description, dssLabels, nodeSuffix, newFlowName, newProjectId,
171-
enableNodeList,flowProxyUser);
171+
enableNodeList,flowProxyUser,skipThirdAppconn);
172172
}
173173

174174
@Override

dss-orchestrator/orchestrators/dss-workflow/dss-workflow-server/src/main/java/com/webank/wedatasphere/dss/workflow/WorkFlowManager.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ DSSFlow copyRootFlowWithSubFlows(String userName,
7878
List<DSSLabel> dssLabels,String nodeSuffix,
7979
String newFlowName, Long newProjectId,
8080
List<String> enableNodeList,
81-
String flowProxyUser) throws DSSErrorException, IOException;
81+
String flowProxyUser,
82+
boolean skipThirdAppconn) throws DSSErrorException, IOException;
8283

8384

8485
DSSFlow queryWorkflow(String userName, Long rootFlowId) throws DSSErrorException;

0 commit comments

Comments
 (0)