|
22 | 22 | import com.webank.wedatasphere.dss.linkis.node.execution.job.Job; |
23 | 23 | import com.webank.wedatasphere.dss.linkis.node.execution.job.LinkisJob; |
24 | 24 | import com.webank.wedatasphere.dss.linkis.node.execution.service.BuildJobAction; |
| 25 | +import org.apache.commons.collections.MapUtils; |
25 | 26 | import org.apache.commons.lang3.SerializationUtils; |
26 | 27 | import org.apache.commons.lang3.StringUtils; |
27 | 28 | import org.apache.linkis.common.conf.CommonVars; |
28 | 29 | import org.apache.linkis.manager.label.constant.LabelKeyConstant; |
| 30 | +import org.apache.linkis.manager.label.entity.engine.EngineType; |
29 | 31 | import org.apache.linkis.manager.label.entity.engine.EngineTypeLabel; |
30 | 32 | import org.apache.linkis.manager.label.utils.EngineTypeLabelCreator; |
31 | 33 | import org.apache.linkis.protocol.constants.TaskConstant; |
@@ -142,7 +144,31 @@ public JobSubmitAction getSubmitAction(Job job) throws LinkisJobExecutionErrorEx |
142 | 144 | engineTypeLabel.setVersion(NEBULA_ENGINE_VERSION.getValue()); |
143 | 145 | } |
144 | 146 |
|
145 | | - labels.put(LabelKeyConstant.ENGINE_TYPE_KEY, engineTypeLabel.getStringValue()); |
| 147 | + String stringValue = engineTypeLabel.getStringValue(); |
| 148 | + // spark3开关开启,并且引擎是Spark |
| 149 | + if(WORKFLOW_SPARK3_SWITCH.getValue() && EngineType.SPARK().toString().equalsIgnoreCase(engineTypeLabel.getEngineType())){ |
| 150 | + |
| 151 | + Map<String,Object> variableMap = TaskUtils.getVariableMap(job.getParams()); |
| 152 | + |
| 153 | + // 判断sparkVersion参数为3,则使用spark3的引擎版本,否则使用spark默认引擎版本 |
| 154 | + if(MapUtils.isNotEmpty(variableMap) |
| 155 | + && variableMap.get("sparkVersion")!=null |
| 156 | + && StringUtils.startsWithIgnoreCase(variableMap.get("sparkVersion").toString().trim(),"3")){ |
| 157 | + |
| 158 | + EngineTypeLabel spark3EngineType= new EngineTypeLabel(); |
| 159 | + spark3EngineType.setEngineType(engineTypeLabel.getEngineType()); |
| 160 | + spark3EngineType.setVersion(SPARK3_ENGINE_VERSION.getValue()); |
| 161 | + stringValue = spark3EngineType.getStringValue(); |
| 162 | + |
| 163 | + logger.info("{} job name ,spark3 engineType stringValue is {}",job.getJobName(),stringValue); |
| 164 | + |
| 165 | + } |
| 166 | + |
| 167 | + } |
| 168 | + |
| 169 | + logger.info("{} job name ,engineType stringValue is {}",job.getJobName(),stringValue); |
| 170 | + |
| 171 | + labels.put(LabelKeyConstant.ENGINE_TYPE_KEY, stringValue); |
146 | 172 | labels.put(LabelKeyConstant.USER_CREATOR_TYPE_KEY, job.getUser() + "-" + LINKIS_JOB_CREATOR_1_X.getValue(job.getJobProps())); |
147 | 173 | labels.put(LabelKeyConstant.CODE_TYPE_KEY, parseRunType(job.getEngineType(), job.getRunType(), job)); |
148 | 174 |
|
|
0 commit comments