This is an automated email from the ASF dual-hosted git repository.
peacewong pushed a commit to branch dev-1.3.2
in repository https://gitbox.apache.org/repos/asf/linkis.git
The following commit(s) were added to refs/heads/dev-1.3.2 by this push:
new 10d771693 Engine exception prompt optimization (#4256)
10d771693 is described below
commit 10d77169345a8326d8a9e65399e5d6e2e56cc185
Author: binbincheng <[email protected]>
AuthorDate: Thu Feb 23 21:13:33 2023 +0800
Engine exception prompt optimization (#4256)
* Engine exception prompt optimization
* Engine exception prompt optimization
* Engine exception prompt optimization
* Engine exception prompt optimization
* update EngineconnCoreErrorCodeSummary.java
---
docs/errorcode/linkis-engineconn-plugin-core-errorcode.md | 1 +
.../errorcode/EngineconnCoreErrorCodeSummary.java | 3 +++
.../server/service/DefaultEngineConnResourceService.scala | 15 +++++++++++----
3 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/docs/errorcode/linkis-engineconn-plugin-core-errorcode.md
b/docs/errorcode/linkis-engineconn-plugin-core-errorcode.md
index b594ab8d9..67a499956 100644
--- a/docs/errorcode/linkis-engineconn-plugin-core-errorcode.md
+++ b/docs/errorcode/linkis-engineconn-plugin-core-errorcode.md
@@ -3,6 +3,7 @@
| module name(模块名) | error code(错误码) | describe(描述) |enumeration name(枚举)|
Exception Class(类名)|
| -------- | -------- | ----- |-----|-----|
|linkis-engineconn-plugin-core |10001|Failed to
createEngineConnLaunchRequest(创建
EngineConnLaunchRequest失败)|FAILED_CREATE_ELR|EngineconnCoreErrorCodeSummary|
+|linkis-engineconn-plugin-core |10001|The engine plug-in material is abnormal,
please check whether the material is uploaded
successfully(引擎插件物料异常,请检查物料是否上传成功)|EN_PLUGIN_MATERIAL_SOURCE_EXCEPTION|EngineconnCoreErrorCodeSummary|
|linkis-engineconn-plugin-core |10001|EngineTypeLabel are requested(需要参数
EngineTypeLabel)|ETL_REQUESTED|EngineconnCoreErrorCodeSummary|
|linkis-engineconn-plugin-core |20000|Cannot instance
EngineConnExecution(无法实例化
EngineConnExecution)|CANNOT_INSTANCE_ECE|EngineconnCoreErrorCodeSummary|
|linkis-engineconn-plugin-core |20000|Cannot find default
ExecutorFactory(找不到默认的
ExecutorFactory)|CANNOT_DEFAULT_EF|EngineconnCoreErrorCodeSummary|
diff --git
a/linkis-computation-governance/linkis-engineconn/linkis-engineconn-plugin-core/src/main/java/org/apache/linkis/manager/engineplugin/errorcode/EngineconnCoreErrorCodeSummary.java
b/linkis-computation-governance/linkis-engineconn/linkis-engineconn-plugin-core/src/main/java/org/apache/linkis/manager/engineplugin/errorcode/EngineconnCoreErrorCodeSummary.java
index f7fd0165b..2f9e54f80 100644
---
a/linkis-computation-governance/linkis-engineconn/linkis-engineconn-plugin-core/src/main/java/org/apache/linkis/manager/engineplugin/errorcode/EngineconnCoreErrorCodeSummary.java
+++
b/linkis-computation-governance/linkis-engineconn/linkis-engineconn-plugin-core/src/main/java/org/apache/linkis/manager/engineplugin/errorcode/EngineconnCoreErrorCodeSummary.java
@@ -21,6 +21,9 @@ import org.apache.linkis.common.errorcode.LinkisErrorCode;
public enum EngineconnCoreErrorCodeSummary implements LinkisErrorCode {
FAILED_CREATE_ELR(10001, "Failed to createEngineConnLaunchRequest(创建
EngineConnLaunchRequest失败)"),
+ EN_PLUGIN_MATERIAL_SOURCE_EXCEPTION(
+ 10001,
+ "The engine plug-in material is abnormal, please check whether the
material is uploaded successfully(引擎插件物料异常,请检查物料是否上传成功)"),
ETL_REQUESTED(10001, "EngineTypeLabel are requested(需要参数 EngineTypeLabel)"),
CANNOT_INSTANCE_ECE(20000, "Cannot instance EngineConnExecution(无法实例化
EngineConnExecution)"),
diff --git
a/linkis-computation-governance/linkis-manager/linkis-application-manager/src/main/scala/org/apache/linkis/engineplugin/server/service/DefaultEngineConnResourceService.scala
b/linkis-computation-governance/linkis-manager/linkis-application-manager/src/main/scala/org/apache/linkis/engineplugin/server/service/DefaultEngineConnResourceService.scala
index 3c2c88ea1..bd08a225a 100644
---
a/linkis-computation-governance/linkis-manager/linkis-application-manager/src/main/scala/org/apache/linkis/engineplugin/server/service/DefaultEngineConnResourceService.scala
+++
b/linkis-computation-governance/linkis-manager/linkis-application-manager/src/main/scala/org/apache/linkis/engineplugin/server/service/DefaultEngineConnResourceService.scala
@@ -37,6 +37,7 @@ import
org.apache.linkis.manager.engineplugin.errorcode.EngineconnCoreErrorCodeS
import org.apache.linkis.rpc.message.annotation.Receiver
import org.apache.commons.lang3.StringUtils
+import org.apache.commons.lang3.exception.ExceptionUtils
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.stereotype.Component
@@ -241,14 +242,20 @@ class DefaultEngineConnResourceService extends
EngineConnResourceService with Lo
val engineConnBmlResources = asScalaBufferConverter(
engineConnBmlResourceDao.getAllEngineConnBmlResource(engineConnType, "v"
+ version)
)
- val confBmlResource = engineConnBmlResources.asScala
+ val confBmlResourceMap = engineConnBmlResources.asScala
.find(_.getFileName == LaunchConstants.ENGINE_CONN_CONF_DIR_NAME +
".zip")
.map(parseToBmlResource)
- .get
- val libBmlResource = engineConnBmlResources.asScala
+ val libBmlResourceMap = engineConnBmlResources.asScala
.find(_.getFileName == LaunchConstants.ENGINE_CONN_LIB_DIR_NAME + ".zip")
.map(parseToBmlResource)
- .get
+ if (confBmlResourceMap.isEmpty || libBmlResourceMap.isEmpty) {
+ throw new EngineConnPluginErrorException(
+ EN_PLUGIN_MATERIAL_SOURCE_EXCEPTION.getErrorCode,
+ EN_PLUGIN_MATERIAL_SOURCE_EXCEPTION.getErrorDesc
+ )
+ }
+ val confBmlResource = confBmlResourceMap.get
+ val libBmlResource = libBmlResourceMap.get
val otherBmlResources = engineConnBmlResources.asScala
.filterNot(r =>
r.getFileName == LaunchConstants.ENGINE_CONN_CONF_DIR_NAME + ".zip" ||
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]