Skip to content

Commit 4b73aba

Browse files
Update the compilation problem about Pair object.
1 parent db2736f commit 4b73aba

File tree

4 files changed

+43
-46
lines changed

4 files changed

+43
-46
lines changed

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

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,9 @@
2525
import com.webank.wedatasphere.dss.orchestrator.common.entity.DSSOrchestratorInfo;
2626
import com.webank.wedatasphere.dss.orchestrator.common.entity.DSSOrchestratorVersion;
2727
import com.webank.wedatasphere.dss.orchestrator.common.entity.OrchestratorVo;
28+
import com.webank.wedatasphere.dss.orchestrator.common.ref.*;
2829
import com.webank.wedatasphere.dss.orchestrator.core.DSSOrchestrator;
2930
import com.webank.wedatasphere.dss.orchestrator.core.exception.DSSOrchestratorErrorException;
30-
import com.webank.wedatasphere.dss.orchestrator.common.ref.OrchestratorCopyRequestRef;
31-
import com.webank.wedatasphere.dss.orchestrator.common.ref.OrchestratorCopyResponseRef;
32-
import com.webank.wedatasphere.dss.orchestrator.common.ref.OrchestratorCreateRequestRef;
33-
import com.webank.wedatasphere.dss.orchestrator.common.ref.OrchestratorDeleteRequestRef;
34-
import com.webank.wedatasphere.dss.orchestrator.common.ref.OrchestratorOpenRequestRef;
35-
import com.webank.wedatasphere.dss.orchestrator.common.ref.OrchestratorUpdateRef;
3631
import com.webank.wedatasphere.dss.orchestrator.core.utils.OrchestratorUtils;
3732
import com.webank.wedatasphere.dss.orchestrator.db.dao.OrchestratorMapper;
3833
import com.webank.wedatasphere.dss.orchestrator.loader.OrchestratorManager;
@@ -46,18 +41,19 @@
4641
import com.webank.wedatasphere.dss.standard.app.sso.Workspace;
4742
import com.webank.wedatasphere.dss.standard.common.desc.AppInstance;
4843
import com.webank.wedatasphere.dss.standard.common.entity.ref.AppConnRefFactoryUtils;
49-
import java.lang.reflect.Field;
50-
import java.util.ArrayList;
51-
import java.util.Date;
52-
import java.util.List;
53-
import java.util.UUID;
54-
import javafx.util.Pair;
44+
import org.apache.linkis.protocol.util.ImmutablePair;
5545
import org.slf4j.Logger;
5646
import org.slf4j.LoggerFactory;
5747
import org.springframework.beans.factory.annotation.Autowired;
5848
import org.springframework.stereotype.Service;
5949
import org.springframework.transaction.annotation.Transactional;
6050

51+
import java.lang.reflect.Field;
52+
import java.util.ArrayList;
53+
import java.util.Date;
54+
import java.util.List;
55+
import java.util.UUID;
56+
6157

6258

6359
@Service
@@ -86,7 +82,7 @@ public OrchestratorVo createOrchestrator(String userName,
8682
//作为Orchestrator的唯一标识,包括跨环境导入导出也不发生变化。
8783
dssOrchestratorInfo.setUUID(uuid);
8884
orchestratorMapper.addOrchestrator(dssOrchestratorInfo);
89-
Pair<AppInstance, DevelopmentIntegrationStandard> standMap = OrchestratorLoaderUtils.getOrcDevelopStandard(userName, workspaceName, dssOrchestratorInfo, dssLabels);
85+
ImmutablePair<AppInstance, DevelopmentIntegrationStandard> standMap = OrchestratorLoaderUtils.getOrcDevelopStandard(userName, workspaceName, dssOrchestratorInfo, dssLabels);
9086
DSSOrchestrator dssOrchestrator = orchestratorManager.getOrCreateOrchestrator(userName,
9187
workspaceName, dssOrchestratorInfo.getType(), dssOrchestratorInfo.getAppConnName(), dssLabels);
9288
AppConn orchestratorAppConn = dssOrchestrator.getAppConn();
@@ -164,7 +160,7 @@ public void updateOrchestrator(String userName,
164160
orchestratorUpdateRef.setOrcName(dssOrchestratorInfo.getName());
165161
orchestratorUpdateRef.setUses(dssOrchestratorInfo.getUses());
166162
//update ref orchestrator info
167-
Pair<AppInstance,DevelopmentIntegrationStandard> standMap = OrchestratorLoaderUtils.getOrcDevelopStandard(userName, workspaceName, dssOrchestratorInfo, dssLabels);
163+
ImmutablePair<AppInstance,DevelopmentIntegrationStandard> standMap = OrchestratorLoaderUtils.getOrcDevelopStandard(userName, workspaceName, dssOrchestratorInfo, dssLabels);
168164
if (null != standMap ) {
169165
RefCRUDService crudService = standMap.getValue().getRefCRUDService(standMap.getKey());
170166
if (null != crudService) {
@@ -214,7 +210,7 @@ public void deleteOrchestrator(String userName,
214210
LOGGER.error("Failed to create a new ref for {}.", OrchestratorDeleteRequestRef.class, e);
215211
}
216212
assert orchestratorDeleteRequestRef != null;
217-
Pair<AppInstance,DevelopmentIntegrationStandard> standMap = OrchestratorLoaderUtils.getOrcDevelopStandard(userName, workspaceName, dssOrchestratorInfo, dssLabels);
213+
ImmutablePair<AppInstance,DevelopmentIntegrationStandard> standMap = OrchestratorLoaderUtils.getOrcDevelopStandard(userName, workspaceName, dssOrchestratorInfo, dssLabels);
218214

219215
RefCRUDService refCRUDService = standMap.getValue().getRefCRUDService (standMap.getKey());
220216

@@ -248,7 +244,7 @@ public String openOrchestrator(String userName, String workspaceName, Long orche
248244
throw new DSSOrchestratorErrorException(1000856, "can not find orc from db for orcId: " + orchestratorId);
249245
}
250246
OrchestratorOpenRequestRef orchestratorOpenRequestRef = null;
251-
Pair<AppInstance,DevelopmentIntegrationStandard> standMap = OrchestratorLoaderUtils.getOrcDevelopStandard(userName, workspaceName, dssOrchestratorInfo, dssLabels);
247+
ImmutablePair<AppInstance,DevelopmentIntegrationStandard> standMap = OrchestratorLoaderUtils.getOrcDevelopStandard(userName, workspaceName, dssOrchestratorInfo, dssLabels);
252248

253249
DSSOrchestrator dssOrchestrator = orchestratorManager.getOrCreateOrchestrator(userName,
254250
workspaceName, dssOrchestratorInfo.getType(), dssOrchestratorInfo.getAppConnName(), dssLabels);
@@ -331,7 +327,7 @@ public String rollbackOrchestrator(String userName, Long projectId, String proje
331327
dssOrchestratorVersion.setSource("rollback from version :" + version);
332328
Long appId = orchestratorMapper.getAppIdByVersion(orchestratorId, version);
333329

334-
Pair<AppInstance,DevelopmentIntegrationStandard> standMap = OrchestratorLoaderUtils.getOrcDevelopStandard(userName, workspace.getWorkspaceName(), dssOrchestratorInfo, labels);
330+
ImmutablePair<AppInstance,DevelopmentIntegrationStandard> standMap = OrchestratorLoaderUtils.getOrcDevelopStandard(userName, workspace.getWorkspaceName(), dssOrchestratorInfo, labels);
335331

336332
if(standMap == null){
337333
LOGGER.error("dev stand Service is null");

dss-framework/framework-plugins/dss-framework-orchestrator-publish/src/main/java/com/webank/wedatasphere/dss/orchestrator/publish/impl/ExportDSSOrchestratorPluginImpl.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616

1717
package com.webank.wedatasphere.dss.orchestrator.publish.impl;
1818

19-
import static com.webank.wedatasphere.dss.common.utils.ZipHelper.zipExportProject;
20-
2119
import com.webank.wedatasphere.dss.common.entity.IOType;
2220
import com.webank.wedatasphere.dss.common.exception.DSSErrorException;
2321
import com.webank.wedatasphere.dss.common.label.DSSLabel;
@@ -26,11 +24,11 @@
2624
import com.webank.wedatasphere.dss.contextservice.service.ContextService;
2725
import com.webank.wedatasphere.dss.orchestrator.common.entity.DSSOrchestratorInfo;
2826
import com.webank.wedatasphere.dss.orchestrator.common.entity.DSSOrchestratorVersion;
29-
import com.webank.wedatasphere.dss.orchestrator.core.exception.DSSOrchestratorErrorException;
30-
import com.webank.wedatasphere.dss.orchestrator.core.plugin.AbstractDSSOrchestratorPlugin;
3127
import com.webank.wedatasphere.dss.orchestrator.common.ref.OrchestratorCopyRequestRef;
3228
import com.webank.wedatasphere.dss.orchestrator.common.ref.OrchestratorCopyResponseRef;
3329
import com.webank.wedatasphere.dss.orchestrator.common.ref.OrchestratorExportRequestRef;
30+
import com.webank.wedatasphere.dss.orchestrator.core.exception.DSSOrchestratorErrorException;
31+
import com.webank.wedatasphere.dss.orchestrator.core.plugin.AbstractDSSOrchestratorPlugin;
3432
import com.webank.wedatasphere.dss.orchestrator.core.service.BMLService;
3533
import com.webank.wedatasphere.dss.orchestrator.core.utils.OrchestratorUtils;
3634
import com.webank.wedatasphere.dss.orchestrator.db.dao.OrchestratorMapper;
@@ -44,18 +42,20 @@
4442
import com.webank.wedatasphere.dss.standard.common.desc.AppInstance;
4543
import com.webank.wedatasphere.dss.standard.common.entity.ref.AbstractResponseRef;
4644
import com.webank.wedatasphere.dss.standard.common.entity.ref.AppConnRefFactoryUtils;
45+
import org.apache.linkis.protocol.util.ImmutablePair;
46+
import org.springframework.beans.factory.annotation.Autowired;
47+
import org.springframework.stereotype.Component;
48+
import org.springframework.transaction.annotation.Transactional;
49+
4750
import java.io.IOException;
4851
import java.io.InputStream;
49-
import java.lang.reflect.Field;
5052
import java.nio.file.Files;
5153
import java.nio.file.Paths;
5254
import java.util.Date;
5355
import java.util.List;
5456
import java.util.Map;
55-
import javafx.util.Pair;
56-
import org.springframework.beans.factory.annotation.Autowired;
57-
import org.springframework.stereotype.Component;
58-
import org.springframework.transaction.annotation.Transactional;
57+
58+
import static com.webank.wedatasphere.dss.common.utils.ZipHelper.zipExportProject;
5959

6060

6161
@Component
@@ -100,7 +100,7 @@ public Map<String, Object> exportOrchestrator(String userName, String workspaceN
100100
LOGGER.info("{} 开始导出Orchestrator: {} 版本ID为: {} ", userName, dssOrchestratorInfo.getName(), orcVersionId);
101101

102102
//2、导出第三方应用信息,如工作流、Visualis、Qualities
103-
Pair<AppInstance, DevelopmentIntegrationStandard> standardPair = OrchestratorLoaderUtils
103+
ImmutablePair<AppInstance, DevelopmentIntegrationStandard> standardPair = OrchestratorLoaderUtils
104104
.getOrcDevelopStandard(userName, workspaceName, dssOrchestratorInfo, dssLabels);
105105
if (null != standardPair) {
106106
RefExportService refExportService = standardPair.getValue().getRefExportService(standardPair.getKey());
@@ -182,7 +182,7 @@ public Long orchestratorVersionIncrease(Long orcId,
182182

183183
//要求AppConn对应第三方应用拷贝一个新的app出来关联,如工作流,需要新建一个新的工作流进行关联。
184184

185-
Pair<AppInstance,DevelopmentIntegrationStandard> standardPair = OrchestratorLoaderUtils.getOrcDevelopStandard(userName, workspaceName, dssOrchestratorInfo, dssLabels);
185+
ImmutablePair<AppInstance,DevelopmentIntegrationStandard> standardPair = OrchestratorLoaderUtils.getOrcDevelopStandard(userName, workspaceName, dssOrchestratorInfo, dssLabels);
186186
if(standardPair == null){
187187
LOGGER.error("dev Process Service is null");
188188
throw new DSSOrchestratorErrorException(61105, "dev Process Service is null");

dss-framework/framework-plugins/dss-framework-orchestrator-publish/src/main/java/com/webank/wedatasphere/dss/orchestrator/publish/impl/ImportDSSOrchestratorPluginImpl.java

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616

1717
package com.webank.wedatasphere.dss.orchestrator.publish.impl;
1818

19-
import static com.webank.wedatasphere.dss.orchestrator.publish.impl.ExportDSSOrchestratorPluginImpl.DEFAULT_ORC_NAME;
20-
2119
import com.webank.wedatasphere.dss.appconn.core.AppConn;
2220
import com.webank.wedatasphere.dss.common.entity.IOEnv;
2321
import com.webank.wedatasphere.dss.common.exception.DSSErrorException;
@@ -29,9 +27,9 @@
2927
import com.webank.wedatasphere.dss.orchestrator.common.entity.DSSOrchestratorInfo;
3028
import com.webank.wedatasphere.dss.orchestrator.common.entity.DSSOrchestratorVersion;
3129
import com.webank.wedatasphere.dss.orchestrator.common.protocol.RequestProjectImportOrchestrator;
30+
import com.webank.wedatasphere.dss.orchestrator.common.ref.OrchestratorImportRequestRef;
3231
import com.webank.wedatasphere.dss.orchestrator.core.DSSOrchestrator;
3332
import com.webank.wedatasphere.dss.orchestrator.core.plugin.AbstractDSSOrchestratorPlugin;
34-
import com.webank.wedatasphere.dss.orchestrator.common.ref.OrchestratorImportRequestRef;
3533
import com.webank.wedatasphere.dss.orchestrator.core.service.BMLService;
3634
import com.webank.wedatasphere.dss.orchestrator.core.utils.OrchestratorUtils;
3735
import com.webank.wedatasphere.dss.orchestrator.db.dao.OrchestratorMapper;
@@ -46,18 +44,21 @@
4644
import com.webank.wedatasphere.dss.standard.app.sso.Workspace;
4745
import com.webank.wedatasphere.dss.standard.common.desc.AppInstance;
4846
import com.webank.wedatasphere.dss.standard.common.entity.ref.RefFactory;
49-
import java.io.File;
50-
import java.io.InputStream;
51-
import java.util.Date;
52-
import java.util.List;
53-
import java.util.Map;
54-
import javafx.util.Pair;
5547
import org.apache.commons.lang.StringUtils;
48+
import org.apache.linkis.protocol.util.ImmutablePair;
5649
import org.springframework.beans.BeanUtils;
5750
import org.springframework.beans.factory.annotation.Autowired;
5851
import org.springframework.stereotype.Component;
5952
import org.springframework.transaction.annotation.Transactional;
6053

54+
import java.io.File;
55+
import java.io.InputStream;
56+
import java.util.Date;
57+
import java.util.List;
58+
import java.util.Map;
59+
60+
import static com.webank.wedatasphere.dss.orchestrator.publish.impl.ExportDSSOrchestratorPluginImpl.DEFAULT_ORC_NAME;
61+
6162

6263
@Component
6364
public class ImportDSSOrchestratorPluginImpl extends AbstractDSSOrchestratorPlugin implements ImportDSSOrchestratorPlugin {
@@ -148,14 +149,14 @@ public Long importOrchestrator(String userName, String workspaceName, String pro
148149
DSSOrchestrator dssOrchestrator = orchestratorManager.getOrCreateOrchestrator(userName,
149150
workspaceName, importDssOrchestratorInfo.getType(), importDssOrchestratorInfo.getAppConnName(), dssLabels);
150151
AppConn orchestratorAppConn = dssOrchestrator.getAppConn();
151-
Pair<AppInstance, DevelopmentIntegrationStandard> standardPair = OrchestratorLoaderUtils
152+
ImmutablePair<AppInstance, DevelopmentIntegrationStandard> standardPair = OrchestratorLoaderUtils
152153
.getOrcDevelopStandard(userName, workspaceName, importDssOrchestratorInfo, dssLabels);
153154
if (null != standardPair) {
154155
RefImportService refImportService = standardPair.getValue().getRefImportService(standardPair.getKey());
155156
OrchestratorImportRequestRef orchestratorImportRequestRef = null;
156157
try {
157158
orchestratorImportRequestRef =
158-
(OrchestratorImportRequestRef) RefFactory.INSTANCE.newRef(OrchestratorImportRequestRef.class,
159+
RefFactory.INSTANCE.newRef(OrchestratorImportRequestRef.class,
159160
orchestratorAppConn.getClass().getClassLoader(), "com.webank.wedatasphere.dss.appconn.workflow.ref");
160161
} catch (final Exception e) {
161162
DSSExceptionUtils

dss-orchestrator/dss-orchestrator-loader/src/main/java/com/webank/wedatasphere/dss/orchestrator/loader/utils/OrchestratorLoaderUtils.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
import com.webank.wedatasphere.dss.standard.app.development.standard.DevelopmentIntegrationStandard;
2626
import com.webank.wedatasphere.dss.standard.common.desc.AppInstance;
2727
import com.webank.wedatasphere.dss.standard.common.exception.NoSuchAppInstanceException;
28-
import javafx.util.Pair;
28+
29+
import org.apache.linkis.protocol.util.ImmutablePair;
2930
import org.slf4j.Logger;
3031
import org.slf4j.LoggerFactory;
3132
import org.springframework.beans.factory.annotation.Autowired;
@@ -45,14 +46,13 @@ public class OrchestratorLoaderUtils {
4546
@PostConstruct
4647
public void init(){
4748
orchestratorLoaderUtils = this;
48-
orchestratorLoaderUtils.orchestratorManager=this.orchestratorManager;
4949
}
5050

5151

52-
public static Pair<AppInstance,DevelopmentIntegrationStandard> getOrcDevelopStandard(String userName,
53-
String workspaceName,
54-
DSSOrchestratorInfo dssOrchestratorInfo,
55-
List<DSSLabel> dssLabels) throws NoSuchAppInstanceException {
52+
public static ImmutablePair<AppInstance,DevelopmentIntegrationStandard> getOrcDevelopStandard(String userName,
53+
String workspaceName,
54+
DSSOrchestratorInfo dssOrchestratorInfo,
55+
List<DSSLabel> dssLabels) throws NoSuchAppInstanceException {
5656
DSSOrchestrator dssOrchestrator = orchestratorLoaderUtils.orchestratorManager.getOrCreateOrchestrator(userName,
5757
workspaceName, dssOrchestratorInfo.getType(), dssOrchestratorInfo.getAppConnName(), dssLabels);
5858
if (null != dssOrchestrator) {
@@ -64,7 +64,7 @@ public static Pair<AppInstance,DevelopmentIntegrationStandard> getOrcDevelopStan
6464
//todo labels判别
6565
List<AppInstance> appInstance = orchestratorAppConn.getAppDesc().getAppInstancesByLabels(dssLabels);
6666
if (appInstance.size() > 0 && null != developmentIntegrationStandard) {
67-
return new Pair(appInstance.get(0),developmentIntegrationStandard);
67+
return new ImmutablePair<>(appInstance.get(0),developmentIntegrationStandard);
6868

6969
}else{
7070
return null;

0 commit comments

Comments
 (0)