diff --git a/.github/workflows/dead-link-checker.yml b/.github/workflows/dead-link-checker.yml
index 79ddae899..8de24aac8 100644
--- a/.github/workflows/dead-link-checker.yml
+++ b/.github/workflows/dead-link-checker.yml
@@ -1,6 +1,6 @@
name: Dead Link Check
-on: [push, pull_request]
+on: [push]
jobs:
dead-links-check:
diff --git a/Dockerfile b/Dockerfile
index 294e26a9e..50fd364a9 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,8 +1,8 @@
FROM harbor.local.hching.com/library/jdk:8u301
-ADD assembly-package/target/wedatasphere-exchangis-1.0.0-RC1.tar.gz /opt/wedatasphere-exchangis.tar.gz
+ADD assembly-package/target/wedatasphere-exchangis-1.1.2.tar.gz /opt/wedatasphere-exchangis.tar.gz
-RUN cd /opt/wedatasphere-exchangis.tar.gz/packages/ && tar -zxf exchangis-server_1.0.0-RC1.tar.gz && cd /opt/wedatasphere-exchangis.tar.gz/sbin
+RUN cd /opt/wedatasphere-exchangis.tar.gz/packages/ && tar -zxf exchangis-server_1.1.2.tar.gz && cd /opt/wedatasphere-exchangis.tar.gz/sbin
WORKDIR /opt/wedatasphere-exchangis.tar.gz/sbin
diff --git a/README-ZH.md b/README-ZH.md
index 3f348efa9..2264648a1 100644
--- a/README-ZH.md
+++ b/README-ZH.md
@@ -6,7 +6,7 @@
## 介绍
-Exchangis 1.0.0 是微众银行大数据平台 WeDataSphere 与社区用户共同研发的的新版数据交换工具,支持异构数据源之间的结构化和非结构化数据传输同步。
+Exchangis是微众银行大数据平台 WeDataSphere 与社区用户共同研发的的新版数据交换工具,支持异构数据源之间的结构化和非结构化数据传输同步。
Exchangis 抽象了一套统一的数据源和同步作业定义插件,允许用户快速接入新的数据源,并只需在数据库中简单配置即可在页面中使用。
@@ -16,7 +16,7 @@ Exchangis 抽象了一套统一的数据源和同步作业定义插件,允许
### 界面预览
-![image](https://user-images.githubusercontent.com/27387830/171488936-2cea3ee9-4ef7-4309-93e1-e3b697bd3be1.png)
+![image](images/zh_CN/ch1/frontend_view.png)
## 核心特点
@@ -42,19 +42,22 @@ Exchangis 抽象了一套统一的数据源和同步作业定义插件,允许
### 3. 与DSS工作流打通,一站式大数据开发的门户
- 实现DSS AppConn包括一级 SSO 规范,二级组织结构规范,三级开发流程规范在内的三级规范;
-
- 作为DSS工作流的数据交换节点,是整个工作流链路中的门户流程,为后续的工作流节点运行提供稳固的数据基础;
+### 4. 支持多种导数引擎
+
+- 支持Sqoop和DataX引擎进行多种异构数据源之间的导数
+
## 整体设计
### 架构设计
-![架构设计](https://user-images.githubusercontent.com/27387830/173026793-f1475803-9f85-4478-b566-1ad1d002cd8a.png)
+![架构设计](images/zh_CN/ch1/home_page_zh.png)
## 相关文档
-[安装部署文档](https://github.com/WeBankFinTech/Exchangis/blob/dev-1.0.0/docs/zh_CN/ch1/exchangis_deploy_cn.md)
-[用户手册](https://github.com/WeBankFinTech/Exchangis/blob/dev-1.0.0/docs/zh_CN/ch1/exchangis_user_manual_cn.md)
+[安装部署文档](docs/zh_CN/ch1/exchangis_deploy_cn.md)
+[用户手册](docs/zh_CN/ch1/exchangis_user_manual_cn.md)
## 交流贡献
diff --git a/README.md b/README.md
index 1c9d4fb0a..889504b5a 100644
--- a/README.md
+++ b/README.md
@@ -4,7 +4,7 @@ English | [中文](README-ZH.md)
## Introduction
-Exchangis 1.0.0 is a new version of data exchange tool jointly developed by WeDataSphere, a big data platform of WeBank, and community users, which supports the synchronization of structured and unstructured data transmission between heterogeneous data sources.
+Exchangis is a new version of data exchange tool jointly developed by WeDataSphere, a big data platform of WeBank, and community users, which supports the synchronization of structured and unstructured data transmission between heterogeneous data sources.
Exchangis abstracts a unified set of data source and synchronization job definition plugins, allowing users to quickly access new data sources and use them on pages with simple configuration in the database.
@@ -14,7 +14,7 @@ With the help of [Linkis](https://github.com/apache/incubator-linkis) computing
### Interface preview
-![image](https://user-images.githubusercontent.com/27387830/171488936-2cea3ee9-4ef7-4309-93e1-e3b697bd3be1.png)
+![image](images/zh_CN/ch1/frontend_view.png)
## Core characteristics
@@ -47,13 +47,13 @@ With the help of [Linkis](https://github.com/apache/incubator-linkis) computing
### Architecture Design
-![架构设计](images/en_US/ch1/architecture.png)
+![架构设计](images/zh_CN/ch1/home_page_en.png)
## Documents
-[Quick Deploy](https://github.com/WeBankFinTech/Exchangis/blob/dev-1.0.0/docs/en_US/ch1/exchangis_deploy_en.md)
-[User Manual](https://github.com/WeBankFinTech/Exchangis/blob/dev-1.0.0/docs/en_US/ch1/exchangis_user_manual_en.md)
+[Quick Deploy](docs/en_US/ch1/exchangis_deploy_en.md)
+[User Manual](docs/en_US/ch1/exchangis_user_manual_en.md)
## Communication and contribution
diff --git a/assembly-package/config/exchangis-server.properties b/assembly-package/config/dss-exchangis-server.properties
similarity index 75%
rename from assembly-package/config/exchangis-server.properties
rename to assembly-package/config/dss-exchangis-server.properties
index dfba5255e..a8aa9a830 100644
--- a/assembly-package/config/exchangis-server.properties
+++ b/assembly-package/config/dss-exchangis-server.properties
@@ -15,14 +15,15 @@
#
#
-wds.linkis.server.mybatis.datasource.url=jdbc:mysql://{IP}:{PORT}/{database}?useSSL=false&characterEncoding=UTF-8&allowMultiQueries=true
-
+wds.linkis.test.mode=false
+wds.linkis.server.mybatis.datasource.url=jdbc:mysql://{IP}:{PORT}/{database}?useSSL=false&characterEncoding=UTF-8&allowMultiQueries=true&useAffectedRows=true
wds.linkis.server.mybatis.datasource.username={username}
-
wds.linkis.server.mybatis.datasource.password={password}
+wds.linkis.gateway.ip={LINKIS_IP}
+wds.linkis.gateway.port={LINKIS_PORT}
+wds.linkis.gateway.url=http://{LINKIS_IP}:{LINKIS_PORT}/
wds.linkis.log.clear=true
-
wds.linkis.server.version=v1
# datasource client
@@ -34,28 +35,33 @@ wds.exchangis.datasource.client.dws.version=v1
# launcher client
wds.exchangis.client.linkis.server-url=http://{LINKIS_IP}:{LINKIS_PORT}/
wds.exchangis.client.linkis.token.value=EXCHANGIS-AUTH
-wds.exchangis.datasource.extension.dir=exchangis-extds
+wds.exchangis.datasource.extension.dir=exchangis-extds/
##restful
wds.linkis.server.restful.scan.packages=com.webank.wedatasphere.exchangis.datasource.server.restful.api,\
com.webank.wedatasphere.exchangis.project.server.restful,\
com.webank.wedatasphere.exchangis.job.server.restful
-wds.linkis.server.mybatis.mapperLocations=classpath*:com/webank/wedatasphere/dss/framework/appconn/dao/impl/*.xml,classpath*:com/webank/wedatasphere/dss/workflow/dao/impl/*.xml,\
-classpath*:com/webank/wedatasphere/exchangis/job/server/mapper/impl/*.xml,\
-classpath*:com/webank/wedatasphere/exchangis/project/server/mapper/impl/*.xml
+
+wds.linkis.server.mybatis.mapperLocations=classpath*:com/webank/wedatasphere/exchangis/job/server/mapper/impl/*.xml,\
+classpath*:com/webank/wedatasphere/exchangis/project/server/mapper/impl/*.xml,\
+classpath*:com/webank/wedatasphere/exchangis/project/provider/mapper/impl/*.xml,\
+classpath*:com/webank/wedatasphere/exchangis/engine/server/mapper/*.xml
wds.linkis.server.mybatis.BasePackage=com.webank.wedatasphere.exchangis.dao,\
com.webank.wedatasphere.exchangis.project.server.mapper,\
+ com.webank.wedatasphere.exchangis.project.provider.mapper,\
com.webank.wedatasphere.linkis.configuration.dao,\
- com.webank.wedatasphere.dss.framework.appconn.dao,\
- com.webank.wedatasphere.dss.workflow.dao,\
com.webank.wedatasphere.linkis.metadata.dao,\
com.webank.wedatasphere.exchangis.job.server.mapper,\
- com.webank.wedatasphere.exchangis.job.server.dao
+ com.webank.wedatasphere.exchangis.job.server.dao,\
+ com.webank.wedatasphere.exchangis.engine.dao
wds.exchangis.job.task.scheduler.load-balancer.flexible.segments.min-occupy=0.25
wds.exchangis.job.task.scheduler.load-balancer.flexible.segments.max-occupy=0.5
#wds.exchangis.job.scheduler.group.max.running-jobs=4
wds.linkis-session.ticket.key=bdp-user-ticket-id
+wds.exchangis.limit.interface.value=false
+wds.exchangis.publicKeyStr=
+wds.exchangis.privateKeyStr=
diff --git a/assembly-package/config/exchangis.properties b/assembly-package/config/exchangis.properties
deleted file mode 100644
index e69de29bb..000000000
diff --git a/assembly-package/config/log4j2.xml b/assembly-package/config/log4j2.xml
index 70da2f238..121b48d1d 100644
--- a/assembly-package/config/log4j2.xml
+++ b/assembly-package/config/log4j2.xml
@@ -26,13 +26,22 @@
+ filePattern="${sys:log.path}/$${date:yyyy-MM-dd}/${sys:serviceName}/exchangis-log-%d{yyyy-MM-dd}-%i.log">
+
+
+
+
+
+
+
+
diff --git a/assembly-package/config/application-eureka.yml b/assembly-package/config/transform-processor-templates/datax-processor.java
similarity index 100%
rename from assembly-package/config/application-eureka.yml
rename to assembly-package/config/transform-processor-templates/datax-processor.java
diff --git a/assembly-package/pom.xml b/assembly-package/pom.xml
index 03f414f3c..45315a5fe 100644
--- a/assembly-package/pom.xml
+++ b/assembly-package/pom.xml
@@ -21,7 +21,7 @@
exchangis
com.webank.wedatasphere.exchangis
- 1.0.0
+ 1.1.2
4.0.0
assembly-package
@@ -31,6 +31,7 @@
org.apache.maven.plugins
maven-install-plugin
+ 2.4
true
@@ -38,6 +39,7 @@
org.apache.maven.plugins
maven-antrun-plugin
+ 1.3
package
diff --git a/assembly-package/sbin/common.sh b/assembly-package/sbin/common.sh
index 03d4e4666..8ee615b64 100644
--- a/assembly-package/sbin/common.sh
+++ b/assembly-package/sbin/common.sh
@@ -16,4 +16,4 @@
#
declare -A MODULE_MAIN_CLASS
-MODULE_MAIN_CLASS["exchangis-server"]="com.webank.wedatasphere.exchangis.server.boot.ExchangisServerApplication"
+MODULE_MAIN_CLASS["dss-exchangis-main-server-dev"]="com.webank.wedatasphere.exchangis.server.boot.ExchangisServerApplication"
diff --git a/assembly-package/sbin/daemon.sh b/assembly-package/sbin/daemon.sh
index 40f64a78a..a21ccfab6 100644
--- a/assembly-package/sbin/daemon.sh
+++ b/assembly-package/sbin/daemon.sh
@@ -23,9 +23,8 @@ else
source ./common.sh
fi
-MODULE_NAME=""
usage(){
- echo "Usage is [start|stop|restart {service}]"
+ echo "Usage is [start|stop|restart {server}]"
}
start(){
@@ -41,7 +40,7 @@ stop(){
restart(){
launcher_stop $1 $2
if [[ $? -eq 0 ]]; then
- sleep 2
+ sleep 3
launcher_start $1 $2
fi
}
@@ -49,12 +48,14 @@ restart(){
COMMAND=$1
case $COMMAND in
start|stop|restart)
+ load_env_definitions ${ENV_FILE}
if [[ ! -z $2 ]]; then
- MAIN_CLASS=${MODULE_MAIN_CLASS[${MODULE_DEFAULT_PREFIX}$2]}
+ SERVICE_NAME=${MODULE_DEFAULT_PREFIX}$2${MODULE_DEFAULT_SUFFIX}
+ MAIN_CLASS=${MODULE_MAIN_CLASS[${SERVICE_NAME}]}
if [[ "x"${MAIN_CLASS} != "x" ]]; then
- $COMMAND ${MODULE_DEFAULT_PREFIX}$2 ${MAIN_CLASS}
+ $COMMAND ${SERVICE_NAME} ${MAIN_CLASS}
else
- LOG ERROR "Cannot find the main class for [ ${MODULE_DEFAULT_PREFIX}$2 ]"
+ LOG ERROR "Cannot find the main class for [ ${SERVICE_NAME} ]"
fi
else
usage
diff --git a/assembly-package/sbin/env.properties b/assembly-package/sbin/env.properties
index e69de29bb..f849b4fa9 100644
--- a/assembly-package/sbin/env.properties
+++ b/assembly-package/sbin/env.properties
@@ -0,0 +1,4 @@
+EXCHANGIS_CONF_PATH=/appcom/config/exchangis-config/background
+EXCHANGIS_LOG_PATH=/appcom/logs/exchangis/background
+MODULE_DEFAULT_PREFIX="dss-exchangis-main-"
+MODULE_DEFAULT_SUFFIX="-dev"
diff --git a/assembly-package/sbin/install.sh b/assembly-package/sbin/install.sh
index 16f453870..a9f23aa66 100644
--- a/assembly-package/sbin/install.sh
+++ b/assembly-package/sbin/install.sh
@@ -123,57 +123,36 @@ interact_echo(){
done
}
+# Initalize database
init_database(){
-BOOTSTRAP_PROP_FILE="${CONF_PATH}/exchangis-server.properties"
-# Start to initalize database
-if [ "x${SQL_SOURCE_PATH}" != "x" ] && [ -f "${SQL_SOURCE_PATH}" ]; then
- `mysql --version >/dev/null 2>&1`
- interact_echo "Do you want to initalize database with sql?"
- if [ $? == 0 ]; then
- LOG INFO "\033[1m Scan out mysql command, so begin to initalize the database\033[0m"
- #interact_echo "Do you want to initalize database with sql: [${SQL_SOURCE_PATH}]?"
- #if [ $? == 0 ]; then
+ BOOTSTRAP_PROP_FILE="${CONF_PATH}/dss-exchangis-server.properties"
+ if [ "x${SQL_SOURCE_PATH}" != "x" ] && [ -f "${SQL_SOURCE_PATH}" ]; then
+ `mysql --version >/dev/null 2>&1`
DATASOURCE_URL="jdbc:mysql:\/\/${MYSQL_HOST}:${MYSQL_PORT}\/${DATABASE}\?useSSL=false\&characterEncoding=UTF-8\&allowMultiQueries=true"
- mysql -h ${MYSQL_HOST} -P ${MYSQL_PORT} -u ${MYSQL_USERNAME} -p${MYSQL_PASSWORD} --default-character-set=utf8 -e \
- "CREATE DATABASE IF NOT EXISTS ${DATABASE}; USE ${DATABASE}; source ${SQL_SOURCE_PATH};"
- #sed -ri "s![#]?(DB_HOST=)\S*!\1${HOST}!g" ${BOOTSTRAP_PROP_FILE}
- #sed -ri "s![#]?(DB_PORT=)\S*!\1${PORT}!g" ${BOOTSTRAP_PROP_FILE}
sed -ri "s![#]?(wds.linkis.server.mybatis.datasource.username=)\S*!\1${MYSQL_USERNAME}!g" ${BOOTSTRAP_PROP_FILE}
sed -ri "s![#]?(wds.linkis.server.mybatis.datasource.password=)\S*!\1${MYSQL_PASSWORD}!g" ${BOOTSTRAP_PROP_FILE}
sed -ri "s![#]?(wds.linkis.server.mybatis.datasource.url=)\S*!\1${DATASOURCE_URL}!g" ${BOOTSTRAP_PROP_FILE}
- #fi
- fi
-fi
+ interact_echo "Do you want to initalize database with sql: [${SQL_SOURCE_PATH}]?"
+ if [ $? == 0 ]; then
+ LOG INFO "\033[1m Scan out mysql command, so begin to initalize the database\033[0m"
+ mysql -h ${MYSQL_HOST} -P ${MYSQL_PORT} -u ${MYSQL_USERNAME} -p${MYSQL_PASSWORD} --default-character-set=utf8 -e \
+ "CREATE DATABASE IF NOT EXISTS ${DATABASE}; USE ${DATABASE}; source ${SQL_SOURCE_PATH};"
+ fi
+ fi
}
init_properties(){
-BOOTSTRAP_PROP_FILE="${CONF_PATH}/exchangis-server.properties"
-APPLICATION_YML="${CONF_PATH}/application-exchangis.yml"
-# Start to initalize propertis
- #interact_echo "Do you want to initalize exchangis-server.properties?"
- #if [ $? == 0 ]; then
-
- LINKIS_GATEWAY_URL="http:\/\/${LINKIS_GATEWAY_HOST}:${LINKIS_GATEWAY_PORT}\/"
-
- if [ "x${LINKIS_SERVER_URL}" == "x" ]; then
- LINKIS_SERVER_URL="http://127.0.0.1:3306"
- fi
- if [ "x${LINKIS_SERVER_URL}" == "x" ]; then
- LINKIS_SERVER_URL="http://127.0.0.1:3306"
- fi
+ BOOTSTRAP_PROP_FILE="${CONF_PATH}/dss-exchangis-server.properties"
+ APPLICATION_YML="${CONF_PATH}/application-exchangis.yml"
+ LINKIS_GATEWAY_URL="http:\/\/${LINKIS_GATEWAY_HOST}:${LINKIS_GATEWAY_PORT}\/"
+ if [ "x${LINKIS_SERVER_URL}" == "x" ]; then
+ LINKIS_SERVER_URL="http://127.0.0.1:9001"
+ fi
- sed -ri "s![#]?(wds.linkis.gateway.ip=)\S*!\1${LINKIS_GATEWAY_HOST}!g" ${BOOTSTRAP_PROP_FILE}
- sed -ri "s![#]?(wds.linkis.gateway.port=)\S*!\1${LINKIS_GATEWAY_PORT}!g" ${BOOTSTRAP_PROP_FILE}
- sed -ri "s![#]?(wds.linkis.gateway.url=)\S*!\1${LINKIS_GATEWAY_URL}!g" ${BOOTSTRAP_PROP_FILE}
- sed -ri "s![#]?(wds.exchangis.datasource.client.serverurl=)\S*!\1${LINKIS_GATEWAY_URL}!g" ${BOOTSTRAP_PROP_FILE}
- sed -ri "s![#]?(wds.exchangis.client.linkis.server-url=)\S*!\1${LINKIS_GATEWAY_URL}!g" ${BOOTSTRAP_PROP_FILE}
- #sed -ri "s![#]?(wds.exchangis.datasource.client.authtoken.key=)\S*!\1${LINKIS_TOKEN}!g" ${BOOTSTRAP_PROP_FILE}
- #sed -ri "s![#]?(wds.exchangis.datasource.client.authtoken.value=)\S*!\1${LINKIS_TOKEN}!g" ${BOOTSTRAP_PROP_FILE}
- #sed -ri "s![#]?(wds.exchangis.client.linkis.token.value=)\S*!\1${LINKIS_TOKEN}!g" ${BOOTSTRAP_PROP_FILE}
- sed -ri "s![#]?(wds.linkis.gateway.port=)\S*!\1${LINKIS_GATEWAY_PORT}!g" ${BOOTSTRAP_PROP_FILE}
- sed -ri "s![#]?(port: )\S*!\1${EXCHANGIS_PORT}!g" ${APPLICATION_YML}
- sed -ri "s![#]?(defaultZone: )\S*!\1${EUREKA_URL}!g" ${APPLICATION_YML}
- #fi
+ sed -ri "s![#]?(wds.exchangis.datasource.client.serverurl=)\S*!\1${LINKIS_GATEWAY_URL}!g" ${BOOTSTRAP_PROP_FILE}
+ sed -ri "s![#]?(wds.exchangis.client.linkis.server-url=)\S*!\1${LINKIS_GATEWAY_URL}!g" ${BOOTSTRAP_PROP_FILE}
+ sed -ri "s![#]?(port: )\S*!\1${EXCHANGIS_PORT}!g" ${APPLICATION_YML}
+ sed -ri "s![#]?(defaultZone: )\S*!\1${EUREKA_URL}!g" ${APPLICATION_YML}
}
install_modules(){
diff --git a/assembly-package/sbin/launcher.sh b/assembly-package/sbin/launcher.sh
index 60bc62364..50a79d279 100644
--- a/assembly-package/sbin/launcher.sh
+++ b/assembly-package/sbin/launcher.sh
@@ -20,11 +20,8 @@ DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
ENV_FILE="${DIR}/env.properties"
SHELL_LOG="${DIR}/command.log"
USER_DIR="${DIR}/../"
-EXCHANGIS_CONF_PATH="${DIR}/../config"
EXCHANGIS_LIB_PATH="${DIR}/../lib"
-EXCHANGIS_LOG_PATH="${DIR}/../logs"
EXCHANGIS_PID_PATH="${DIR}/../runtime"
-MODULE_DEFAULT_PREFIX="exchangis-"
# Default
MAIN_CLASS=""
DEBUG_MODE=False
@@ -32,8 +29,6 @@ DEBUG_PORT="7006"
SPRING_PROFILE="exchangis"
SLEEP_TIMEREVAL_S=2
-CONF_PATH=${DIR}/../config
-
function LOG(){
currentTime=`date "+%Y-%m-%d %H:%M:%S.%3N"`
echo -e "$currentTime [${1}] ($$) $2" | tee -a ${SHELL_LOG}
@@ -91,8 +86,6 @@ load_env_definitions(){
fi
}
-
-
construct_java_command(){
verify_java_env
if [[ "x${EXCHANGIS_CONF_PATH}" == "x" ]]; then
@@ -119,7 +112,8 @@ construct_java_command(){
mkdir -p ${EXCHANGIS_PID_PATH}
local classpath=${EXCHANGIS_CONF_PATH}":."
local opts=""
- classpath=${EXCHANGIS_LIB_PATH}/$1/*":"${classpath}
+ classpath=${EXCHANGIS_LIB_PATH}/"exchangis-server/*:"${classpath}
+ LOG INFO "classpath:"${classpath}
if [[ "x${EXCHANGIS_JAVA_OPTS}" == "x" ]]; then
# Use G1 garbage collector
local opts="-Xms${HEAP_SIZE} -Xmx${HEAP_SIZE} -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:+UseG1GC -Xloggc:${EXCHANGIS_LOG_PATH}/$1-gc.log"
@@ -139,6 +133,7 @@ construct_java_command(){
opts=${opts}" -Dlogging.level.reactor.ipc.netty.channel.CloseableContextHandler=off"
opts=${opts}" -Duser.dir=${USER_DIR}"
opts=${opts}" -classpath "${classpath}
+ LOG INFO "opts:"${opts}
if [[ "x${JAVA_HOME}" != "x" ]]; then
EXEC_JAVA=${JAVA_HOME}"/bin/java "${opts}" "$2
else
@@ -178,7 +173,7 @@ wait_for_startup(){
return 0
fi
sleep ${SLEEP_TIMEREVAL_S}
- now_s=`date '+%s'` #计算当前时间时间戳
+ now_s=`date '+%s'`
done
return 1
}
@@ -199,7 +194,6 @@ wait_for_stop(){
# Input: $1:module_name, $2:main class
launcher_start(){
- load_env_definitions ${ENV_FILE}
LOG INFO "Launcher: launch to start server [ $1 ]"
status_class $1 $2
if [[ $? -eq 0 ]]; then
@@ -208,14 +202,17 @@ launcher_start(){
fi
construct_java_command $1 $2
# Execute
+ echo ${EXEC_JAVA}
LOG INFO ${EXEC_JAVA}
nohup ${EXEC_JAVA} >/dev/null 2>&1 &
LOG INFO "Launcher: waiting [ $1 ] to start complete ..."
wait_for_startup 20 $1 $2
if [[ $? -eq 0 ]]; then
LOG INFO "Launcher: [ $1 ] start success"
- APPLICATION_YML="${CONF_PATH}/application-exchangis.yml"
+ LOG INFO ${EXCHANGIS_CONF_PATH}
+ APPLICATION_YML="${EXCHANGIS_CONF_PATH}/application-exchangis.yml"
EUREKA_URL=`cat ${APPLICATION_YML} | grep Zone | sed -n '1p'`
+ echo "${EUREKA_URL}"
LOG INFO "Please check exchangis server in EUREKA_ADDRESS: ${EUREKA_URL#*:} "
else
LOG ERROR "Launcher: [ $1 ] start fail over 20 seconds, please retry it"
@@ -224,7 +221,6 @@ launcher_start(){
# Input: $1:module_name, $2:main class
launcher_stop(){
- load_env_definitions ${ENV_FILE}
LOG INFO "Launcher: stop the server [ $1 ]"
local p=""
local pid_file_path=${EXCHANGIS_PID_PATH}/$1.pid
@@ -247,11 +243,11 @@ launcher_stop(){
*) kill -SIGTERM "${p}" ;;
esac
LOG INFO "Launcher: waiting [ $1 ] to stop complete ..."
- wait_for_stop 20
+ wait_for_stop 20 $1 $2
if [[ $? -eq 0 ]]; then
LOG INFO "Launcher: [ $1 ] stop success"
else
LOG ERROR "Launcher: [ $1 ] stop exceeded over 20s " >&2
return 1
fi
-}
\ No newline at end of file
+}
diff --git a/db/1.1.1/exchangis_ddl.sql b/db/1.1.1/exchangis_ddl.sql
new file mode 100644
index 000000000..1002aa86b
--- /dev/null
+++ b/db/1.1.1/exchangis_ddl.sql
@@ -0,0 +1,88 @@
+-- exchangis_job_func definition
+DROP TABLE IF EXISTS `exchangis_job_func`;
+CREATE TABLE `exchangis_job_func` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `func_type` varchar(50) NOT NULL,
+ `func_name` varchar(100) NOT NULL,
+ `tab_name` varchar(50) NOT NULL COMMENT 'Tab',
+ `name_dispaly` varchar(100) DEFAULT NULL,
+ `param_num` int(11) DEFAULT '0',
+ `ref_name` varchar(100) DEFAULT NULL,
+ `description` varchar(200) DEFAULT NULL,
+ `modify_time` datetime DEFAULT NULL,
+ `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `job_func_tab_name_idx` (`tab_name`,`func_name`)
+) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8;
+
+-- exchangis_job_func_params definition
+DROP TABLE IF EXISTS `exchangis_job_func_params`;
+CREATE TABLE IF NOT EXISTS `exchangis_job_func_params`(
+ `func_id` INT(11) NOT NULL,
+ `param_name` VARCHAR(100) NOT NULL,
+ `order` INT(11) DEFAULT 0,
+ `name_display` VARCHAR(100),
+ `create_time` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ PRIMARY KEY(`func_id`, `param_name`)
+)Engine=InnoDB DEFAULT CHARSET=utf8;
+
+-- exchangis_job_param_config definition
+DROP TABLE IF EXISTS `exchangis_job_param_config`;
+CREATE TABLE `exchangis_job_param_config` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `config_key` varchar(64) NOT NULL,
+ `config_name` varchar(64) NOT NULL,
+ `config_direction` varchar(16) DEFAULT NULL,
+ `type` varchar(32) NOT NULL,
+ `ui_type` varchar(32) DEFAULT NULL,
+ `ui_field` varchar(64) DEFAULT NULL,
+ `ui_label` varchar(32) DEFAULT NULL,
+ `unit` varchar(32) DEFAULT NULL,
+ `required` bit(1) DEFAULT b'0',
+ `value_type` varchar(32) DEFAULT NULL,
+ `value_range` varchar(255) DEFAULT NULL,
+ `default_value` varchar(255) DEFAULT NULL,
+ `validate_type` varchar(64) DEFAULT NULL,
+ `validate_range` varchar(64) DEFAULT NULL,
+ `validate_msg` varchar(255) DEFAULT NULL,
+ `is_hidden` bit(1) DEFAULT NULL,
+ `is_advanced` bit(1) DEFAULT NULL,
+ `source` varchar(255) DEFAULT NULL,
+ `level` tinyint(4) DEFAULT NULL,
+ `treename` varchar(32) DEFAULT NULL,
+ `sort` int(11) DEFAULT NULL,
+ `description` varchar(255) DEFAULT NULL,
+ `status` tinyint(4) DEFAULT NULL,
+ `ref_id` bigint(20) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=32 DEFAULT CHARSET=utf8;
+
+-- exchangis_engine_settings definition
+DROP TABLE IF EXISTS `exchangis_engine_settings`;
+CREATE TABLE `exchangis_engine_settings` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `engine_name` varchar(50) NOT NULL,
+ `engine_desc` varchar(500) NOT NULL,
+ `engine_settings_value` text,
+ `engine_direction` varchar(255) NOT NULL,
+ `res_loader_class` varchar(255),
+ `res_uploader_class` varchar(255),
+ `modify_time` datetime DEFAULT NULL,
+ `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `engine_setting_idx` (`engine_name`)
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- exchangis_job_transform_rule
+DROP TABLE IF EXISTS `exchangis_job_transform_rule`;
+CREATE TABLE `exchangis_job_transform_rule` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `rule_name` varchar(100) NOT NULL DEFAULT 'transform_rule',
+ `rule_type` varchar(64) NOT NULL DEFAULT 'DEF',
+ `rule_source` varchar(600) DEFAULT '{}',
+ `data_source_type` varchar(64) NOT NULL,
+ `engine_type` varchar(32),
+ `direction` varchar(32) NOT NULL DEFAULT 'NONE',
+ `create_time` datetime DEFAULT CURRENT_TIMESTAMP,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
\ No newline at end of file
diff --git a/db/1.1.1/exchangis_dml.sql b/db/1.1.1/exchangis_dml.sql
new file mode 100644
index 000000000..3e546d667
--- /dev/null
+++ b/db/1.1.1/exchangis_dml.sql
@@ -0,0 +1,79 @@
+-- job_func records
+INSERT INTO `exchangis_job_func`(func_type,func_name,tab_name,name_dispaly,param_num,ref_name,description,modify_time) VALUES
+('TRANSFORM','dx_substr','DATAX',NULL,2,NULL,NULL,NULL)
+,('TRANSFORM','dx_pad','DATAX',NULL,3,NULL,NULL,NULL)
+,('TRANSFORM','dx_replace','DATAX',NULL,3,NULL,NULL,NULL)
+,('VERIFY','like','DATAX',NULL,1,'dx_filter',NULL,NULL)
+,('VERIFY','not like','DATAX',NULL,1,'dx_filter',NULL,NULL)
+,('VERIFY','>','DATAX',NULL,1,'dx_filter',NULL,NULL)
+,('VERIFY','<','DATAX',NULL,1,'dx_filter',NULL,NULL)
+,('VERIFY','=','DATAX',NULL,1,'dx_filter',NULL,NULL)
+,('VERIFY','!=','DATAX',NULL,1,'dx_filter',NULL,NULL)
+,('VERIFY','>=','DATAX',NULL,1,'dx_filter',NULL,NULL)
+,('TRANSFORM','dx_precision','DATAX',NULL,1,NULL,NULL,NULL)
+;
+
+-- job_func_params records
+INSERT INTO `exchangis_job_func_params`(`func_id`, `param_name`, `name_display`, `order`) VALUES(1, 'startIndex', 'startIndex', 0) ON DUPLICATE KEY UPDATE `name_display` = 'startIndex';
+INSERT INTO `exchangis_job_func_params`(`func_id`, `param_name`, `name_display`, `order`) VALUES(1, 'length', 'length', 1) ON DUPLICATE KEY UPDATE `name_display` = 'length';
+INSERT INTO `exchangis_job_func_params`(`func_id`, `param_name`, `name_display`, `order`) VALUES(2, 'padType', 'padType(r or l)', 0) ON DUPLICATE KEY UPDATE `name_display` = 'padType(r or l)';
+INSERT INTO `exchangis_job_func_params`(`func_id`, `param_name`, `name_display`, `order`) VALUES(2, 'length', 'length', 1) ON DUPLICATE KEY UPDATE `name_display` = 'length';
+INSERT INTO `exchangis_job_func_params`(`func_id`, `param_name`, `name_display`, `order`) VALUES(2, 'padString', 'padString', 2) ON DUPLICATE KEY UPDATE `name_display` = 'padString';
+INSERT INTO `exchangis_job_func_params`(`func_id`, `param_name`, `name_display`, `order`) VALUES(3, 'startIndex', 'startIndex', 0) ON DUPLICATE KEY UPDATE `name_display` = 'startIndex';
+INSERT INTO `exchangis_job_func_params`(`func_id`, `param_name`, `name_display`, `order`) VALUES(3, 'length', 'length', 1) ON DUPLICATE KEY UPDATE `name_display` = 'length';
+INSERT INTO `exchangis_job_func_params`(`func_id`, `param_name`, `name_display`, `order`) VALUES(3, 'replaceString', 'replaceString', 2) ON DUPLICATE KEY UPDATE `name_display` = 'replaceString';
+INSERT INTO `exchangis_job_func_params`(`func_id`, `param_name`, `name_display`) VALUES(4, 'value', 'value') ON DUPLICATE KEY UPDATE `name_display` = 'value';
+INSERT INTO `exchangis_job_func_params`(`func_id`, `param_name`, `name_display`) VALUES(5, 'value', 'value') ON DUPLICATE KEY UPDATE `name_display` = 'value';
+INSERT INTO `exchangis_job_func_params`(`func_id`, `param_name`, `name_display`) VALUES(6, 'value', 'value') ON DUPLICATE KEY UPDATE `name_display` = 'value';
+INSERT INTO `exchangis_job_func_params`(`func_id`, `param_name`, `name_display`) VALUES(7, 'value', 'value') ON DUPLICATE KEY UPDATE `name_display` = 'value';
+INSERT INTO `exchangis_job_func_params`(`func_id`, `param_name`, `name_display`) VALUES(8, 'value', 'value') ON DUPLICATE KEY UPDATE `name_display` = 'value';
+INSERT INTO `exchangis_job_func_params`(`func_id`, `param_name`, `name_display`) VALUES(9, 'value', 'value') ON DUPLICATE KEY UPDATE `name_display` = 'value';
+INSERT INTO `exchangis_job_func_params`(`func_id`, `param_name`, `name_display`) VALUES(10, 'value', 'value') ON DUPLICATE KEY UPDATE `name_display` = 'value';
+
+-- job_param_config records
+INSERT INTO `exchangis_job_param_config` (config_key,config_name,config_direction,`type`,ui_type,ui_field,ui_label,unit,required,value_type,value_range,default_value,validate_type,validate_range,validate_msg,is_hidden,is_advanced,source,`level`,treename,sort,description,status,ref_id) VALUES
+('setting.speed.byte','作业速率限制','','DATAX','INPUT','setting.speed.bytes','作业速率限制','Mb/s',1,'NUMBER','','5','REGEX','^[1-9]d*$','作业速率限制输入错误',0,0,'',1,'',1,'',1,NULL)
+,('setting.speed.record','作业记录数限制','','DATAX','INPUT','setting.speed.records','作业记录数限制','条/s',1,'NUMBER','','100','REGEX','^[1-9]d*$','作业记录数限制输入错误',0,0,'',1,'',2,'',1,NULL)
+,('setting.speed.channel','作业最大并行度','','DATAX','INPUT','setting.max.parallelism','作业最大并行度','个',1,'NUMBER','','1','REGEX','^[1-9]d*$','作业最大并行度输入错误',0,0,'',1,'',3,'',1,NULL)
+,('setting.max.memory','作业最大使用内存','','DATAX','INPUT','setting.max.memory','作业最大使用内存','Mb',1,'NUMBER','','1024','REGEX','^[1-9]d*$','作业最大使用内存输入错误',0,0,'',1,'',4,'',1,NULL)
+,('setting.errorLimit.record','最多错误记录数','','DATAX','INPUT','setting.errorlimit.record','最多错误记录数','条',0,'NUMBER','','','REGEX','^[0-9]d*$','最多错误记录数输入错误',0,0,'',1,'',5,'',1,NULL)
+,('setting.max.parallelism','作业最大并行数','','SQOOP','INPUT','setting.max.parallelism','作业最大并行数','个',1,'NUMBER','','1','REGEX','^[1-9]d*$','作业最大并行数输入错误',0,0,'',1,'',1,'',1,NULL)
+,('setting.max.memory','作业最大内存','','SQOOP','INPUT','setting.max.memory','作业最大内存','Mb',1,'NUMBER','','1024','REGEX','^[1-9]d*$','作业最大内存输入错误',0,0,'',1,'',2,'',1,NULL)
+,('where','WHERE条件','SOURCE','MYSQL','INPUT','where','WHERE条件','',0,'VARCHAR','','','REGEX','^[sS]{0,500}$','WHERE条件输入过长',0,0,'',1,'',2,'',1,NULL)
+,('writeMode','写入方式','SQOOP-SINK','HIVE','OPTION','writeMode','写入方式(OVERWRITE只对TEXT类型表生效)','',1,'OPTION','["OVERWRITE","APPEND"]','OVERWRITE','','','写入方式输入错误',0,0,'',1,'',1,'',1,NULL)
+,('partition','分区信息','SINK','HIVE','MAP','partition','分区信息(文本)','',0,'VARCHAR','','','REGEX','^[sS]{0,50}$','分区信息过长',0,0,'/api/rest_j/v1/dss/exchangis/main/datasources/render/partition/element/map',1,'',2,'',1,NULL)
+;
+INSERT INTO `exchangis_job_param_config` (config_key,config_name,config_direction,`type`,ui_type,ui_field,ui_label,unit,required,value_type,value_range,default_value,validate_type,validate_range,validate_msg,is_hidden,is_advanced,source,`level`,treename,sort,description,status,ref_id) VALUES
+('partition','分区信息','SOURCE','HIVE','MAP','partition','分区信息(文本)','',0,'VARCHAR','','','REGEX','^[sS]{0,50}$','分区信息过长',0,0,'/api/rest_j/v1/dss/exchangis/main/datasources/render/partition/element/map',1,'',2,'',1,NULL)
+,('writeMode','写入方式','SQOOP-SINK','MYSQL','OPTION','writeMode','写入方式','',1,'OPTION','["INSERT","UPDATE"]','INSERT','','','写入方式输入错误',0,0,'',1,'',1,'',1,NULL)
+,('batchSize','批量大小','DATAX-SINK','ELASTICSEARCH','INPUT','batchSize','批量大小','',0,'NUMBER','','','REGEX','^[1-9]d*$','批量大小输入错误',0,0,'',1,'',1,'',1,NULL)
+,('query','query条件','DATAX-SOURCE','MONGODB','INPUT','query','query条件','',0,'VARCHAR','','','REGEX','^[sS]{0,500}$','query条件输入过长',0,0,'',1,'',2,'',1,NULL)
+,('writeMode','写入方式','DATAX-SINK','MONGODB','OPTION','writeMode','写入方式','',1,'OPTION','["INSERT","REPLACE"]','INSERT','','','写入方式输入错误',0,0,'',1,'',1,'',1,NULL)
+,('batchSize','批量大小','DATAX-SINK','MONGODB','INPUT','batchSize','批量大小','',0,'NUMBER','','','REGEX','^[1-9]d*$','批量大小输入错误',0,0,'',1,'',2,'',1,NULL)
+,('transferMode','传输方式','DATAX-SOURCE','HIVE','OPTION','transferMode','传输方式','',1,'OPTION','["二进制","记录"]','二进制','','','该传输方式不可用',0,0,'',1,'',1,'',1,NULL)
+,('nullFormat','空值字符','DATAX-SOURCE','HIVE','INPUT','nullFormat','空值字符','',0,'VARCHAR','','','REGEX','^[sS]{0,50}$','空值字符输入错误',0,0,'',1,'',2,'',1,49)
+,('writeMode','写入方式','DATAX-SINK','MYSQL','OPTION','writeMode','写入方式','',1,'OPTION','["INSERT","UPDATE"]','INSERT','','','写入方式输入错误',0,0,'',1,'',1,'',1,NULL)
+,('writeMode','写入方式','DATAX-SINK','HIVE','OPTION','writeMode','写入方式(OVERWRITE只对TEXT类型表生效)','',1,'OPTION','["append","truncate"]','append','','','写入方式输入错误',0,0,'',1,'',1,'',1,NULL)
+;
+INSERT INTO `exchangis_job_param_config` (config_key,config_name,config_direction,`type`,ui_type,ui_field,ui_label,unit,required,value_type,value_range,default_value,validate_type,validate_range,validate_msg,is_hidden,is_advanced,source,`level`,treename,sort,description,status,ref_id) VALUES
+('nullFormat','空值字符','DATAX-SINK','HIVE','INPUT','nullFormat','空值字符','',0,'VARCHAR','','','REGEX','^[sS]{0,50}$','空值字符输入错误',0,0,'',1,'',2,'',1,49)
+,('nullFormat','空值字符','DATAX-SINK','ELASTICSEARCH','INPUT','nullFormat','空值字符','',0,'VARCHAR','','','REGEX','^[sS]{0,50}$','空值字符输入错误',0,0,'',1,'',2,'',1,49)
+;
+INSERT INTO `exchangis_job_param_config` (config_key,config_name,config_direction,`type`,ui_type,ui_field,ui_label,unit,required,value_type,value_range,default_value,validate_type,validate_range,validate_msg,is_hidden,is_advanced,source,`level`,treename,sort,description,status,ref_id) VALUES
+('where','WHERE条件','SOURCE','ORACLE','INPUT','where','WHERE条件',NULL,0,'VARCHAR',NULL,NULL,'REGEX','^[\\s\\S]{0,500}$','WHERE条件输入过长',0,0,NULL,1,'',2,NULL,1,NULL)
+,('writeMode','写入方式','DATAX-SINK','ORACLE','OPTION','writeMode','写入方式',NULL,1,'OPTION','["INSERT","UPDATE"]','INSERT',NULL,NULL,'写入方式输入错误',0,0,NULL,1,NULL,1,NULL,1,NULL)
+;
+
+-- engine_settings records
+INSERT INTO `exchangis_engine_settings` (id, engine_name, engine_desc, engine_settings_value, engine_direction, res_loader_class, res_uploader_class, modify_time, create_time) VALUES
+(1, 'datax', 'datax sync engine', '{}', 'mysql->hive,hive->mysql,mysql->oracle,oracle->mysql,oracle->hive,hive->oracle,mongodb->hive,hive->mongodb,mysql->elasticsearch,oracle->elasticsearch,mongodb->elasticsearch,mysql->mongodb,mongodb->mysql,oracle->mongodb,mongodb->oracle', 'com.webank.wedatasphere.exchangis.engine.resource.loader.datax.DataxEngineResourceLoader', NULL, NULL, '2022-08-09 18:20:51.0'),
+(2, 'sqoop', 'hadoop tool', '{}', 'mysql->hive,hive->mysql', '', NULL, NULL, '2022-08-09 18:20:51.0');
+
+-- exchangis_job_transform_rule records
+INSERT INTO `exchangis_job_transform_rule` (rule_name,rule_type,rule_source,data_source_type,engine_type,direction) VALUES
+('es_with_post_processor','DEF','{"types": ["MAPPING", "PROCESSOR"]}','ELASTICSEARCH',NULL,'SINK')
+,('es_fields_not_editable','MAPPING','{"fieldEditEnable": false, "fieldDeleteEnable": false}','ELASTICSEARCH',NULL,'SINK')
+,('hive_sink_not_access','MAPPING','{"fieldEditEnable": false, "fieldDeleteEnable": false, "fieldAddEnable": false}','HIVE',NULL,'SINK')
+,('mongo_field_match','MAPPING','{"fieldMatchStrategyName": "CAMEL_CASE_MATCH"}','MONGODB',NULL,'SINK')
+,('mysql_field_source_match','MAPPING','{"fieldMatchStrategyName": "CAMEL_CASE_MATCH","fieldEditEnable": true, "fieldDeleteEnable": true, "fieldAddEnable": false}','MYSQL',NULL,'SOURCE')
+;
\ No newline at end of file
diff --git a/db/1.1.2/exchangis_ddl.sql b/db/1.1.2/exchangis_ddl.sql
new file mode 100644
index 000000000..3609cadfd
--- /dev/null
+++ b/db/1.1.2/exchangis_ddl.sql
@@ -0,0 +1 @@
+ALTER TABLE exchangis_job_entity MODIFY COLUMN name varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;
\ No newline at end of file
diff --git a/db/exchangis_ddl.sql b/db/exchangis_ddl.sql
index fa99232bb..c04796624 100644
--- a/db/exchangis_ddl.sql
+++ b/db/exchangis_ddl.sql
@@ -1,4 +1,4 @@
--- exchangis_v4.exchangis_job_ds_bind definition
+-- exchangis_job_ds_bind definition
DROP TABLE IF EXISTS `exchangis_job_ds_bind`;
CREATE TABLE `exchangis_job_ds_bind` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
@@ -9,11 +9,12 @@ CREATE TABLE `exchangis_job_ds_bind` (
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=59575 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
--- exchangis_v4.exchangis_job_entity definition
+
+-- exchangis_job_entity definition
DROP TABLE IF EXISTS `exchangis_job_entity`;
CREATE TABLE `exchangis_job_entity` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
- `name` varchar(100) NOT NULL,
+ `name` varchar(255) NOT NULL,
`create_time` datetime DEFAULT NULL,
`last_update_time` datetime(3) DEFAULT NULL,
`engine_type` varchar(45) DEFAULT '',
@@ -30,7 +31,8 @@ CREATE TABLE `exchangis_job_entity` (
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5793 DEFAULT CHARSET=utf8;
--- exchangis_v4.exchangis_job_param_config definition
+
+-- exchangis_job_param_config definition
DROP TABLE IF EXISTS `exchangis_job_param_config`;
CREATE TABLE `exchangis_job_param_config` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
@@ -57,40 +59,43 @@ CREATE TABLE `exchangis_job_param_config` (
`sort` int(11) DEFAULT NULL,
`description` varchar(255) DEFAULT NULL,
`status` tinyint(4) DEFAULT NULL,
+ `ref_id` bigint(20) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=32 DEFAULT CHARSET=utf8;
--- exchangis_v4.exchangis_project_info definition
+-- exchangis_project_info definition
DROP TABLE IF EXISTS `exchangis_project_info`;
+-- udes_gzpc_pub_sit_01.exchangis_project_info definition
CREATE TABLE `exchangis_project_info` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(64) NOT NULL,
`description` varchar(255) DEFAULT NULL,
- `create_time` datetime DEFAULT NULL,
- `last_update_time` datetime(3) DEFAULT NULL,
+ `create_time` datetime DEFAULT CURRENT_TIMESTAMP,
+ `last_update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`create_user` varchar(64) DEFAULT NULL,
`last_update_user` varchar(64) DEFAULT NULL,
`project_labels` varchar(255) DEFAULT NULL,
`domain` varchar(32) DEFAULT NULL,
- `exec_users` varchar(255) DEFAULT NULL,
- `view_users` varchar(255) DEFAULT NULL,
- `edit_users` varchar(255) DEFAULT NULL,
+ `exec_users` varchar(255) DEFAULT '',
+ `view_users` varchar(255) DEFAULT '',
+ `edit_users` varchar(255) DEFAULT '',
`source` text,
PRIMARY KEY (`id`)
-) ENGINE=InnoDB AUTO_INCREMENT=1497870871035973934 DEFAULT CHARSET=utf8;
+) ENGINE=InnoDB AUTO_INCREMENT=1497870871035974171 DEFAULT CHARSET=utf8;
--- exchangis_v4.exchangis_project_user definition
+-- exchangis_project_user definition
DROP TABLE IF EXISTS `exchangis_project_user`;
CREATE TABLE `exchangis_project_user` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`project_id` bigint(20) NOT NULL,
`priv_user` varchar(32) COLLATE utf8_bin DEFAULT NULL,
`priv` int(20) DEFAULT NULL,
- `last_update_time` datetime DEFAULT NULL,
- PRIMARY KEY (`id`)
-) ENGINE=InnoDB AUTO_INCREMENT=84 DEFAULT CHARSET=utf8 COLLATE=utf8_bin ROW_FORMAT=COMPACT;
+ `last_update_time` datetime DEFAULT CURRENT_TIMESTAMP,
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `exchangis_project_user_un` (`project_id`)
+) ENGINE=InnoDB AUTO_INCREMENT=844 DEFAULT CHARSET=utf8 COLLATE=utf8_bin ROW_FORMAT=COMPACT;
--- exchangis_v4.exchangis_launchable_task definition
+-- exchangis_launchable_task definition
DROP TABLE IF EXISTS `exchangis_launchable_task`;
CREATE TABLE `exchangis_launchable_task` (
`id` bigint(13) NOT NULL,
@@ -102,13 +107,13 @@ CREATE TABLE `exchangis_launchable_task` (
`execute_user` varchar(50) DEFAULT '',
`linkis_job_name` varchar(100) NOT NULL,
`linkis_job_content` text NOT NULL,
- `linkis_params` varchar(255) DEFAULT NULL,
+ `linkis_params` text DEFAULT NULL,
`linkis_source` varchar(64) DEFAULT NULL,
`labels` varchar(64) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--- exchangis_v4.exchangis_launched_job_entity definition
+-- exchangis_launched_job_entity definition
DROP TABLE IF EXISTS `exchangis_launched_job_entity`;
CREATE TABLE `exchangis_launched_job_entity` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
@@ -132,7 +137,7 @@ CREATE TABLE `exchangis_launched_job_entity` (
UNIQUE KEY `job_execution_id_UNIQUE` (`job_execution_id`)
) ENGINE=InnoDB AUTO_INCREMENT=8380 DEFAULT CHARSET=utf8;
--- exchangis_v4.exchangis_launched_task_entity definition
+-- exchangis_launched_task_entity definition
DROP TABLE IF EXISTS `exchangis_launched_task_entity`;
CREATE TABLE `exchangis_launched_task_entity` (
`id` bigint(20) NOT NULL,
@@ -158,19 +163,91 @@ CREATE TABLE `exchangis_launched_task_entity` (
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-INSERT INTO exchangis_job_param_config (config_key,config_name,config_direction,`type`,ui_type,ui_field,ui_label,unit,required,value_type,value_range,default_value,validate_type,validate_range,validate_msg,is_hidden,is_advanced,source,`level`,treename,sort,description,status) VALUES
-('setting.speed.bytes','作业速率限制','','DATAX','INPUT','setting.speed.bytes','作业速率限制','Mb/s',1,'NUMBER','','','REGEX','^[1-9]\\d*$','作业速率限制输入错误',0,0,'',1,'',1,'',1)
-,('setting.speed.records','作业记录数限制','','DATAX','INPUT','setting.speed.records','作业记录数限制','条/s',1,'NUMBER','','','REGEX','^[1-9]\\d*$','作业记录数限制输入错误',0,0,'',1,'',2,'',1)
-,('setting.max.parallelism','作业最大并行度','','DATAX','INPUT','setting.max.parallelism','作业最大并行度','个',1,'NUMBER','','1','REGEX','^[1-9]\\d*$','作业最大并行度输入错误',0,0,'',1,'',3,'',1)
-,('setting.max.memory','作业最大使用内存','','DATAX','INPUT','setting.max.memory','作业最大使用内存','Mb',1,'NUMBER','','1024','REGEX','^[1-9]\\d*$','作业最大使用内存输入错误',0,0,'',1,'',4,'',1)
-,('setting.errorlimit.record','最多错误记录数','','DATAX','INPUT','setting.errorlimit.record','最多错误记录数','条',1,'NUMBER','','','REGEX','^[1-9]\\d*$','最多错误记录数输入错误',0,0,'',1,'',5,'',1)
-,('setting.max.parallelism','作业最大并行数','','SQOOP','INPUT','setting.max.parallelism','作业最大并行数','个',1,'NUMBER','','1','REGEX','^[1-9]\\d*$','作业最大并行数输入错误',0,0,'',1,'',1,'',1)
-,('setting.max.memory','作业最大内存','','SQOOP','INPUT','setting.max.memory','作业最大内存','Mb',1,'NUMBER','','1024','REGEX','^[1-9]\\d*$','作业最大内存输入错误',0,0,'',1,'',2,'',1)
-,('where','WHERE条件','SOURCE','MYSQL','INPUT','where','WHERE条件','',0,'VARCHAR','','','REGEX','^[\\s\\S]{0,500}$','WHERE条件输入过长',0,0,'',1,'',2,'',1)
-,('writeMode','写入方式','SQOOP-SINK','HIVE','OPTION','writeMode','写入方式(OVERWRITE只对TEXT类型表生效)','',1,'OPTION','["OVERWRITE","APPEND"]','OVERWRITE','','','写入方式输入错误',0,0,'',1,'',1,'',1)
-,('partition','分区信息','SINK','HIVE','MAP','partition','分区信息(文本)','',0,'VARCHAR','','','REGEX','^[\\s\\S]{0,50}$','分区信息过长',0,0,'/api/rest_j/v1/dss/exchangis/main/datasources/render/partition/element/map',1,'',2,'',1)
-;
-INSERT INTO exchangis_job_param_config (config_key,config_name,config_direction,`type`,ui_type,ui_field,ui_label,unit,required,value_type,value_range,default_value,validate_type,validate_range,validate_msg,is_hidden,is_advanced,source,`level`,treename,sort,description,status) VALUES
-('partition','分区信息','SOURCE','HIVE','MAP','partition','分区信息(文本)',NULL,0,'VARCHAR',NULL,NULL,'REGEX','^[\\s\\S]{0,50}$','分区信息过长',0,0,'/api/rest_j/v1/dss/exchangis/main/datasources/render/partition/element/map',1,NULL,1,NULL,1)
-,('writeMode','写入方式','SQOOP-SINK','MYSQL','OPTION','writeMode','写入方式',NULL,1,'OPTION','["INSERT","UPDATE"]','INSERT',NULL,NULL,'写入方式输入错误',0,0,NULL,1,NULL,1,NULL,1)
-;
\ No newline at end of file
+-- exchangis_job_func definition
+DROP TABLE IF EXISTS `exchangis_job_func`;
+CREATE TABLE `exchangis_job_func` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `func_type` varchar(50) NOT NULL,
+ `func_name` varchar(100) NOT NULL,
+ `tab_name` varchar(50) NOT NULL COMMENT 'Tab',
+ `name_dispaly` varchar(100) DEFAULT NULL,
+ `param_num` int(11) DEFAULT '0',
+ `ref_name` varchar(100) DEFAULT NULL,
+ `description` varchar(200) DEFAULT NULL,
+ `modify_time` datetime DEFAULT NULL,
+ `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `job_func_tab_name_idx` (`tab_name`,`func_name`)
+) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8;
+
+-- exchangis_job_func_params definition
+DROP TABLE IF EXISTS `exchangis_job_func_params`;
+CREATE TABLE IF NOT EXISTS `exchangis_job_func_params`(
+ `func_id` INT(11) NOT NULL,
+ `param_name` VARCHAR(100) NOT NULL,
+ `order` INT(11) DEFAULT 0,
+ `name_display` VARCHAR(100),
+ `create_time` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ PRIMARY KEY(`func_id`, `param_name`)
+)Engine=InnoDB DEFAULT CHARSET=utf8;
+
+-- exchangis_engine_resources definition
+DROP TABLE IF EXISTS `exchangis_engine_resources`;
+CREATE TABLE `exchangis_engine_resources` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `engine_type` varchar(50) NOT NULL,
+ `resource_name` varchar(100) NOT NULL,
+ `resource_type` varchar(50) NOT NULL COMMENT 'resource type' DEFAULT 'file',
+ `resource_path` varchar(255) NOT NULL,
+ `store_uri` varchar(500) NOT NULL,
+ `create_user` varchar(50) NOT NULL,
+ `modify_time` datetime DEFAULT NULL,
+ `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `engine_res_idx` (`engine_type`,`resource_path`)
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- exchangis_engine_settings definition
+DROP TABLE IF EXISTS `exchangis_engine_settings`;
+CREATE TABLE `exchangis_engine_settings` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `engine_name` varchar(50) NOT NULL,
+ `engine_desc` varchar(500) NOT NULL,
+ `engine_settings_value` text,
+ `engine_direction` varchar(255) NOT NULL,
+ `res_loader_class` varchar(255),
+ `res_uploader_class` varchar(255),
+ `modify_time` datetime DEFAULT NULL,
+ `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `engine_setting_idx` (`engine_name`)
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- exchangis_job_transform_rule
+DROP TABLE IF EXISTS `exchangis_job_transform_rule`;
+CREATE TABLE `exchangis_job_transform_rule` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `rule_name` varchar(100) NOT NULL DEFAULT 'transform_rule',
+ `rule_type` varchar(64) NOT NULL DEFAULT 'DEF',
+ `rule_source` varchar(600) DEFAULT '{}',
+ `data_source_type` varchar(64) NOT NULL,
+ `engine_type` varchar(32),
+ `direction` varchar(32) NOT NULL DEFAULT 'NONE',
+ `create_time` datetime DEFAULT CURRENT_TIMESTAMP,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- exchangis_job_transform_processor
+DROP TABLE IF EXISTS `exchangis_job_transform_processor`;
+CREATE TABLE `exchangis_job_transform_processor` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `job_id` bigint(20) NOT NULL,
+ `code_content` text DEFAULT NULL,
+ `code_language` varchar(32) NOT NULL DEFAULT 'java',
+ `code_bml_resourceId` varchar(255) COMMENT 'BML resource id',
+ `code_bml_version` varchar(255) COMMENT 'BML version',
+ `creator` varchar(50) NOT NULL COMMENT 'Owner of processor',
+ `create_time` datetime DEFAULT CURRENT_TIMESTAMP,
+ `update_time` datetime DEFAULT CURRENT_TIMESTAMP,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
\ No newline at end of file
diff --git a/db/exchangis_dml.sql b/db/exchangis_dml.sql
index 6ea326fb9..2e6bee29e 100644
--- a/db/exchangis_dml.sql
+++ b/db/exchangis_dml.sql
@@ -1,17 +1,78 @@
--- 插入 job_param_config 记录
-INSERT INTO exchangis_job_param_config (config_key,config_name,config_direction,`type`,ui_type,ui_field,ui_label,unit,required,value_type,value_range,default_value,validate_type,validate_range,validate_msg,is_hidden,is_advanced,source,`level`,treename,sort,description,status) VALUES
-('setting.speed.bytes','作业速率限制','','DATAX','INPUT','setting.speed.bytes','作业速率限制','Mb/s',1,'NUMBER','','','REGEX','^[1-9]\\d*$','作业速率限制输入错误',0,0,'',1,'',1,'',1)
-,('setting.speed.records','作业记录数限制','','DATAX','INPUT','setting.speed.records','作业记录数限制','条/s',1,'NUMBER','','','REGEX','^[1-9]\\d*$','作业记录数限制输入错误',0,0,'',1,'',2,'',1)
-,('setting.max.parallelism','作业最大并行度','','DATAX','INPUT','setting.max.parallelism','作业最大并行度','个',1,'NUMBER','','1','REGEX','^[1-9]\\d*$','作业最大并行度输入错误',0,0,'',1,'',3,'',1)
-,('setting.max.memory','作业最大使用内存','','DATAX','INPUT','setting.max.memory','作业最大使用内存','Mb',1,'NUMBER','','1024','REGEX','^[1-9]\\d*$','作业最大使用内存输入错误',0,0,'',1,'',4,'',1)
-,('setting.errorlimit.record','最多错误记录数','','DATAX','INPUT','setting.errorlimit.record','最多错误记录数','条',1,'NUMBER','','','REGEX','^[1-9]\\d*$','最多错误记录数输入错误',0,0,'',1,'',5,'',1)
-,('setting.max.parallelism','作业最大并行数','','SQOOP','INPUT','setting.max.parallelism','作业最大并行数','个',1,'NUMBER','','1','REGEX','^[1-9]\\d*$','作业最大并行数输入错误',0,0,'',1,'',1,'',1)
-,('setting.max.memory','作业最大内存','','SQOOP','INPUT','setting.max.memory','作业最大内存','Mb',1,'NUMBER','','1024','REGEX','^[1-9]\\d*$','作业最大内存输入错误',0,0,'',1,'',2,'',1)
-,('where','WHERE条件','SOURCE','MYSQL','INPUT','where','WHERE条件','',0,'VARCHAR','','','REGEX','^[\\s\\S]{0,500}$','WHERE条件输入过长',0,0,'',1,'',2,'',1)
-,('writeMode','写入方式','SQOOP-SINK','HIVE','OPTION','writeMode','写入方式(OVERWRITE只对TEXT类型表生效)','',1,'OPTION','["OVERWRITE","APPEND"]','OVERWRITE','','','写入方式输入错误',0,0,'',1,'',1,'',1)
-,('partition','分区信息','SINK','HIVE','MAP','partition','分区信息(文本)','',0,'VARCHAR','','','REGEX','^[\\s\\S]{0,50}$','分区信息过长',0,0,'/api/rest_j/v1/dss/exchangis/main/datasources/render/partition/element/map',1,'',2,'',1)
+-- job_func records
+INSERT INTO `exchangis_job_func`(func_type,func_name,tab_name,name_dispaly,param_num,ref_name,description,modify_time) VALUES
+('TRANSFORM','dx_substr','DATAX',NULL,2,NULL,NULL,NULL)
+,('TRANSFORM','dx_pad','DATAX',NULL,3,NULL,NULL,NULL)
+,('TRANSFORM','dx_replace','DATAX',NULL,3,NULL,NULL,NULL)
+,('VERIFY','like','DATAX',NULL,1,'dx_filter',NULL,NULL)
+,('VERIFY','not like','DATAX',NULL,1,'dx_filter',NULL,NULL)
+,('VERIFY','>','DATAX',NULL,1,'dx_filter',NULL,NULL)
+,('VERIFY','<','DATAX',NULL,1,'dx_filter',NULL,NULL)
+,('VERIFY','=','DATAX',NULL,1,'dx_filter',NULL,NULL)
+,('VERIFY','!=','DATAX',NULL,1,'dx_filter',NULL,NULL)
+,('VERIFY','>=','DATAX',NULL,1,'dx_filter',NULL,NULL)
+,('TRANSFORM','dx_precision','DATAX',NULL,1,NULL,NULL,NULL)
;
-INSERT INTO exchangis_job_param_config (config_key,config_name,config_direction,`type`,ui_type,ui_field,ui_label,unit,required,value_type,value_range,default_value,validate_type,validate_range,validate_msg,is_hidden,is_advanced,source,`level`,treename,sort,description,status) VALUES
-('partition','分区信息','SOURCE','HIVE','MAP','partition','分区信息(文本)',NULL,0,'VARCHAR',NULL,NULL,'REGEX','^[\\s\\S]{0,50}$','分区信息过长',0,0,'/api/rest_j/v1/dss/exchangis/main/datasources/render/partition/element/map',1,NULL,1,NULL,1)
-,('writeMode','写入方式','SQOOP-SINK','MYSQL','OPTION','writeMode','写入方式',NULL,1,'OPTION','["INSERT","UPDATE"]','INSERT',NULL,NULL,'写入方式输入错误',0,0,NULL,1,NULL,1,NULL,1)
-;
\ No newline at end of file
+
+-- job_func_params records
+INSERT INTO `exchangis_job_func_params`(`func_id`, `param_name`, `name_display`, `order`) VALUES(1, 'startIndex', 'startIndex', 0) ON DUPLICATE KEY UPDATE `name_display` = 'startIndex';
+INSERT INTO `exchangis_job_func_params`(`func_id`, `param_name`, `name_display`, `order`) VALUES(1, 'length', 'length', 1) ON DUPLICATE KEY UPDATE `name_display` = 'length';
+INSERT INTO `exchangis_job_func_params`(`func_id`, `param_name`, `name_display`, `order`) VALUES(2, 'padType', 'padType(r or l)', 0) ON DUPLICATE KEY UPDATE `name_display` = 'padType(r or l)';
+INSERT INTO `exchangis_job_func_params`(`func_id`, `param_name`, `name_display`, `order`) VALUES(2, 'length', 'length', 1) ON DUPLICATE KEY UPDATE `name_display` = 'length';
+INSERT INTO `exchangis_job_func_params`(`func_id`, `param_name`, `name_display`, `order`) VALUES(2, 'padString', 'padString', 2) ON DUPLICATE KEY UPDATE `name_display` = 'padString';
+INSERT INTO `exchangis_job_func_params`(`func_id`, `param_name`, `name_display`, `order`) VALUES(3, 'startIndex', 'startIndex', 0) ON DUPLICATE KEY UPDATE `name_display` = 'startIndex';
+INSERT INTO `exchangis_job_func_params`(`func_id`, `param_name`, `name_display`, `order`) VALUES(3, 'length', 'length', 1) ON DUPLICATE KEY UPDATE `name_display` = 'length';
+INSERT INTO `exchangis_job_func_params`(`func_id`, `param_name`, `name_display`, `order`) VALUES(3, 'replaceString', 'replaceString', 2) ON DUPLICATE KEY UPDATE `name_display` = 'replaceString';
+INSERT INTO `exchangis_job_func_params`(`func_id`, `param_name`, `name_display`) VALUES(4, 'value', 'value') ON DUPLICATE KEY UPDATE `name_display` = 'value';
+INSERT INTO `exchangis_job_func_params`(`func_id`, `param_name`, `name_display`) VALUES(5, 'value', 'value') ON DUPLICATE KEY UPDATE `name_display` = 'value';
+INSERT INTO `exchangis_job_func_params`(`func_id`, `param_name`, `name_display`) VALUES(6, 'value', 'value') ON DUPLICATE KEY UPDATE `name_display` = 'value';
+INSERT INTO `exchangis_job_func_params`(`func_id`, `param_name`, `name_display`) VALUES(7, 'value', 'value') ON DUPLICATE KEY UPDATE `name_display` = 'value';
+INSERT INTO `exchangis_job_func_params`(`func_id`, `param_name`, `name_display`) VALUES(8, 'value', 'value') ON DUPLICATE KEY UPDATE `name_display` = 'value';
+INSERT INTO `exchangis_job_func_params`(`func_id`, `param_name`, `name_display`) VALUES(9, 'value', 'value') ON DUPLICATE KEY UPDATE `name_display` = 'value';
+INSERT INTO `exchangis_job_func_params`(`func_id`, `param_name`, `name_display`) VALUES(10, 'value', 'value') ON DUPLICATE KEY UPDATE `name_display` = 'value';
+
+-- job_param_config records
+INSERT INTO `exchangis_job_param_config` (config_key,config_name,config_direction,`type`,ui_type,ui_field,ui_label,unit,required,value_type,value_range,default_value,validate_type,validate_range,validate_msg,is_hidden,is_advanced,source,`level`,treename,sort,description,status,ref_id) VALUES
+('setting.speed.byte','作业速率限制','','DATAX','INPUT','setting.speed.bytes','作业速率限制','Mb/s',1,'NUMBER','','5','REGEX','^[1-9]\\d*$','作业速率限制输入错误',0,0,'',1,'',1,'',1,NULL)
+,('setting.speed.record','作业记录数限制','','DATAX','INPUT','setting.speed.records','作业记录数限制','条/s',1,'NUMBER','','100','REGEX','^[1-9]\\d*$','作业记录数限制输入错误',0,0,'',1,'',2,'',1,NULL)
+,('setting.speed.channel','作业最大并行度','','DATAX','INPUT','setting.max.parallelism','作业最大并行度','个',1,'NUMBER','','1','REGEX','^[1-9]\\d*$','作业最大并行度输入错误',0,0,'',1,'',3,'',1,NULL)
+,('setting.max.memory','作业最大使用内存','','DATAX','INPUT','setting.max.memory','作业最大使用内存','Mb',1,'NUMBER','','1024','REGEX','^[1-9]\\d*$','作业最大使用内存输入错误',0,0,'',1,'',4,'',1,NULL)
+,('setting.errorLimit.record','最多错误记录数','','DATAX','INPUT','setting.errorlimit.record','最多错误记录数','条',0,'NUMBER','','','REGEX','^[0-9]\\d*$','最多错误记录数输入错误',0,0,'',1,'',5,'',1,NULL)
+,('setting.max.parallelism','作业最大并行数','','SQOOP','INPUT','setting.max.parallelism','作业最大并行数','个',1,'NUMBER','','1','REGEX','^[1-9]\\d*$','作业最大并行数输入错误',0,0,'',1,'',1,'',1,NULL)
+,('setting.max.memory','作业最大内存','','SQOOP','INPUT','setting.max.memory','作业最大内存','Mb',1,'NUMBER','','1024','REGEX','^[1-9]\\d*$','作业最大内存输入错误',0,0,'',1,'',2,'',1,NULL)
+,('where','WHERE条件','SOURCE','MYSQL','INPUT','where','WHERE条件','',0,'VARCHAR','','','REGEX','^[\\s\\S]{0,500}$','WHERE条件输入过长',0,0,'',1,'',2,'',1,NULL)
+,('writeMode','写入方式','SQOOP-SINK','HIVE','OPTION','writeMode','写入方式(OVERWRITE只对TEXT类型表生效)','',1,'OPTION','["OVERWRITE","APPEND"]','OVERWRITE','','','写入方式输入错误',0,0,'',1,'',1,'',1,NULL)
+,('partition','分区信息','SINK','HIVE','MAP','partition','分区信息(文本)','',0,'VARCHAR','','','REGEX','^[\\s\\S]{0,50}$','分区信息过长',0,0,'/api/rest_j/v1/dss/exchangis/main/datasources/render/partition/element/map',1,'',2,'',1,NULL)
+;
+INSERT INTO `exchangis_job_param_config` (config_key,config_name,config_direction,`type`,ui_type,ui_field,ui_label,unit,required,value_type,value_range,default_value,validate_type,validate_range,validate_msg,is_hidden,is_advanced,source,`level`,treename,sort,description,status,ref_id) VALUES
+('partition','分区信息','SOURCE','HIVE','MAP','partition','分区信息(文本)','',0,'VARCHAR','','','REGEX','^[\\s\\S]{0,50}$','分区信息过长',0,0,'/api/rest_j/v1/dss/exchangis/main/datasources/render/partition/element/map',1,'',2,'',1,NULL)
+,('writeMode','写入方式','SQOOP-SINK','MYSQL','OPTION','writeMode','写入方式','',1,'OPTION','["INSERT","UPDATE"]','INSERT','','','写入方式输入错误',0,0,'',1,'',1,'',1,NULL)
+,('batchSize','批量大小','DATAX-SINK','ELASTICSEARCH','INPUT','batchSize','批量大小','',0,'NUMBER','','','REGEX','^[1-9]\\d*$','批量大小输入错误',0,0,'',1,'',1,'',1,NULL)
+,('query','query条件','DATAX-SOURCE','MONGODB','INPUT','query','query条件','',0,'VARCHAR','','','REGEX','^[\\s\\S]{0,500}$','query条件输入过长',0,0,'',1,'',2,'',1,NULL)
+,('writeMode','写入方式','DATAX-SINK','MONGODB','OPTION','writeMode','写入方式','',1,'OPTION','["insert","replace"]','insert','','','写入方式输入错误',0,0,'',1,'',1,'',1,NULL)
+,('batchSize','批量大小','DATAX-SINK','MONGODB','INPUT','batchSize','批量大小','',0,'NUMBER','','','REGEX','^[1-9]\\d*$','批量大小输入错误',0,0,'',1,'',2,'',1,NULL)
+,('transferMode','传输方式','DATAX-SOURCE','HIVE','OPTION','transferMode','传输方式','',1,'OPTION','["二进制","记录"]','二进制','','','该传输方式不可用',0,0,'',1,'',1,'',1,NULL)
+,('nullFormat','空值字符','DATAX-SOURCE','HIVE','INPUT','nullFormat','空值字符','',0,'VARCHAR','','','REGEX','^[\\s\\S]{0,50}$','空值字符输入错误',0,0,'',1,'',2,'',1,49)
+,('writeMode','写入方式','DATAX-SINK','MYSQL','OPTION','writeMode','写入方式','',1,'OPTION','["INSERT","UPDATE"]','INSERT','','','写入方式输入错误',0,0,'',1,'',1,'',1,NULL)
+,('writeMode','写入方式','DATAX-SINK','HIVE','OPTION','writeMode','写入方式(OVERWRITE只对TEXT类型表生效)','',1,'OPTION','["append","truncate"]','append','','','写入方式输入错误',0,0,'',1,'',1,'',1,NULL)
+;
+INSERT INTO `exchangis_job_param_config` (config_key,config_name,config_direction,`type`,ui_type,ui_field,ui_label,unit,required,value_type,value_range,default_value,validate_type,validate_range,validate_msg,is_hidden,is_advanced,source,`level`,treename,sort,description,status,ref_id) VALUES
+('nullFormat','空值字符','DATAX-SINK','HIVE','INPUT','nullFormat','空值字符','',0,'VARCHAR','','','REGEX','^[\\s\\S]{0,50}$','空值字符输入错误',0,0,'',1,'',2,'',1,49)
+,('nullFormat','空值字符','DATAX-SINK','ELASTICSEARCH','INPUT','nullFormat','空值字符','',0,'VARCHAR','','','REGEX','^[\\s\\S]{0,50}$','空值字符输入错误',0,0,'',1,'',2,'',1,49)
+,('where','WHERE条件','SOURCE','ORACLE','INPUT','where','WHERE条件',NULL,0,'VARCHAR',NULL,NULL,'REGEX','^[\\s\\S]{0,500}$','WHERE条件输入过长',0,0,NULL,1,'',2,NULL,1,NULL)
+,('writeMode','写入方式','DATAX-SINK','ORACLE','OPTION','writeMode','写入方式',NULL,1,'OPTION','["INSERT","UPDATE"]','INSERT',NULL,NULL,'写入方式输入错误',0,0,NULL,1,NULL,1,NULL,1,NULL)
+;
+
+-- engine_settings records
+INSERT INTO `exchangis_engine_settings` (id, engine_name, engine_desc, engine_settings_value, engine_direction, res_loader_class, res_uploader_class, modify_time) VALUES
+(1, 'datax', 'datax sync engine', '{}', 'mysql->hive,hive->mysql,mysql->oracle,oracle->mysql,oracle->hive,hive->oracle,mongodb->hive,hive->mongodb,mysql->elasticsearch,oracle->elasticsearch,mongodb->elasticsearch,mysql->mongodb,mongodb->mysql,oracle->mongodb,mongodb->oracle', 'com.webank.wedatasphere.exchangis.engine.resource.loader.datax.DataxEngineResourceLoader', NULL, NULL, '2022-08-09 18:20:51.0'),
+(2, 'sqoop', 'hadoop tool', '{}', 'mysql->hive,hive->mysql', '', NULL, NULL);
+
+-- exchangis_job_transform_rule records
+INSERT INTO `exchangis_job_transform_rule` (rule_name,rule_type,rule_source,data_source_type,engine_type,direction) VALUES
+('es_with_post_processor','DEF','{"types": ["MAPPING", "PROCESSOR"]}','ELASTICSEARCH',NULL,'SINK')
+,('es_fields_not_editable','MAPPING','{"fieldEditEnable": false, "fieldDeleteEnable": false}','ELASTICSEARCH',NULL,'SINK')
+,('hive_sink_not_access','MAPPING','{"fieldEditEnable": false, "fieldDeleteEnable": false, "fieldAddEnable": false}','HIVE',NULL,'SINK')
+,('mongo_field_match','MAPPING','{"fieldMatchStrategyName": "CAMEL_CASE_MATCH"}','MONGODB',NULL,'SINK')
+,('mysql_field_source_match','MAPPING','{"fieldMatchStrategyName": "CAMEL_CASE_MATCH","fieldEditEnable": true, "fieldDeleteEnable": true, "fieldAddEnable": false}','MYSQL',NULL,'SOURCE')
+;
+
diff --git a/docs/en_US/ch1/component_upgrade_en.md b/docs/en_US/ch1/component_upgrade_en.md
index 7f9e69d95..3bc6e3b47 100644
--- a/docs/en_US/ch1/component_upgrade_en.md
+++ b/docs/en_US/ch1/component_upgrade_en.md
@@ -1,7 +1,7 @@
# Exchangis Component Upgrade Documentation
-This article mainly introduces the upgrade steps for adapting DSS1.1.0 and Linkis1.1.1 on the basis of the original installation of the Exchangis service. The biggest difference between the Exchangis1.0.0 and the Exchangis1.0.0-rc1 version is the installation of the ExchangisAppconn, which needs to be replaced by the entire Exchangisappconn. and load### 1.升级Exchangis前的工作
-Before you upgrade Exchangis, please follow the[DSS1.1.0Install and deploy documentation](https://github.com/WeBankFinTech/Exchangis/blob/dev-1.0.1-rc/docs/zh_CN/ch1/exchangis_deploy_cn.md)
-and [Linkis1.1.1Install and deploy documentation](https://github.com/WeBankFinTech/Exchangis/blob/dev-1.0.1-rc/docs/zh_CN/ch1/exchangis_deploy_cn.md)Complete the installation and upgrade of DSS and Linkis
+This article mainly introduces the upgrade steps for adapting DSS1.1.2 and Linkis1.4.0 on the basis of the original installation of the Exchangis service. The biggest difference between the Exchangis1.1.2 and the Exchangis1.0.0 version is the installation of the ExchangisAppconn, which needs to be replaced by the entire Exchangisappconn. and load### 1.升级Exchangis前的工作
+Before you upgrade Exchangis, please follow the[DSS1.1.2Install and deploy documentation](https://github.com/WeBankFinTech/DataSphereStudio-Doc/tree/main/zh_CN/%E5%AE%89%E8%A3%85%E9%83%A8%E7%BD%B2)
+and [Linkis1.4.0Install and deploy documentation](https://linkis.staged.apache.org/zh-CN/docs/1.4.0/deployment/deploy-quick)Complete the installation and upgrade of DSS and Linkis
### 2.Exchangis upgrade steps
@@ -13,7 +13,7 @@ Go to the following directory and find exchangis appconn folder and delete:
```
#### 2)Download binary package
-We provide the upgrade material package of ExchangisAppconn, which you can download and use directly.[Click to jump Release interface](https://osp-1257653870.cos.ap-guangzhou.myqcloud.com/WeDatasphere/Exchangis/exchangis1.0.0-rc/exchangis-appconn.zip)
+We provide the upgrade material package of ExchangisAppconn, which you can download and use directly.[Click to jump Release interface](https://osp-1257653870.cos.ap-guangzhou.myqcloud.com/WeDatasphere/Exchangis/exchangis1.1.2/Exchangis1.1.2_install_package.zip)
#### 3) Compile and package
@@ -72,4 +72,4 @@ After the installation and deployment of exchangis-appconn is completed, you can
2. Check whether the project is created synchronously on the exchange side. If the creation is successful, the appconn installation is successful.
![image](https://user-images.githubusercontent.com/27387830/169782337-678f2df0-080a-495a-b59f-a98c5a427cf8.png)
-For more usage, please refer to[Exchangis1.0 User Manual](https://github.com/WeBankFinTech/Exchangis/blob/dev-1.0.1-rc/docs/zh_CN/ch1/exchangis_user_manual_cn.md)
+For more usage, please refer to[Exchangis User Manual](docs/zh_CN/ch1/exchangis_user_manual_cn.md)
diff --git a/docs/en_US/ch1/exchangis_appconn_deploy_en.md b/docs/en_US/ch1/exchangis_appconn_deploy_en.md
index f42a85742..1b195c0c0 100644
--- a/docs/en_US/ch1/exchangis_appconn_deploy_en.md
+++ b/docs/en_US/ch1/exchangis_appconn_deploy_en.md
@@ -3,7 +3,7 @@
This paper mainly introduces the deployment, configuration and installation of ExchangisAppConn in DSS(DataSphere Studio)1.0.1.
### 1. Preparations for the deployment of ExchangisAppConn
-Before you deploy ExchangisAppConn, please follow the [Exchangis1.0.0 to install the deployment document](https://github.com/WeBankFinTech/Exchangis/blob/dev-1.0.0/docs/en_US/ch1/exchangis_deploy_en.md) to complete the installation of Exchangis1.0.0 and other related components, and ensure that the basic functions of the project are available.
+Before you deploy ExchangisAppConn, please follow the [Exchangis to install the deployment document](docs/en_US/ch1/exchangis_deploy_en.md) to complete the installation of Exchangis and other related components, and ensure that the basic functions of the project are available.
### 2. Download and compilation of the ExchangisAppConn plugin
#### 1) Download binary package
@@ -67,7 +67,7 @@ After the exchangis-appconn is installed and deployed, the following steps can b
2. Check whether the project is created synchronously on Exchangis. Successful creation means successful installation of appconn
![image](https://user-images.githubusercontent.com/27387830/169782337-678f2df0-080a-495a-b59f-a98c5a427cf8.png)
-For more operation, please refer to [Exchangis 1.0 User Manual](https://github.com/WeBankFinTech/Exchangis/blob/dev-1.0.0/docs/en_US/ch1/exchangis_user_manual_en.md)
+For more operation, please refer to [Exchangis User Manual](docs/zh_CN/ch1/exchangis_user_manual_cn.md)
### 5.Exchangis AppConn installation principle
diff --git a/docs/en_US/ch1/exchangis_datasource_en.md b/docs/en_US/ch1/exchangis_datasource_en.md
index 394eae7cb..ffbffdf98 100644
--- a/docs/en_US/ch1/exchangis_datasource_en.md
+++ b/docs/en_US/ch1/exchangis_datasource_en.md
@@ -14,7 +14,7 @@ In order to build a common data source module, the data source module is mainly
Figure 2-1 Overall Architecture Design
-## 3、Detailed explanation of modules
+## 3、Detailed explanation of modules
### 3.1 datasource-server
@@ -106,7 +106,7 @@ Batch import and export of datasource configuration.
Description:
-The background needs to integrate it with the labeling function of Linkis1.1.1, and give the datasource a labeling relationship.
+The background needs to integrate it with the labeling function of Linkis1.4.0, and give the datasource a labeling relationship.
Process design:
diff --git a/docs/en_US/ch1/exchangis_datax_deploy_en.md b/docs/en_US/ch1/exchangis_datax_deploy_en.md
new file mode 100644
index 000000000..7458e8212
--- /dev/null
+++ b/docs/en_US/ch1/exchangis_datax_deploy_en.md
@@ -0,0 +1,84 @@
+# DataX engine uses documentation
+
+### Prepare the environment
+
+The DataX engine is an indispensable component for executing Exchangis data synchronization tasks. Data synchronization tasks can be performed only after the DataX engine is installed and deployed. Also, ensure that DataX is installed on the deployed machine.
+
+Before you install and deploy DataX engine, Please complete the installation of Exchangis and related components according to the [Exchangis installation and deployment document](docs/en_US/ch1/exchangis_deploy_en.md), and ensure that the basic functions of the project are available.
+
+It is strongly recommended that you use the native DataX to perform the test task on this node before performing the DataX task, so as to check whether the environment of this node is normal.
+
+| Environment variable name | Environment variable content | Remark |
+| :-----------------------: | :--------------------------: | ------------ |
+| JAVA_HOME | JDK installation path | Required |
+| DATAX_HOME | DataX installation path | Not Required |
+| DATAX_CONF_DIR | DataX config path | Not Required |
+
+### Prepare installation package
+
+#### 1)Download binary package
+
+Exchangis1.1.2 and Linkis 1.4.0 support the mainstream DataX versions 1.4.6 and 1.4.7, and later versions may need to modify some codes for recompilation.
+
+[Click to jump to Release interface](https://github.com/WeBankFinTech/Exchangis/releases/tag/release-1.1.2)
+
+#### 2)Compile and package
+
+If you want to develop and compile datax engine yourself, the specific compilation steps are as follows:
+
+1.clone Exchangis's source code
+
+2.Under exchangis-plugins module, find sqoop engine and compile sqoop separately, as follows :
+
+```
+cd {EXCHANGIS_CODE_HOME}/exchangis-plugins/engine/datax
+mvn clean install
+```
+
+Then the datax engine installation package will be found in this path.
+
+```
+{EXCHANGIS_CODE_HOME}\exchangis-plugins\datax\target\out\datax
+```
+
+
+### Start deployment
+
+#### 1)DataX engine installation
+
+1、Get the packed datax.zip material package, the directory structure is
+
+```shell
+datax
+-- dist
+-- plugin
+```
+
+2、Place in the following directory in the linkis installation path
+
+```shell
+cd {LINKIS_HOME}/linkis/lib/linkis-engineconn-plugins
+```
+
+(Note that depending on which users the current datax engine has permissions for, they are generally hadoop user groups and hadoop users)
+
+
+#### 2)Restart linkis-engineplugin service to make datax engine take effect
+
+New engines joining linkis will not take effect until the engineplugin service of linkis is restarted, and the restart script is. /linkis-daemon.sh in the Linkis installation directory. The specific steps are as follows :
+
+```
+cd {LINKIS_INSTALL_HOME}/links/sbin/
+./linkis-daemon.sh restart cg-engineplugin
+```
+
+After the service is successfully started, check whether the datax engine is installed in the linkis database
+
+```shell
+select * from linkis_cg_engine_conn_plugin_bml_resources where engine_conn_type='datax';
+```
+
+At this point, the datax installation and deployment is complete.
+
+For a more detailed introduction of engineplugin, please refer to the following article.
+https://linkis.apache.org/zh-CN/docs/latest/deployment/install-engineconn
\ No newline at end of file
diff --git a/docs/en_US/ch1/exchangis_deploy_en.md b/docs/en_US/ch1/exchangis_deploy_en.md
index 354bfea8c..bcef1232d 100644
--- a/docs/en_US/ch1/exchangis_deploy_en.md
+++ b/docs/en_US/ch1/exchangis_deploy_en.md
@@ -13,26 +13,26 @@ Exchangis installation is mainly divided into the following four steps :
| Dependent components | Must be installed | Install through train |
|------------------------------------------------------------------------------| ------ | --------------- |
-| MySQL (5.5+) | yes | [How to install mysql](https://www.runoob.com/mysql/mysql-install.html) |
-| JDK (1.8.0_141) | yes | [How to install JDK](https://www.runoob.com/java/java-environment-setup.html) |
-| Hadoop(2.7.2,Other versions of Hadoop need to compile Linkis by themselves.) | yes | [Hadoop stand-alone deployment](https://hadoop.apache.org/releases.html) ;[Hadoop distributed deployment](https://hadoop.apache.org/releases.html) |
-| Hive(2.3.3,Other versions of Hive need to compile Linkis by themselves.) | yes | [Hive quick installation](https://hive.apache.org/downloads.html) |
+| JDK (1.8.0_141) | yes | [How to install JDK](https://www.oracle.com/java/technologies/downloads/) |
+| MySQL (5.5+) | yes | [How to install mysql](https://mysql.net.cn/) |
+| Hadoop(3.3.4,Other versions of Hadoop need to compile Linkis by themselves.) | yes | [Hadoop deployment](https://www.apache.org/dyn/closer.cgi/hadoop/common/hadoop-3.3.4/hadoop-3.3.4.tar.gz) |
+| Hive(2.3.3,Other versions of Hive need to compile Linkis by themselves.) | yes | [Hive quick installation](https://www.apache.org/dyn/closer.cgi/hive/) |
| SQOOP (1.4.6) | yes | [How to install Sqoop](https://sqoop.apache.org/docs/1.4.6/SqoopUserGuide.html) |
-| DSS1.1.0 | yes | [How to install DSS](https://github.com/WeBankFinTech/DataSphereStudio-Doc/blob/main/en_US/Installation_and_Deployment/DSS%26Linkis_one-click_deployment_document_stand-alone_version.md) |
-| Linkis1.1.1 | yes | [How to install Linkis](https://linkis.apache.org/zh-CN/docs/latest/deployment/deploy-quick) |
-| Nginx | yes | [How to install Nginx](http://nginx.org/en/linux_packages.html) |
+| DSS1.1.2 | yes | [How to install DSS](https://github.com/WeBankFinTech/DataSphereStudio-Doc/tree/main/zh_CN/%E5%AE%89%E8%A3%85%E9%83%A8%E7%BD%B2) |
+| Linkis1.4.0 | yes | [How to install Linkis](https://linkis.apache.org/zh-CN/docs/1.4.0/deployment/deploy-quick) |
+| Nginx | yes | [How to install Nginx](http://nginx.org/) |
Underlying component checking
-$\color{#FF0000}{Note: be sure to reinstall dss1.1.0, and the linkis version must be greater than 1.1.1. Please recompile linkis and use the package released on June 15th }$
+$\color{#FF0000}{Note: be sure to reinstall dss1.1.2, and linkis1.4.0. Please recompile linkis and use the package released on June 15th }$
-[linkis1.1.1 code address ](https://github.com/apache/incubator-linkis/tree/release-1.1.1)
+[linkis1.4.0 code address ](https://github.com/apache/incubator-linkis/tree/release-1.4.0)
-[DSS1.1.0 code address ](https://github.com/WeBankFinTech/DataSphereStudio/tree/dev-1.1.0)
+[DSS1.1.2 code address ](https://github.com/WeBankFinTech/DataSphereStudio)
datasource enabled
-By default, two services related to datasources (ps-data-source-manager, ps-metadatamanager) will not be started in the startup script of linkis. If you want to use datasource services, you can start them by modifying the export enable _ metadata _ manager = true value in $ linkis_conf_dir/linkis-env.sh. When the service is started and stopped through linkis-start-all.sh/linkis-stop-all.sh, the datasource service will be started and stopped. For more details about data sources, please refer to [Data Source Function Usage](https://linkis.apache.org/zh-CN/docs/latest/user-guide/datasource-manual)
+By default, two services related to datasources (ps-data-source-manager, ps-metadatamanager) will not be started in the startup script of linkis. If you want to use datasource services, you can start them by modifying the export enable _ metadata _ manager = true value in $ linkis_conf_dir/linkis-env.sh. When the service is started and stopped through linkis-start-all.sh/linkis-stop-all.sh, the datasource service will be started and stopped. For more details about data sources, please refer to [Data Source Function Usage](https://linkis.apache.org/zh-CN/docs/1.1.0/deployment/start-metadatasource)
#### 1.2 Create Linux users
@@ -55,11 +55,11 @@ INSERT INTO `linkis_ps_dm_datasource_env` (`env_name`, `env_desc`, `datasource_t
INSERT INTO `linkis_ps_dm_datasource_env` (`env_name`, `env_desc`, `datasource_type_id`, `parameter`, `create_time`, `create_user`, `modify_time`, `modify_user`) VALUES ('开发环境UAT', '开发环境UAT', 4, '{"uris":"thrift://${HIVE_METADATA_IP}:${HIVE_METADATA_PORT}", "hadoopConf":{"hive.metastore.execute.setugi":"true"}}', now(), NULL, now(), NULL);
```
-If the hive data source needs kerberos authentication when deployed, you need to specify a parameter keyTab in the parameter field of the Linkis_ps_dm_datasource_env table, and the way to obtain its value can be seen: [Setting and authenticating hive data source in linkis](https://linkis.apache.org/zh-CN/docs/latest/user-guide/datasource-manual).
+If the hive data source needs kerberos authentication when deployed, you need to specify a parameter keyTab in the parameter field of the Linkis_ps_dm_datasource_env table, and the way to obtain its value can be seen: [Setting and authenticating hive data source in linkis](https://linkis.apache.org/zh-CN/docs/latest/auth/token).
#### 1.4 Underlying component checking
-Please ensure that DSS1.1.0 and Linkis1.1.1 are basically available. HiveQL scripts can be executed in the front-end interface of DSS, and DSS workflows can be created and executed normally.
+Please ensure that DSS1.1.2 and Linkis1.4.0 are basically available. HiveQL scripts can be executed in the front-end interface of DSS, and DSS workflows can be created and executed normally.
## 2. Exchangis installation and deployment
@@ -67,7 +67,7 @@ Please ensure that DSS1.1.0 and Linkis1.1.1 are basically available. HiveQL scri
#### 2.1.1 Download binary package
-Download the latest installation package from the Released release of Exchangis [click to jump to the release interface](https://github.com/WeBankFinTech/Exchangis/releases/tag/release-1.0.0).
+Download the latest installation package from the Released release of Exchangis [click to jump to the release interface](https://github.com/WeBankFinTech/Exchangis/releases).
#### 2.1.2 Compile and package
@@ -94,6 +94,8 @@ Download the latest installation package from the Released release of Exchangis
|-- db:Database initialization SQL directory
|-- exchangis-extds
|-- packages:Exchangis installation package directory
+ |-- exchangis-extds:exchangis datasource library
+ |-- lib:library
|-- sbin:Script storage directory
```
@@ -159,7 +161,28 @@ DATABASE=
Enter `y` to start installing Exchange IS service, or `n` to not install it.
-#### 2.5.3 Start service
+#### 2.5.3 Change the path of the configuration file and log file
+
+In the 'env.properties' file in the sbin directory, set the configuration file path and log file path
+
+```yaml
+EXCHANGIS_CONF_PATH="/appcom/config/exchangis-config/background"
+EXCHANGIS_LOG_PATH="/appcom/logs/exchangis/background"
+MODULE_DEFAULT_PREFIX="dss-exchangis-main-"
+MODULE_DEFAULT_SUFFIX="-dev"
+```
+
+EXCHANGIS_CONF_PATH indicates the configuration file path, and EXCHANGIS_LOG_PATH indicates the log file path. If the preceding configurations are used, perform the following operations:
+
+```yaml
+cd {EXCHANGIS_DEPLOY_PATH}
+cp -r config /appcom/config/exchangis-config/background
+mkdir -p /appcom/logs/exchangis/background
+```
+
+When the service is started, the configuration file in the corresponding path is used and logs are written to the corresponding path
+
+#### 2.5.4 Start service
Execute the following command to start Exchangis Server:
@@ -175,7 +198,7 @@ Execute the following command to start Exchangis Server:
After executing the startup script, the following prompt will appear, eureka address will also be typed in the console when starting the service:
-![企业微信截图_16532930262583](https://user-images.githubusercontent.com/27387830/169773764-1c5ed6fb-35e9-48cb-bac8-6fa7f738368a.png)
+![企业微信截图_16532930262583](../../../images/zh_CN/ch1/register_eureka.png)
### 2.6 Check whether the service started successfully.
@@ -191,7 +214,7 @@ As shown in the figure below:
#### 2.7.1 Get the front-end installation package
-Exchangis has provided compiled front-end installation package by default, which can be downloaded and used directly :[Click to jump to the Release interface](https://osp-1257653870.cos.ap-guangzhou.myqcloud.com/WeDatasphere/Exchangis/exchangis1.0.0/dist.zip)
+Exchangis has provided compiled front-end installation package by default, which can be downloaded and used directly :[Click to jump to the Release interface](https://github.com/WeBankFinTech/Exchangis/releases)
You can also compile the exchange front-end by yourself and execute the following command in the exchanise root directory:
@@ -205,7 +228,7 @@ Get the compiled dist.zip front-end package from the `web/` path.
The acquired front-end package can be placed anywhere on the server. Here, it is recommended that you keep the same directory as the back-end installation address, place it in the same directory and unzip it.
-#### 2.7.2 Front-end installation deployment
+#### 3.3.4 Front-end installation deployment
1. Decompress front-end installation package
@@ -273,12 +296,12 @@ Please visit the Exchange front-end page at http://${EXCHANGIS_INSTALL_IP}:8098
## 3. DSS ExchangisAppConn installation and deployment
-If you want to use Exchangis1.0.0 front-end, you also need to install the DSS ExchangisAppConn plugin. Please refer to: [ExchangisAppConn installation documentation for plugins ](https://github.com/WeBankFinTech/Exchangis/blob/dev-1.0.0/docs/en_US/ch1/exchangis_appconn_deploy_en.md)
+If you want to use Exchangis front-end, you also need to install the DSS ExchangisAppConn plugin. Please refer to: [ExchangisAppConn installation documentation for plugins ](docs/en_US/ch1/exchangis_appconn_deploy_en.md)
## 4. Linkis Sqoop engine installation and deployment
-If you want to execute the Sqoop operation of Exchangis1.0.0 normally, you also need to install the Linkis Sqoop engine. Please refer to: : [Linkis Sqoop engine installation documentation ](https://linkis.apache.org/zh-CN/docs/latest/engine-usage/sqoop)
+If you want to execute the Sqoop operation of Exchangis normally, you also need to install the Linkis Sqoop engine. Please refer to: : [Linkis Sqoop engine installation documentation ](https://linkis.apache.org/zh-CN/docs/1.1.2/engine-usage/sqoop/)
## 5. How to log in and use Exchangis
-Exchangis1.0 for more instructions, please refer to the user manual.[Exchangis1.0 user manual](https://github.com/WeBankFinTech/Exchangis/blob/dev-1.0.0/docs/en_US/ch1/exchangis_user_manual_en.md)
+Exchangis for more instructions, please refer to the user manual.[Exchangis user manual](docs/en_US/ch1/exchangis_user_manual_en.md)
diff --git a/docs/en_US/ch1/exchangis_sqoop_deploy_en.md b/docs/en_US/ch1/exchangis_sqoop_deploy_en.md
index 9ef74d74c..062f797d0 100644
--- a/docs/en_US/ch1/exchangis_sqoop_deploy_en.md
+++ b/docs/en_US/ch1/exchangis_sqoop_deploy_en.md
@@ -2,7 +2,7 @@
### Prepare the environment
Sqoop engine is an indispensable component to perform Exchange IS data synchronization task, and only after the installation and deployment of Sqoop engine can it successfully perform data synchronization task. At the same time, make sure sqoop is installed on the deployed machine.
-Before you install and deploy Sqoop engine, Please complete the installation of Exchangis 1.0.0 and related components according to the [Exchangis 1.0.0 installation and deployment document](https://github.com/WeBankFinTech/Exchangis/blob/dev-1.0.0/docs/en_US/ch1/exchangis_deploy_en.md), and ensure that the basic functions of the project are available.
+Before you install and deploy Sqoop engine, Please complete the installation of Exchangis and related components according to the [Exchangis installation and deployment document](docs/en_US/ch1/exchangis_deploy_en.md), and ensure that the basic functions of the project are available.
Sqoop engine mainly depends on Hadoop basic environment. If this node needs to deploy Sqoop engine, it needs to deploy Hadoop client environment.
@@ -26,9 +26,9 @@ It is strongly recommended that you use the native Sqoop to perform the test tas
### Prepare installation package
#### 1)Download binary package
-Exchangis1.0.0 and Linkis 1.1.1 support the mainstream Sqoop versions 1.4.6 and 1.4.7, and later versions may need to modify some codes for recompilation.
+Exchangis1.1.2 and Linkis 1.4.0 support the mainstream Sqoop versions 1.4.6 and 1.4.7, and later versions may need to modify some codes for recompilation.
-[Click to jump to Release interface](https://github.com/WeBankFinTech/Exchangis/releases/tag/release-1.0.0)
+[Click to jump to Release interface](https://github.com/WeBankFinTech/Exchangis/releases)
#### 2)Compile and package
If you want to develop and compile sqoop engine yourself, the specific compilation steps are as follows:
@@ -74,4 +74,4 @@ cd {LINKIS_INSTALL_HOME}/links/sbin/
After the service is successfully started, the installation and deployment of sqoop will be completed.
For a more detailed introduction of engineplugin, please refer to the following article.
-https://linkis.apache.org/zh-CN/docs/latest/architecture/computation-governance-services/engine/engine-conn
\ No newline at end of file
+https://linkis.apache.org/zh-CN/docs/latest/deployment/install-engineconn
\ No newline at end of file
diff --git a/docs/en_US/ch1/exchangis_user_manual_en.md b/docs/en_US/ch1/exchangis_user_manual_en.md
index 7ad3b9e6a..bdd0856f9 100644
--- a/docs/en_US/ch1/exchangis_user_manual_en.md
+++ b/docs/en_US/ch1/exchangis_user_manual_en.md
@@ -6,7 +6,7 @@
## 二、Login Exchangis1.0
- Exchangis1.0 is currently a part of DSS**data exchange component**, and it can be accessed in the component list by logging in to DSS. Therefore, before using Exchangis 1.0, please make basic deployment of DSS, Exchange IS 1.0, Linkis and other related components to ensure that the components' functions are available. This article will not go into details. See for details:[exchangis_deploy_en](https://github.com/WeBankFinTech/Exchangis/blob/dev-1.0.0/docs/en_US/ch1/exchangis_deploy_en.md)和[exchangis-appconn_deploy_en](https://github.com/WeBankFinTech/Exchangis/blob/dev-1.0.0/docs/en_US/ch1/exchangis_appconn_deploy_en.md)
+ Exchangis1.0 is currently a part of DSS**data exchange component**, and it can be accessed in the component list by logging in to DSS. Therefore, before using Exchangis 1.0, please make basic deployment of DSS, Exchange IS 1.0, Linkis and other related components to ensure that the components' functions are available. This article will not go into details. See for details:[exchangis_deploy_en](docs/en_US/ch1/exchangis_deploy_en.md)和[exchangis-appconn_deploy_en](docs/en_US/ch1/exchangis_appconn_deploy_en.md)
### 1、Login DSS
diff --git a/docs/zh_CN/ch1/component_upgrade_cn.md b/docs/zh_CN/ch1/component_upgrade_cn.md
index fd4501f35..94ca8e7f2 100644
--- a/docs/zh_CN/ch1/component_upgrade_cn.md
+++ b/docs/zh_CN/ch1/component_upgrade_cn.md
@@ -1,8 +1,8 @@
Exchangis 升级文档
-本文主要介绍在原有安装Exchangis服务的基础上适配DSS1.1.0和Linkis1.1.1的升级步骤,Exchangis1.0.0相对与Exchangis1.0.0-rc1版本最大的区别在于ExchangisAppconn的安装,需要对整个Exchangisappconn进行重新替换和加载
+本文主要介绍在原有安装Exchangis服务的基础上适配DSS1.1.2和Linkis1.4.0的升级步骤,Exchangis1.1.2相对与Exchangis1.0.0版本最大的区别在于ExchangisAppconn的安装,需要对整个Exchangisappconn进行重新替换和加载
### 1.升级Exchangis前的工作
-您在升级Exchangis之前,请按照[DSS1.1.0安装部署文档](https://github.com/WeBankFinTech/Exchangis/blob/dev-1.0.1-rc/docs/zh_CN/ch1/exchangis_deploy_cn.md)
-和[Linkis1.1.1安装部署文档](https://github.com/WeBankFinTech/Exchangis/blob/dev-1.0.1-rc/docs/zh_CN/ch1/exchangis_deploy_cn.md)完成DSS和Linkis的安装升级
+您在升级Exchangis之前,请按照[DSS1.1.2安装部署文档](https://github.com/WeBankFinTech/DataSphereStudio-Doc/tree/main/zh_CN/%E5%AE%89%E8%A3%85%E9%83%A8%E7%BD%B2)
+和[Linkis1.4.0安装部署文档](https://linkis.staged.apache.org/zh-CN/docs/1.4.0/deployment/deploy-quick)完成DSS和Linkis的安装升级
### 2.Exchangis升级步骤
@@ -14,7 +14,7 @@ Exchangis 升级文档
```
#### 2)下载二进制包
-我们提供ExchangisAppconn的升级物料包,您可直接下载使用。[点击跳转 Release 界面](https://osp-1257653870.cos.ap-guangzhou.myqcloud.com/WeDatasphere/Exchangis/exchangis1.0.0-rc/exchangis-appconn.zip)
+我们提供ExchangisAppconn的升级物料包,您可直接下载使用。[点击跳转 Release 界面](https://osp-1257653870.cos.ap-guangzhou.myqcloud.com/WeDatasphere/Exchangis/exchangis1.1.2/Exchangis1.1.2_install_package.zip)
#### 3) 编译打包
@@ -66,20 +66,20 @@ sh ./appconn-refresh.sh
#### 4.2)更新Exchangis安装目录下的lib包
-将从下载链接中得到的exchangis-project-server-1.0.0.jar和exchangis-server-1.0.0.jar两个包放入以下Exchangis安装目录的文件路径下(先删除原有旧的这两个包):
+将从下载链接中得到的exchangis-project-server-1.1.2.jar和exchangis-server-1.1.2.jar两个包放入以下Exchangis安装目录的文件路径下(先删除原有旧的这两个包):
```$xslt
lib/exchangis-server
```
再通过以下命令完成 Exchangis Server 的更新重启:
-
+
```shell script
./sbin/daemon.sh restart server
```
-# 4.3)更新exchangis-server.propertis文件
+# 4.3)更新dss-exchangis-server.propertis文件
-将exchangis-server.propertis文件中的最后一行进行替换,替换内容如下
+将dss-exchangis-server.propertis文件中的最后一行进行替换,替换内容如下
```$xslt
wds.linkis-session.ticket.key=bdp-user-ticket-id
@@ -94,4 +94,4 @@ wds.linkis-session.ticket.key=bdp-user-ticket-id
![image](https://user-images.githubusercontent.com/27387830/169782337-678f2df0-080a-495a-b59f-a98c5a427cf8.png)
- 更多使用操作可参照[Exchangis1.0用户手册](https://github.com/WeBankFinTech/Exchangis/blob/dev-1.0.1-rc/docs/zh_CN/ch1/exchangis_user_manual_cn.md)
+ 更多使用操作可参照[Exchangis用户手册](docs/zh_CN/ch1/exchangis_user_manual_cn.md)
diff --git a/docs/zh_CN/ch1/exchangis_appconn_deploy_cn.md b/docs/zh_CN/ch1/exchangis_appconn_deploy_cn.md
index 9144ad166..5225fc180 100644
--- a/docs/zh_CN/ch1/exchangis_appconn_deploy_cn.md
+++ b/docs/zh_CN/ch1/exchangis_appconn_deploy_cn.md
@@ -1,11 +1,11 @@
ExchangisAppConn安装文档
本文主要介绍在DSS(DataSphere Studio)1.0.1中ExchangisAppConn的部署、配置以及安装
### 1.部署ExchangisAppConn的准备工作
-您在部署ExchangisAppConn之前,请按照[Exchangis1.0.0安装部署文档](https://github.com/WeBankFinTech/Exchangis/blob/dev-1.0.0/docs/zh_CN/ch1/exchangis_deploy_cn.md)安装完成Exchangis1.0.0及其他相关组件的安装,并确保工程基本功能可用。
+您在部署ExchangisAppConn之前,请按照[Exchangis安装部署文档](docs/zh_CN/ch1/exchangis_deploy_cn.md)安装完成Exchangis及其他相关组件的安装,并确保工程基本功能可用。
### 2.ExchangisAppConn插件的下载和编译
#### 1)下载二进制包
-我们提供ExchangisAppconn的物料包,您可直接下载使用。[点击跳转 Release 界面](https://osp-1257653870.cos.ap-guangzhou.myqcloud.com/WeDatasphere/Exchangis/exchangis1.0.0/exchangis-appconn.zip)
+我们提供ExchangisAppconn的物料包,您可直接下载使用。[点击跳转 Release 界面](https://github.com/WeBankFinTech/Exchangis/releases)
#### 2) 编译打包
如果您想自己开发和编译ExchangisAppConn,具体编译步骤如下:
@@ -64,7 +64,7 @@ sh ./dss-start-all.sh
2. 在exchangis端查看是否同步创建项目,创建成功说明appconn安装成功
![image](https://user-images.githubusercontent.com/27387830/169782337-678f2df0-080a-495a-b59f-a98c5a427cf8.png)
-更多使用操作可参照[Exchangis1.0用户手册](https://github.com/WeBankFinTech/Exchangis/blob/dev-1.0.0/docs/zh_CN/ch1/exchangis_user_manual_cn.md)
+更多使用操作可参照[Exchangis用户手册](docs/zh_CN/ch1/exchangis_user_manual_cn.md)
### 5.Exchangis AppConn安装原理
diff --git a/docs/zh_CN/ch1/exchangis_datasource_cn.md b/docs/zh_CN/ch1/exchangis_datasource_cn.md
index 5bfb1c423..b7466d4bf 100644
--- a/docs/zh_CN/ch1/exchangis_datasource_cn.md
+++ b/docs/zh_CN/ch1/exchangis_datasource_cn.md
@@ -106,7 +106,7 @@
需求描述:
-后台需要将其和Linkis1.1.1的标签功能相整合,为数据源赋予标签关系。
+后台需要将其和Linkis1.4.0的标签功能相整合,为数据源赋予标签关系。
流程设计:
diff --git a/docs/zh_CN/ch1/exchangis_datax_deploy_cn.md b/docs/zh_CN/ch1/exchangis_datax_deploy_cn.md
new file mode 100644
index 000000000..00a09f989
--- /dev/null
+++ b/docs/zh_CN/ch1/exchangis_datax_deploy_cn.md
@@ -0,0 +1,72 @@
+# DataX 引擎使用文档
+### 环境准备
+DataX引擎是执行Exchangis数据同步任务不可或缺的组件,只有安装部署完成DataX引擎才能够成功执行数据同步任务。同时,确保所部署的机器上有安装DataX。
+
+您在安装部署DataX引擎之前,请按照[Exchangis安装部署文档](docs/zh_CN/ch1/exchangis_deploy_cn.md)安装完成Exchangis及相关组件的安装,并确保工程基本功能可用。
+
+强烈建议您在执行DataX任务之前,先在该节点使用原生的DataX执行测试任务,以检测该节点环境是否正常。
+
+| 环境变量名 | 环境变量内容 | 备注 |
+| :----: | :----: |-------|
+| JAVA_HOME | JDK安装路径 | 必须 |
+| DataX_HOME | DataX安装路径 | 非必须 |
+| DataX_CONF_DIR | DataX配置路径 | 非必须 |
+
+### 安装包准备
+#### 1)下载二进制包
+
+Exchangis1.1.2和Linkis 1.4.0支持的主流DataX版本1.4.6与1.4.7,更高版本可能需要修改部分代码重新编译。
+
+[点击跳转 Release 界面](https://github.com/WeBankFinTech/Exchangis/releases/tag/release-1.1.2)
+
+#### 2) 编译打包
+如果您想自己开发和编译datax引擎,具体编译步骤如下:
+
+1、克隆Exchangis的代码
+
+2、在exchangis-plugins模块下,找到datax引擎,单独编译datax,操作如下
+
+```
+cd {EXCHANGIS_CODE_HOME}/exchangis-plugins/engine/datax
+mvn clean install
+```
+然后会在该路径下找到datax引擎安装包
+```
+{EXCHANGIS_CODE_HOME}/exchangis-plugins/datax/target/out
+```
+
+
+### 开始部署
+#### 1)DataX引擎安装
+1、拿到打包出来的datax物料包,目录结构为:
+
+```shell
+datax
+-- dist
+-- plugin
+```
+
+2、放置到linkis安装路径的如下目录
+
+```shell
+cd {LINKIS_HOME}/linkis/lib/linkis-engineconn-plugins
+```
+(注意,看当前datax引擎对哪些用户有权限,一般都为hadoop用户组和hadoop用户)
+
+
+#### 2)重启linkis-engineplugin服务使datax引擎生效
+新加入linkis的引擎都要重启linkis的engineplugin服务才会生效,重启脚本为linkis安装目录下的./sbin/linkis-daemon.sh,具体步骤如下
+```shell
+cd {LINKIS_INSTALL_HOME}/links/sbin/
+./linkis-daemon.sh restart cg-engineplugin
+```
+待服务启动成功,在linkis数据库中校验datax引擎是否安装完毕
+
+```shell
+select * from linkis_cg_engine_conn_plugin_bml_resources where engine_conn_type='datax';
+```
+
+至此,datax安装部署就完成了。
+
+engineplugin更详细的介绍可以参看下面的文章。
+https://linkis.apache.org/zh-CN/docs/latest/deployment/install-engineconn
\ No newline at end of file
diff --git a/docs/zh_CN/ch1/exchangis_deploy_cn.md b/docs/zh_CN/ch1/exchangis_deploy_cn.md
index f6943fe21..79c3fc139 100644
--- a/docs/zh_CN/ch1/exchangis_deploy_cn.md
+++ b/docs/zh_CN/ch1/exchangis_deploy_cn.md
@@ -6,6 +6,7 @@ Exchangis 的安装,主要分为以下四步:
2. Exchangis 安装部署
3. DSS ExchangisAppConn 安装部署
4. Linkis Sqoop 引擎安装部署
+5. Linkis DataX 引擎安装部署
## 1. Exchangis 依赖环境准备
@@ -13,26 +14,26 @@ Exchangis 的安装,主要分为以下四步:
| 依赖的组件 | 是否必装 | 安装直通车 |
|---------------------------------------| ------ | --------------- |
-| MySQL (5.5+) | 必装 | [如何安装mysql](https://www.runoob.com/mysql/mysql-install.html) |
-| JDK (1.8.0_141) | 必装 | [如何安装JDK](https://www.runoob.com/java/java-environment-setup.html) |
-| Hadoop(2.7.2,Hadoop 其他版本需自行编译 Linkis) | 必装 | [Hadoop单机部署](https://hadoop.apache.org/releases.html) ;[Hadoop分布式部署](https://hadoop.apache.org/releases.html) |
-| Hive(2.3.3,Hive 其他版本需自行编译 Linkis) | 必装 | [Hive快速安装](https://hive.apache.org/downloads.html) |
+| JDK (1.8.0_141) | 必装 | [如何安装JDK](https://www.oracle.com/java/technologies/downloads/) |
+| MySQL (5.5+) | 必装 | [如何安装mysql](https://www.runoob.com/mysql/mysql-install.html) |
+| Hadoop(3.3.4,Hadoop 其他版本需自行编译 Linkis) | 必装 | [Hadoop部署](https://www.apache.org/dyn/closer.cgi/hadoop/common/hadoop-3.3.4/hadoop-3.3.4.tar.gz) |
+| Hive(2.3.3,Hive 其他版本需自行编译 Linkis) | 必装 | [Hive快速安装](https://www.apache.org/dyn/closer.cgi/hive/) |
| SQOOP (1.4.6) | 必装 | [如何安装Sqoop](https://sqoop.apache.org/docs/1.4.6/SqoopUserGuide.html) |
-| DSS1.1.0 | 必装 | [如何安装DSS](https://github.com/WeBankFinTech/DataSphereStudio-Doc/blob/main/en_US/Installation_and_Deployment/DSS%26Linkis_one-click_deployment_document_stand-alone_version.md) |
-| Linkis1.1.1 | 必装 | [如何安装Linkis](https://linkis.apache.org/zh-CN/docs/latest/deployment/deploy-quick) |
-| Nginx | 必装 | [如何安装 Nginx](http://nginx.org/en/linux_packages.html) |
+| DSS1.1.2 | 必装 | [如何安装DSS](https://github.com/WeBankFinTech/DataSphereStudio-Doc/tree/main/zh_CN/%E5%AE%89%E8%A3%85%E9%83%A8%E7%BD%B2) |
+| Linkis1.4.0 | 必装 | [如何安装Linkis](https://linkis.apache.org/zh-CN/docs/1.4.0/deployment/deploy-quick) |
+| Nginx | 必装 | [如何安装 Nginx](http://nginx.org/) |
底层依赖组件检查
-$\color{#FF0000}{注意:一定要使用最新版的dss1.1.0,及linkis1.1.1}$。
+注意:一定要使用最新版的dss1.1.2,及linkis1.4.0。
-[linkis1.1.1代码地址](https://github.com/apache/incubator-linkis/tree/release-1.1.1)
+[linkis1.4.0代码地址](https://github.com/apache/incubator-linkis/tree/release-1.4.0)
-[DSS1.1.0代码地址](https://github.com/WeBankFinTech/DataSphereStudio/tree/dev-1.1.0)
+[DSS1.1.2代码地址 ](https://github.com/WeBankFinTech/DataSphereStudio)
datasource启用
-linkis的启动脚本中默认不会启动数据源相关的服务两个服务(ps-data-source-manager,ps-metadatamanager), 如果想使用数据源服务,可以通过如下方式进行开启: 修改$LINKIS_CONF_DIR/linkis-env.sh中的 export ENABLE_METADATA_MANAGER=true值为true。 通过linkis-start-all.sh/linkis-stop-all.sh 进行服务启停时,会进行数据源服务的启动与停止。关于数据源更多详情可参考[数据源功能使用](https://linkis.apache.org/zh-CN/docs/latest/user-guide/datasource-manual)
+linkis的启动脚本中默认不会启动数据源相关的服务两个服务(ps-data-source-manager,ps-metadatamanager), 如果想使用数据源服务,可以通过如下方式进行开启: 修改$LINKIS_CONF_DIR/linkis-env.sh中的 export ENABLE_METADATA_MANAGER=true值为true。 通过linkis-start-all.sh/linkis-stop-all.sh 进行服务启停时,会进行数据源服务的启动与停止。关于数据源更多详情可参考[数据源功能使用](https://linkis.apache.org/zh-CN/docs/1.4.0/user-guide/datasource-manual)
#### 1.2 创建 Linux 用户
@@ -57,11 +58,11 @@ INSERT INTO `linkis_ps_dm_datasource_env` (`env_name`, `env_desc`, `datasource_t
INSERT INTO `linkis_ps_dm_datasource_env` (`env_name`, `env_desc`, `datasource_type_id`, `parameter`, `create_time`, `create_user`, `modify_time`, `modify_user`) VALUES ('开发环境UAT', '开发环境UAT', 4, '{"uris":"thrift://${HIVE_METADATA_IP}:${HIVE_METADATA_PORT}", "hadoopConf":{"hive.metastore.execute.setugi":"true"}}', now(), NULL, now(), NULL);
```
-如果hive数据源在部署时设置了需要进行kerberos方式认证,则需要在linkis_ps_dm_datasource_env表的parameter字段指定一个参数keyTab,其值的获取方式可见:[在Linkis中设置并认证hive数据源](https://linkis.apache.org/zh-CN/docs/latest/user-guide/datasource-manual)
+如果hive数据源在部署时设置了需要进行kerberos方式认证,则需要在linkis_ps_dm_datasource_env表的parameter字段指定一个参数keyTab,其值的获取方式可见:[在Linkis中设置并认证hive数据源](https://linkis.apache.org/zh-CN/docs/latest/auth/token)
#### 1.4 底层依赖组件检查
-**请确保 DSS1.1.0 与 Linkis1.1.1 基本可用,可在 DSS 前端界面执行 HiveQL 脚本,可正常创建并执行 DSS 工作流。**
+**请确保 DSS1.1.2 与 Linkis1.4.0 基本可用,可在 DSS 前端界面执行 HiveQL 脚本,可正常创建并执行 DSS 工作流。**
## 2. Exchangis 安装部署
@@ -70,7 +71,7 @@ INSERT INTO `linkis_ps_dm_datasource_env` (`env_name`, `env_desc`, `datasource_t
#### 2.1.1下载二进制包
-从 Exchangis 已发布的 release 中 [点击下载exchangis安装包](https://github.com/WeBankFinTech/Exchangis/releases/tag/release-1.0.0),下载最新的安装包。
+从 Exchangis 已发布的 release 中 [点击下载exchangis安装包](https://github.com/WeBankFinTech/Exchangis/releases),下载最新的安装包。
#### 2.1.2 编译打包
@@ -95,8 +96,9 @@ INSERT INTO `linkis_ps_dm_datasource_env` (`env_name`, `env_desc`, `datasource_t
```html
|-- config:一键安装部署参数配置目录
|-- db:数据库表初始化 SQL 目录
-|-- exchangis-extds
|-- packages:Exchangis 安装包目录
+ |-- exchangis-extds:数据源扩展库
+ |-- lib:库
|-- sbin:脚本存放目录
```
@@ -156,7 +158,28 @@ DATABASE={dbName}
输入 `y` 初始化数据库表,输入 `n` 跳过数据库表初始化步骤。
-#### 2.5.3 启动服务
+#### 2.5.3 修改配置文件路径和日志文件路径
+
+在sbin目录下的`env.properties`文件,设置配置文件路径和日志文件路径
+
+```yaml
+EXCHANGIS_CONF_PATH="/appcom/config/exchangis-config/background"
+EXCHANGIS_LOG_PATH="/appcom/logs/exchangis/background"
+MODULE_DEFAULT_PREFIX="dss-exchangis-main-"
+MODULE_DEFAULT_SUFFIX="-dev"
+```
+
+EXCHANGIS_CONF_PATH为配置文件路径,EXCHANGIS_LOG_PATH为日志文件路径,若为以上配置,则作如下操作:
+
+```shell
+cd {EXCHANGIS_DEPLOY_PATH}
+cp -r config /appcom/config/exchangis-config/background
+mkdir -p /appcom/logs/exchangis/background
+```
+
+则在服务启动时,将会使用对应路径下的配置文件,以及将日志写到对应的路径下
+
+#### 2.5.4 启动服务
第一次启动,可以sbin目录下执行以下命令,启动 Exchangis Server:
@@ -172,7 +195,7 @@ DATABASE={dbName}
执行完成启动脚本后,会出现以下提示,eureka地址也会在启动服务时在控制台打出:
-![企业微信截图_16532930262583](https://user-images.githubusercontent.com/27387830/173892397-7cc7e988-0222-4f64-92ed-2cc58669770e.png)
+![企业微信截图_16532930262583](../../../images/zh_CN/ch1/register_eureka.png)
### 2.6 查看服务是否启动成功
@@ -188,7 +211,7 @@ DATABASE={dbName}
#### 2.7.1 获取前端安装包
-Exchangis 已默认提供了编译好的前端安装包,可直接下载使用:[点击下载前端安装包](https://osp-1257653870.cos.ap-guangzhou.myqcloud.com/WeDatasphere/Exchangis/exchangis1.0.0/dist.zip)
+Exchangis 已默认提供了编译好的前端安装包,可直接下载使用:[点击下载前端安装包](https://github.com/WeBankFinTech/Exchangis/releases)
您也可以自行编译 Exchangis 前端,在 Exchangis 根目录下执行如下命令:
@@ -198,23 +221,22 @@ Exchangis 已默认提供了编译好的前端安装包,可直接下载使用
npm run build
```
-从 `web/` 路径获取编译好的 dist.zip 前端包。
+从 `web/` 路径获取编译好的 exchangis-ui.zip 前端包。
获取到的前端包,您可以放在服务器上的任意位置,这里建议您与后端安装地址目录保持一致,在同一目录下放置并解压。
-#### 2.7.2 前端安装部署
+#### 3.3.4 前端安装部署
1. 解压前端安装包
-如您打算将 Exchangis 前端包部署到 `/appcom/Install/exchangis/web` 目录,请先将 `dist.zip` 拷贝到该目录并执行解压,注意,**请在安装dss的机器上安装exchangis前端**:
+如您打算将 Exchangis 前端包部署到 `/appcom/Install/ExchangisInstall/exchangis-ui` 目录,请先将 `exchangis-ui.zip` 拷贝到该目录并执行解压,注意,**请在安装dss的机器上安装exchangis前端**:
```shell script
- # 请先将 Exchangis 前端包拷贝到 `/appcom/Install/exchangis/web` 目录
- cd /appcom/Install/exchangis/web
- unzip dist.zip
+ # 请先将 Exchangis 前端包拷贝到 `/appcom/Install/ExchangisInstall` 目录
+ cd /appcom/Install/ExchangisInstall
+ unzip exchangis-ui.zip
```
-
执行如下命令:
```shell script
@@ -228,7 +250,7 @@ Exchangis 已默认提供了编译好的前端安装包,可直接下载使用
#charset koi8-r;
#access_log /var/log/nginx/host.access.log main;
location / {
- root /appcom/Install/exchangis/web/dist; # Exchangis 前端部署目录
+ root /appcom/Install/ExchangisInstall/exchangis-ui; # Exchangis 前端部署目录
autoindex on;
}
@@ -271,12 +293,16 @@ Exchangis 已默认提供了编译好的前端安装包,可直接下载使用
## 3. DSS ExchangisAppConn 安装部署
-如您想正常使用 Exchangis1.0.0 前端,还需安装 DSS ExchangisAppConn 插件,请参考: [ExchangisAppConn 插件安装文档](https://github.com/WeBankFinTech/Exchangis/blob/dev-1.0.0/docs/zh_CN/ch1/exchangis_appconn_deploy_cn.md)
+如您想正常使用 Exchangis 前端,还需安装 DSS ExchangisAppConn 插件,请参考: [ExchangisAppConn 插件安装文档](docs/zh_CN/ch1/exchangis_appconn_deploy_cn.md)
## 4. Linkis Sqoop 引擎安装部署
-如您想正常执行 Exchangis1.0.0 的 Sqoop作业,还需安装 Linkis Sqoop 引擎,请参考: [Linkis Sqoop 引擎插件安装文档](https://linkis.apache.org/zh-CN/docs/latest/engine-usage/sqoop)
+如您想正常执行 Exchangis 的Sqoop作业,还需安装 Linkis Sqoop 引擎,请参考: [Linkis Sqoop 引擎插件安装文档](docs/zh_CN/ch1/exchangis_sqoop_deploy_cn.md)
+
+## 5. Linkis DataX 引擎安装部署
+
+如您想正常执行 Exchangis 的DataX作业,还需安装 Linkis DataX 引擎,请参考: [Linkis DataX 引擎插件安装文档](docs/zh_CN/ch1/exchangis_datax_deploy_cn.md)
-## 5. 如何登录使用 Exchangis
+## 6. 如何登录使用 Exchangis
-Exchangis1.0更多使用说明,请参考用户使用手册[Exchangis1.0 用户手册](https://github.com/WeBankFinTech/Exchangis/blob/dev-1.0.0/docs/zh_CN/ch1/exchangis_user_manual_cn.md)
+Exchangis 更多使用说明,请参考用户使用手册[Exchangis 用户手册](docs/zh_CN/ch1/exchangis_user_manual_cn.md)
diff --git a/docs/zh_CN/ch1/exchangis_sqoop_deploy_cn.md b/docs/zh_CN/ch1/exchangis_sqoop_deploy_cn.md
index 1e457d825..f4de28ac2 100644
--- a/docs/zh_CN/ch1/exchangis_sqoop_deploy_cn.md
+++ b/docs/zh_CN/ch1/exchangis_sqoop_deploy_cn.md
@@ -2,7 +2,7 @@
### 环境准备
Sqoop引擎是执行Exchangis数据同步任务不可或缺的组件,只有安装部署完成Sqoop引擎才能够成功执行数据同步任务。同时,确保所部署的机器上有安装sqoop。
-您在安装部署Sqoop引擎之前,请按照[Exchangis1.0.0安装部署文档](https://github.com/WeBankFinTech/Exchangis/blob/dev-1.0.0/docs/zh_CN/ch1/exchangis_deploy_cn.md)安装完成Exchangis1.0.0及相关组件的安装,并确保工程基本功能可用。
+您在安装部署Sqoop引擎之前,请按照[Exchangis安装部署文档](docs/zh_CN/ch1/exchangis_deploy_cn.md)安装完成Exchangis及相关组件的安装,并确保工程基本功能可用。
Sqoop引擎主要依赖Hadoop基础环境,如果该节点需要部署Sqoop引擎,需要部署Hadoop客户端环境。
@@ -26,9 +26,9 @@ Sqoop引擎主要依赖Hadoop基础环境,如果该节点需要部署Sqoop引
### 安装包准备
#### 1)下载二进制包
-Exchangis1.0.0和Linkis 1.1.1支持的主流Sqoop版本1.4.6与1.4.7,更高版本可能需要修改部分代码重新编译。
+Exchangis1.1.2和Linkis 1.4.0支持的主流Sqoop版本1.4.6与1.4.7,更高版本可能需要修改部分代码重新编译。
-[点击跳转 Release 界面](https://github.com/WeBankFinTech/Exchangis/releases/tag/release-1.0.0)
+[点击跳转 Release 界面](https://github.com/WeBankFinTech/Exchangis/releases)
#### 2) 编译打包
如果您想自己开发和编译sqoop引擎,具体编译步骤如下:
@@ -37,12 +37,12 @@ Exchangis1.0.0和Linkis 1.1.1支持的主流Sqoop版本1.4.6与1.4.7,更高版
2.在exchangis-plugins模块下,找到sqoop引擎,单独编译sqoop,操作如下
```
-cd {EXCHANGIS_CODE_HOME}/exchangis-plugins/engine/sqoop
+cd {EXCHANGIS_CODE_HOME}/exchangis-engines/engine-plugins/sqoop
mvn clean install
```
然后会在该路径下找到sqoop引擎安装包
```
-{EXCHANGIS_CODE_HOME}/exchangis-plugins/sqoop/target/out
+{EXCHANGIS_CODE_HOME}/exchangis-engines/engine-plugins/sqoop/target/out
```
@@ -59,9 +59,9 @@ sqoop
2.放置到linkis安装路径的如下目录
```shell
-cd {LINKIS_HOME}/linkis/lib/linkis-engineconn-plugins
+cd {LINKIS_HOME}/linkis-engineconn-plugins
```
-(注意,看当前sqoop引擎对哪些用户有权限,不一定是root)
+(注意,看当前sqoop引擎对哪些用户有权限,不一定是root)
#### 2)重启linkis-engineplugin服务使sqoop引擎生效
@@ -70,7 +70,13 @@ cd {LINKIS_HOME}/linkis/lib/linkis-engineconn-plugins
cd {LINKIS_INSTALL_HOME}/links/sbin/
./linkis-daemon.sh restart cg-engineplugin
```
-待服务启动成功,至此,sqoop安装部署就完成了。
+待服务启动成功,在linkis数据库中校验sqoop引擎是否安装完毕
+
+```yaml
+select * from linkis_cg_engine_conn_plugin_bml_resources where engine_conn_type='sqoop';
+```
+
+至此,sqoop安装部署就完成了。
engineplugin更详细的介绍可以参看下面的文章。
-https://linkis.apache.org/zh-CN/docs/latest/architecture/computation-governance-services/engine/engine-conn
+https://linkis.apache.org/zh-CN/docs/latest/deployment/install-engineconn
\ No newline at end of file
diff --git a/docs/zh_CN/ch1/exchangis_user_manual_cn.md b/docs/zh_CN/ch1/exchangis_user_manual_cn.md
index 1e7c3c2cc..005c9e189 100644
--- a/docs/zh_CN/ch1/exchangis_user_manual_cn.md
+++ b/docs/zh_CN/ch1/exchangis_user_manual_cn.md
@@ -6,7 +6,7 @@
## 二、登录Exchangis1.0
- Exchangis1.0目前作为DSS**数据交换组件**的一部分,通过登录DSS的方式在组件列表中免密进入。所以,在使用Exchangis1.0之前,请对DSS,Exchangis1.0,Linkis等相关组件进行基本部署,保证组件功能可用,本文不进行赘述,详情见[exchangis部署文档](https://github.com/WeBankFinTech/Exchangis/blob/dev-1.0.0/docs/zh_CN/ch1/exchangis_deploy_cn.md)和[exchangis-appconn部署文档](https://github.com/WeBankFinTech/Exchangis/blob/dev-1.0.0/docs/zh_CN/ch1/exchangis_appconn_deploy_cn.md)
+ Exchangis1.0目前作为DSS**数据交换组件**的一部分,通过登录DSS的方式在组件列表中免密进入。所以,在使用Exchangis1.0之前,请对DSS,Exchangis1.0,Linkis等相关组件进行基本部署,保证组件功能可用,本文不进行赘述,详情见[exchangis部署文档](docs/zh_CN/ch1/exchangis_deploy_cn.md)和[exchangis-appconn部署文档](docs/zh_CN/ch1/exchangis_appconn_deploy_cn.md)
### 1、登录DSS
diff --git a/exchangis-dao/pom.xml b/exchangis-dao/pom.xml
index e200f6146..5776a5b52 100644
--- a/exchangis-dao/pom.xml
+++ b/exchangis-dao/pom.xml
@@ -5,7 +5,7 @@
exchangis
com.webank.wedatasphere.exchangis
- 1.0.0
+ 1.1.2
4.0.0
@@ -21,24 +21,20 @@
org.apache.linkis
linkis-mybatis
- ${linkis.version}
org.apache.linkis
linkis-module
- ${linkis.version}
-
-
- validation-api
- javax.validation
-
-
org.hibernate
hibernate-validator
${hibernate.validator}
+
+ org.springframework
+ spring-orm
+
diff --git a/exchangis-dao/src/main/java/com/webank/wedatasphere/exchangis/common/AuditLogUtils.java b/exchangis-dao/src/main/java/com/webank/wedatasphere/exchangis/common/AuditLogUtils.java
new file mode 100644
index 000000000..f42908668
--- /dev/null
+++ b/exchangis-dao/src/main/java/com/webank/wedatasphere/exchangis/common/AuditLogUtils.java
@@ -0,0 +1,38 @@
+package com.webank.wedatasphere.exchangis.common;
+
+
+import com.webank.wedatasphere.exchangis.common.enums.OperateTypeEnum;
+import com.webank.wedatasphere.exchangis.common.enums.TargetTypeEnum;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.Date;
+
+/**
+ * @author tikazhang
+ * @Date 2022/9/19 20:07
+ */
+public class AuditLogUtils {
+
+
+ private static final Logger LOGGER = LoggerFactory.getLogger(AuditLogUtils.class);
+
+ /**
+ * 打印审计日志,id类的属性都是String
+ * @param user 执行操作的用户名
+ * @param targetType 操作针对的对象类型
+ * @param targetId 操作针对的对象id
+ * @param targetName 操作针对的对象名称
+ * @param operateType 操作类型
+ * @param params 操作相关的参数
+ */
+ public static void printLog(String user, String proxyUser, TargetTypeEnum targetType,
+ String targetId, String targetName, OperateTypeEnum operateType, Object params) {
+ //String detailInfo=new Gson().toJson(params);
+ String detailInfo=params.toString();
+ LOGGER.info("[{}],[{}],[{}],[{}],[{}],[{}],[{}],[{}],[{}]",
+ new Date(),user, "proxyUser is: " + proxyUser, "Exchangis-1.1.2", targetType.getName(),
+ targetId,targetName,operateType.getName(), detailInfo);
+ }
+
+}
diff --git a/exchangis-dao/src/main/java/com/webank/wedatasphere/exchangis/common/EnvironmentUtils.java b/exchangis-dao/src/main/java/com/webank/wedatasphere/exchangis/common/EnvironmentUtils.java
new file mode 100644
index 000000000..eaf5d6c38
--- /dev/null
+++ b/exchangis-dao/src/main/java/com/webank/wedatasphere/exchangis/common/EnvironmentUtils.java
@@ -0,0 +1,19 @@
+package com.webank.wedatasphere.exchangis.common;
+
+import org.apache.linkis.common.conf.CommonVars;
+
+/**
+ * Environment utils
+ */
+public class EnvironmentUtils {
+
+ private static final CommonVars JVM_USER = CommonVars.apply("wds.exchangis.env.jvm.user", System.getProperty("user.name", "hadoop"));
+
+ /**
+ * Jvm user
+ * @return user name
+ */
+ public static String getJvmUser(){
+ return JVM_USER.getValue();
+ }
+}
diff --git a/exchangis-dao/src/main/java/com/webank/wedatasphere/exchangis/common/UserUtils.java b/exchangis-dao/src/main/java/com/webank/wedatasphere/exchangis/common/UserUtils.java
new file mode 100644
index 000000000..216086ce1
--- /dev/null
+++ b/exchangis-dao/src/main/java/com/webank/wedatasphere/exchangis/common/UserUtils.java
@@ -0,0 +1,26 @@
+package com.webank.wedatasphere.exchangis.common;
+
+import org.apache.linkis.server.security.ProxyUserSSOUtils;
+import org.apache.linkis.server.security.SecurityFilter;
+import scala.Option;
+
+import javax.servlet.http.HttpServletRequest;
+
+/**
+ * @author tikazhang
+ * @Date 2022/9/22 16:54
+ */
+public class UserUtils {
+ public static String getLoginUser(HttpServletRequest request) {
+ Option proxyUserUsername =
+ ProxyUserSSOUtils.getProxyUserUsername(request);
+ String loginUser = null;
+ if (proxyUserUsername.isDefined()) {
+ loginUser = proxyUserUsername.get();
+ } else {
+ loginUser = SecurityFilter.getLoginUsername(request);
+ }
+ return loginUser;
+ }
+
+}
diff --git a/exchangis-dao/src/main/java/com/webank/wedatasphere/exchangis/common/enums/OperateTypeEnum.java b/exchangis-dao/src/main/java/com/webank/wedatasphere/exchangis/common/enums/OperateTypeEnum.java
new file mode 100644
index 000000000..99de7e712
--- /dev/null
+++ b/exchangis-dao/src/main/java/com/webank/wedatasphere/exchangis/common/enums/OperateTypeEnum.java
@@ -0,0 +1,30 @@
+package com.webank.wedatasphere.exchangis.common.enums;
+
+/**
+ * @author tikazhang
+ * @Date 2022/9/19 20:16
+ */
+public enum OperateTypeEnum {
+ CREATE("create"),
+ UPDATE("update"),
+ DELETE("delete"),
+ COPY("copy"),
+ EXPORT("export"),
+ IMPORT("import"),
+ PUBLISH("publish"),
+ EXPIRE("expire"),
+ EXECUTE("execute"),
+ KILL("kill"),
+ ;
+ private String name;
+ OperateTypeEnum(String name) {
+ this.name = name;
+ }
+
+ public String getName() {
+ return name;
+ }
+ public void setName(String name) {
+ this.name = name;
+ }
+}
diff --git a/exchangis-dao/src/main/java/com/webank/wedatasphere/exchangis/common/enums/TargetTypeEnum.java b/exchangis-dao/src/main/java/com/webank/wedatasphere/exchangis/common/enums/TargetTypeEnum.java
new file mode 100644
index 000000000..539767c1d
--- /dev/null
+++ b/exchangis-dao/src/main/java/com/webank/wedatasphere/exchangis/common/enums/TargetTypeEnum.java
@@ -0,0 +1,38 @@
+package com.webank.wedatasphere.exchangis.common.enums;
+
+/**
+ * @author tikazhang
+ * @Date 2022/9/19 20:22
+ */
+public enum TargetTypeEnum {
+ /**
+ * 项目
+ */
+ PROJECT("project"),
+ /**
+ * 作业
+ */
+ JOB("job"),
+ /**
+ * 数据源
+ */
+ DATASOURCE("datasource"),
+ /**
+ * 任务
+ */
+ TASK("task"),
+ ;
+ private String name;
+
+ TargetTypeEnum(String name) {
+ this.name = name;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+}
diff --git a/exchangis-dao/src/main/java/com/webank/wedatasphere/exchangis/common/linkis/ClientConfiguration.java b/exchangis-dao/src/main/java/com/webank/wedatasphere/exchangis/common/linkis/ClientConfiguration.java
new file mode 100644
index 000000000..3725610fd
--- /dev/null
+++ b/exchangis-dao/src/main/java/com/webank/wedatasphere/exchangis/common/linkis/ClientConfiguration.java
@@ -0,0 +1,26 @@
+package com.webank.wedatasphere.exchangis.common.linkis;
+
+import org.apache.linkis.common.conf.CommonVars;
+import org.apache.linkis.common.conf.Configuration;
+
+/**
+ * Configuration for linkis client
+ */
+public class ClientConfiguration {
+
+ /**
+ * Linkis server url
+ */
+ public static final CommonVars LINKIS_SERVER_URL = CommonVars.apply("wds.exchangis.client.linkis.server-url", Configuration.getGateWayURL());
+
+ /**
+ * Linkis token value
+ */
+ public static final CommonVars LINKIS_TOKEN_VALUE = CommonVars.apply("wds.exchangis.client.linkis.token.value", "EXCHANGIS-TOKEN");
+
+ /**
+ * Linkis client max connections
+ */
+ public static final CommonVars LINKIS_DEFAULT_MAX_CONNECTIONS = CommonVars.apply("wds.exchangis.client.linkis.max-connections.default", 70);
+
+}
diff --git a/exchangis-dao/src/main/java/com/webank/wedatasphere/exchangis/common/linkis/bml/BmlResource.java b/exchangis-dao/src/main/java/com/webank/wedatasphere/exchangis/common/linkis/bml/BmlResource.java
new file mode 100644
index 000000000..0ea6f12af
--- /dev/null
+++ b/exchangis-dao/src/main/java/com/webank/wedatasphere/exchangis/common/linkis/bml/BmlResource.java
@@ -0,0 +1,40 @@
+package com.webank.wedatasphere.exchangis.common.linkis.bml;
+
+/**
+ * Bml resource definition
+ */
+public class BmlResource {
+ /**
+ * Resource id
+ */
+ private String resourceId;
+
+ /**
+ * Version
+ */
+ private String version;
+
+ public BmlResource(){
+
+ }
+
+ public BmlResource(String resourceId, String version){
+ this.resourceId = resourceId;
+ this.version = version;
+ }
+ public String getResourceId() {
+ return resourceId;
+ }
+
+ public void setResourceId(String resourceId) {
+ this.resourceId = resourceId;
+ }
+
+ public String getVersion() {
+ return version;
+ }
+
+ public void setVersion(String version) {
+ this.version = version;
+ }
+}
diff --git a/exchangis-dao/src/main/java/com/webank/wedatasphere/exchangis/dao/domain/ExchangisJobParamConfig.java b/exchangis-dao/src/main/java/com/webank/wedatasphere/exchangis/dao/domain/ExchangisJobParamConfig.java
index 40ce6e138..b50609c03 100644
--- a/exchangis-dao/src/main/java/com/webank/wedatasphere/exchangis/dao/domain/ExchangisJobParamConfig.java
+++ b/exchangis-dao/src/main/java/com/webank/wedatasphere/exchangis/dao/domain/ExchangisJobParamConfig.java
@@ -63,6 +63,9 @@ public class ExchangisJobParamConfig {
@TableField(value = "is_advanced")
private Boolean advanced;
+ @TableField(value = "ref_id")
+ private Long refId;
+
/**
* store url exa. http://127.0.0.1/api/v1/dss/exchangis/main/xxx
*/
@@ -265,4 +268,12 @@ public Boolean getRequired() {
public void setRequired(Boolean required) {
this.required = required;
}
+
+ public Long getRefId() {
+ return refId;
+ }
+
+ public void setRefId(Long refId) {
+ this.refId = refId;
+ }
}
\ No newline at end of file
diff --git a/exchangis-datasource/exchangis-datasource-core/pom.xml b/exchangis-datasource/exchangis-datasource-core/pom.xml
index 98bfbccd5..990c92d6f 100644
--- a/exchangis-datasource/exchangis-datasource-core/pom.xml
+++ b/exchangis-datasource/exchangis-datasource-core/pom.xml
@@ -5,7 +5,7 @@
exchangis-datasource
com.webank.wedatasphere.exchangis
- 1.0.0
+ 1.1.2
4.0.0
@@ -20,14 +20,13 @@
com.webank.wedatasphere.exchangis
exchangis-dao
- 1.0.0
+ 1.1.2
org.apache.linkis
linkis-datasource-client
- ${linkis.version}
org.apache.linkis
diff --git a/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/ExchangisDataSource.java b/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/ExchangisDataSource.java
index 1b09ba1e6..13ecdfdac 100644
--- a/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/ExchangisDataSource.java
+++ b/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/ExchangisDataSource.java
@@ -25,6 +25,7 @@ public interface ExchangisDataSource {
String classifier();
// String type();
+ String structClassifier();
// String category();
diff --git a/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/domain/Classifier.java b/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/domain/Classifier.java
new file mode 100644
index 000000000..4e385450c
--- /dev/null
+++ b/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/domain/Classifier.java
@@ -0,0 +1,22 @@
+package com.webank.wedatasphere.exchangis.datasource.core.domain;
+
+public enum Classifier {
+
+ ELASTICSEARCH("分布式全文索引"),
+
+ HIVE("大数据存储"),
+
+ MONGODB("非关系型数据库"),
+
+ MYSQL("关系型数据库"),
+
+ SFTP("sftp连接"),
+
+ ORACLE("关系型数据库");
+
+ public String name;
+
+ Classifier(String name) {
+ this.name = name;
+ }
+}
diff --git a/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/domain/DataSourceType.java b/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/domain/DataSourceType.java
new file mode 100644
index 000000000..d0193c4a2
--- /dev/null
+++ b/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/domain/DataSourceType.java
@@ -0,0 +1,22 @@
+package com.webank.wedatasphere.exchangis.datasource.core.domain;
+
+public enum DataSourceType {
+
+ ELASTICSEARCH("ELASTICSEARCH"),
+
+ HIVE("HIVE"),
+
+ MONGODB("MONGODB"),
+
+ MYSQL("MYSQL"),
+
+ SFTP("SFTP"),
+
+ ORACLE("ORACLE");
+
+ public String name;
+
+ DataSourceType(String name) {
+ this.name = name;
+ }
+}
diff --git a/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/domain/StructClassifier.java b/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/domain/StructClassifier.java
new file mode 100644
index 000000000..e7aa660ac
--- /dev/null
+++ b/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/domain/StructClassifier.java
@@ -0,0 +1,16 @@
+package com.webank.wedatasphere.exchangis.datasource.core.domain;
+
+public enum StructClassifier {
+
+ STRUCTURED("结构化"),
+
+ SEMI_STRUCTURED("半结构化"),
+
+ NON_STRUCTURED("无结构化");
+
+ public String name;
+
+ StructClassifier(String name) {
+ this.name = name;
+ }
+}
diff --git a/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/loader/ExchangisDataSourceLoader.java b/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/loader/ExchangisDataSourceLoader.java
index 60400f70f..f68f696e8 100644
--- a/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/loader/ExchangisDataSourceLoader.java
+++ b/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/loader/ExchangisDataSourceLoader.java
@@ -10,7 +10,6 @@
public interface ExchangisDataSourceLoader {
-// String EXCHANGIS_DIR_NAME = "exchangis-extds";
String EXCHANGIS_DIR_NAME = Objects.isNull(CommonVars.apply("wds.exchangis.datasource.extension.dir").getValue()) ? "exchangis-extds" : CommonVars.apply("wds.exchangis.datasource.extension.dir").getValue().toString();
String PROPERTIES_NAME = "extds.properties";
diff --git a/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/service/MetadataInfoService.java b/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/service/MetadataInfoService.java
index 04b7d78f3..1166eff4d 100644
--- a/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/service/MetadataInfoService.java
+++ b/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/service/MetadataInfoService.java
@@ -57,4 +57,11 @@ Map getTableProps(ServiceRpcClient> rpcClient, String userName
* @throws ExchangisDataSourceException
*/
List getColumns(String userName, Long dataSourceId, String database, String table) throws ExchangisDataSourceException;
+
+ /**
+ * Get the default(local) hdfs information
+ * @param uri uri
+ * @return
+ */
+ Map getLocalHdfsInfo(String uri) throws ExchangisDataSourceException;
}
diff --git a/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/ui/InputElementUI.java b/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/ui/InputElementUI.java
index 1c2585228..88a23ab4d 100644
--- a/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/ui/InputElementUI.java
+++ b/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/ui/InputElementUI.java
@@ -5,6 +5,7 @@
import java.util.Map;
public class InputElementUI implements ElementUI {
+ private Long id;
private String key;
private String field;
private String label;
@@ -17,6 +18,15 @@ public class InputElementUI implements ElementUI {
private String validateRange;
private String validateMsg;
private String source;
+ private Long refId;
+
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
public String getSource() {
return source;
@@ -38,6 +48,14 @@ public void setField(String field) {
this.field = field;
}
+ public Long getRefId() {
+ return refId;
+ }
+
+ public void setRefId(Long refId) {
+ this.refId = refId;
+ }
+
@Override
public String getField() {
return this.field;
diff --git a/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/ui/MapElementUI.java b/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/ui/MapElementUI.java
index b8f5d8945..cf86a5dfc 100644
--- a/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/ui/MapElementUI.java
+++ b/exchangis-datasource/exchangis-datasource-core/src/main/java/com/webank/wedatasphere/exchangis/datasource/core/ui/MapElementUI.java
@@ -6,6 +6,7 @@
import java.util.Objects;
public class MapElementUI implements ElementUI
-
- org.apache.commons
- commons-exec
- provided
- 1.3
-
org.apache.avro
avro
@@ -184,6 +180,10 @@
hadoop-hdfs
org.apache.hadoop
+
+ org.apache.hadoop
+ hadoop-hdfs
+
@@ -191,39 +191,24 @@
linkis-engineconn-plugin-core
${linkis.version}
-
org.apache.linkis
linkis-rpc
${linkis.version}
provided
-
org.apache.linkis
linkis-storage
${linkis.version}
provided
-
org.apache.linkis
linkis-common
${linkis.version}
provided
-
-
- org.apache.linkis
- linkis-bml-engine-hook
- ${linkis.version}
-
-
- commons-logging
- commons-logging
-
-
-
@@ -232,7 +217,6 @@
org.apache.maven.plugins
maven-deploy-plugin
-
net.alchim31.maven
scala-maven-plugin
diff --git a/exchangis-plugins/engine/sqoop/src/main/assembly/distribution.xml b/exchangis-engines/engineconn-plugins/sqoop/src/main/assembly/distribution.xml
similarity index 99%
rename from exchangis-plugins/engine/sqoop/src/main/assembly/distribution.xml
rename to exchangis-engines/engineconn-plugins/sqoop/src/main/assembly/distribution.xml
index 78f54c4c0..a88001e18 100644
--- a/exchangis-plugins/engine/sqoop/src/main/assembly/distribution.xml
+++ b/exchangis-engines/engineconn-plugins/sqoop/src/main/assembly/distribution.xml
@@ -32,7 +32,7 @@
- /dist/v${sqoop.version}/lib
+ /dist/${sqoop.version}/lib
true
true
false
diff --git a/exchangis-plugins/engine/sqoop/src/main/java/org/apache/linkis/engineconnplugin/sqoop/client/LinkisSqoopClient.java b/exchangis-engines/engineconn-plugins/sqoop/src/main/java/org/apache/linkis/engineconnplugin/sqoop/client/LinkisSqoopClient.java
similarity index 100%
rename from exchangis-plugins/engine/sqoop/src/main/java/org/apache/linkis/engineconnplugin/sqoop/client/LinkisSqoopClient.java
rename to exchangis-engines/engineconn-plugins/sqoop/src/main/java/org/apache/linkis/engineconnplugin/sqoop/client/LinkisSqoopClient.java
diff --git a/exchangis-plugins/engine/sqoop/src/main/java/org/apache/linkis/engineconnplugin/sqoop/client/Sqoop.java b/exchangis-engines/engineconn-plugins/sqoop/src/main/java/org/apache/linkis/engineconnplugin/sqoop/client/Sqoop.java
similarity index 100%
rename from exchangis-plugins/engine/sqoop/src/main/java/org/apache/linkis/engineconnplugin/sqoop/client/Sqoop.java
rename to exchangis-engines/engineconn-plugins/sqoop/src/main/java/org/apache/linkis/engineconnplugin/sqoop/client/Sqoop.java
diff --git a/exchangis-plugins/engine/sqoop/src/main/java/org/apache/linkis/engineconnplugin/sqoop/client/config/ExecutionContext.java b/exchangis-engines/engineconn-plugins/sqoop/src/main/java/org/apache/linkis/engineconnplugin/sqoop/client/config/ExecutionContext.java
similarity index 100%
rename from exchangis-plugins/engine/sqoop/src/main/java/org/apache/linkis/engineconnplugin/sqoop/client/config/ExecutionContext.java
rename to exchangis-engines/engineconn-plugins/sqoop/src/main/java/org/apache/linkis/engineconnplugin/sqoop/client/config/ExecutionContext.java
diff --git a/exchangis-plugins/engine/sqoop/src/main/java/org/apache/linkis/engineconnplugin/sqoop/client/config/ParamsMapping.java b/exchangis-engines/engineconn-plugins/sqoop/src/main/java/org/apache/linkis/engineconnplugin/sqoop/client/config/ParamsMapping.java
similarity index 100%
rename from exchangis-plugins/engine/sqoop/src/main/java/org/apache/linkis/engineconnplugin/sqoop/client/config/ParamsMapping.java
rename to exchangis-engines/engineconn-plugins/sqoop/src/main/java/org/apache/linkis/engineconnplugin/sqoop/client/config/ParamsMapping.java
diff --git a/exchangis-plugins/engine/sqoop/src/main/java/org/apache/linkis/engineconnplugin/sqoop/client/exception/JobClosableException.java b/exchangis-engines/engineconn-plugins/sqoop/src/main/java/org/apache/linkis/engineconnplugin/sqoop/client/exception/JobClosableException.java
similarity index 100%
rename from exchangis-plugins/engine/sqoop/src/main/java/org/apache/linkis/engineconnplugin/sqoop/client/exception/JobClosableException.java
rename to exchangis-engines/engineconn-plugins/sqoop/src/main/java/org/apache/linkis/engineconnplugin/sqoop/client/exception/JobClosableException.java
diff --git a/exchangis-plugins/engine/sqoop/src/main/java/org/apache/linkis/engineconnplugin/sqoop/client/exception/JobExecutionException.java b/exchangis-engines/engineconn-plugins/sqoop/src/main/java/org/apache/linkis/engineconnplugin/sqoop/client/exception/JobExecutionException.java
similarity index 100%
rename from exchangis-plugins/engine/sqoop/src/main/java/org/apache/linkis/engineconnplugin/sqoop/client/exception/JobExecutionException.java
rename to exchangis-engines/engineconn-plugins/sqoop/src/main/java/org/apache/linkis/engineconnplugin/sqoop/client/exception/JobExecutionException.java
diff --git a/exchangis-plugins/engine/sqoop/src/main/java/org/apache/linkis/engineconnplugin/sqoop/client/utils/JarLoader.java b/exchangis-engines/engineconn-plugins/sqoop/src/main/java/org/apache/linkis/engineconnplugin/sqoop/client/utils/JarLoader.java
similarity index 100%
rename from exchangis-plugins/engine/sqoop/src/main/java/org/apache/linkis/engineconnplugin/sqoop/client/utils/JarLoader.java
rename to exchangis-engines/engineconn-plugins/sqoop/src/main/java/org/apache/linkis/engineconnplugin/sqoop/client/utils/JarLoader.java
diff --git a/exchangis-plugins/engine/sqoop/src/main/java/org/apache/sqoop/mapreduce/JobBase.java b/exchangis-engines/engineconn-plugins/sqoop/src/main/java/org/apache/sqoop/mapreduce/JobBase.java
similarity index 100%
rename from exchangis-plugins/engine/sqoop/src/main/java/org/apache/sqoop/mapreduce/JobBase.java
rename to exchangis-engines/engineconn-plugins/sqoop/src/main/java/org/apache/sqoop/mapreduce/JobBase.java
diff --git a/exchangis-plugins/engine/sqoop/src/main/resources/linkis-engineconn.properties b/exchangis-engines/engineconn-plugins/sqoop/src/main/resources/linkis-engineconn.properties
similarity index 100%
rename from exchangis-plugins/engine/sqoop/src/main/resources/linkis-engineconn.properties
rename to exchangis-engines/engineconn-plugins/sqoop/src/main/resources/linkis-engineconn.properties
diff --git a/exchangis-engines/engineconn-plugins/sqoop/src/main/resources/log4j2.xml b/exchangis-engines/engineconn-plugins/sqoop/src/main/resources/log4j2.xml
new file mode 100644
index 000000000..3b45ae2a1
--- /dev/null
+++ b/exchangis-engines/engineconn-plugins/sqoop/src/main/resources/log4j2.xml
@@ -0,0 +1,82 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/exchangis-plugins/engine/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/SqoopEngineConnPlugin.scala b/exchangis-engines/engineconn-plugins/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/SqoopEngineConnPlugin.scala
similarity index 93%
rename from exchangis-plugins/engine/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/SqoopEngineConnPlugin.scala
rename to exchangis-engines/engineconn-plugins/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/SqoopEngineConnPlugin.scala
index 52266bb71..ae322a3f5 100644
--- a/exchangis-plugins/engine/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/SqoopEngineConnPlugin.scala
+++ b/exchangis-engines/engineconn-plugins/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/SqoopEngineConnPlugin.scala
@@ -25,16 +25,17 @@ import org.apache.linkis.manager.label.entity.Label
import org.apache.linkis.engineconnplugin.sqoop.factory.SqoopEngineConnFactory
import org.apache.linkis.engineconnplugin.sqoop.launch.SqoopEngineConnLaunchBuilder
+import java.util.Map
+import java.util.List
class SqoopEngineConnPlugin extends EngineConnPlugin{
private val EP_CONTEXT_CONSTRUCTOR_LOCK = new Object()
private var engineResourceFactory: EngineResourceFactory = _
private var engineConnLaunchBuilder: EngineConnLaunchBuilder = _
private var engineConnFactory: EngineConnFactory = _
- override def init(params: java.util.Map[String, Any]): Unit = {}
+ override def init(params: Map[String, AnyRef]): Unit = {}
override def getEngineResourceFactory: EngineResourceFactory = {
-
EP_CONTEXT_CONSTRUCTOR_LOCK.synchronized{
if(null == engineResourceFactory){
engineResourceFactory = new GenericEngineResourceFactory
@@ -62,5 +63,6 @@ class SqoopEngineConnPlugin extends EngineConnPlugin{
}
}
- override def getDefaultLabels: java.util.List[Label[_]] = new java.util.ArrayList[Label[_]]
+ override def getDefaultLabels: List[Label[_]] = new java.util.ArrayList[Label[_]]
+
}
diff --git a/exchangis-plugins/engine/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/context/SqoopEngineConnContext.scala b/exchangis-engines/engineconn-plugins/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/context/SqoopEngineConnContext.scala
similarity index 100%
rename from exchangis-plugins/engine/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/context/SqoopEngineConnContext.scala
rename to exchangis-engines/engineconn-plugins/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/context/SqoopEngineConnContext.scala
diff --git a/exchangis-plugins/engine/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/context/SqoopEnvConfiguration.scala b/exchangis-engines/engineconn-plugins/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/context/SqoopEnvConfiguration.scala
similarity index 100%
rename from exchangis-plugins/engine/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/context/SqoopEnvConfiguration.scala
rename to exchangis-engines/engineconn-plugins/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/context/SqoopEnvConfiguration.scala
diff --git a/exchangis-plugins/engine/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/context/SqoopParamsConfiguration.scala b/exchangis-engines/engineconn-plugins/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/context/SqoopParamsConfiguration.scala
similarity index 100%
rename from exchangis-plugins/engine/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/context/SqoopParamsConfiguration.scala
rename to exchangis-engines/engineconn-plugins/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/context/SqoopParamsConfiguration.scala
diff --git a/exchangis-plugins/engine/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/context/SqoopResourceConfiguration.scala b/exchangis-engines/engineconn-plugins/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/context/SqoopResourceConfiguration.scala
similarity index 100%
rename from exchangis-plugins/engine/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/context/SqoopResourceConfiguration.scala
rename to exchangis-engines/engineconn-plugins/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/context/SqoopResourceConfiguration.scala
diff --git a/exchangis-plugins/engine/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/executor/SqoopExecutor.scala b/exchangis-engines/engineconn-plugins/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/executor/SqoopExecutor.scala
similarity index 100%
rename from exchangis-plugins/engine/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/executor/SqoopExecutor.scala
rename to exchangis-engines/engineconn-plugins/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/executor/SqoopExecutor.scala
diff --git a/exchangis-plugins/engine/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/executor/SqoopOnceCodeExecutor.scala b/exchangis-engines/engineconn-plugins/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/executor/SqoopOnceCodeExecutor.scala
similarity index 100%
rename from exchangis-plugins/engine/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/executor/SqoopOnceCodeExecutor.scala
rename to exchangis-engines/engineconn-plugins/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/executor/SqoopOnceCodeExecutor.scala
diff --git a/exchangis-plugins/engine/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/executor/SqoopOnceExecutor.scala b/exchangis-engines/engineconn-plugins/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/executor/SqoopOnceExecutor.scala
similarity index 100%
rename from exchangis-plugins/engine/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/executor/SqoopOnceExecutor.scala
rename to exchangis-engines/engineconn-plugins/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/executor/SqoopOnceExecutor.scala
diff --git a/exchangis-plugins/engine/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/factory/SqoopEngineConnFactory.scala b/exchangis-engines/engineconn-plugins/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/factory/SqoopEngineConnFactory.scala
similarity index 100%
rename from exchangis-plugins/engine/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/factory/SqoopEngineConnFactory.scala
rename to exchangis-engines/engineconn-plugins/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/factory/SqoopEngineConnFactory.scala
diff --git a/exchangis-plugins/engine/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/factory/SqoopExecutorFactory.scala b/exchangis-engines/engineconn-plugins/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/factory/SqoopExecutorFactory.scala
similarity index 100%
rename from exchangis-plugins/engine/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/factory/SqoopExecutorFactory.scala
rename to exchangis-engines/engineconn-plugins/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/factory/SqoopExecutorFactory.scala
diff --git a/exchangis-plugins/engine/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/launch/SqoopEngineConnLaunchBuilder.scala b/exchangis-engines/engineconn-plugins/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/launch/SqoopEngineConnLaunchBuilder.scala
similarity index 100%
rename from exchangis-plugins/engine/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/launch/SqoopEngineConnLaunchBuilder.scala
rename to exchangis-engines/engineconn-plugins/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/launch/SqoopEngineConnLaunchBuilder.scala
diff --git a/exchangis-plugins/engine/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/params/SqoopParamsResolver.scala b/exchangis-engines/engineconn-plugins/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/params/SqoopParamsResolver.scala
similarity index 100%
rename from exchangis-plugins/engine/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/params/SqoopParamsResolver.scala
rename to exchangis-engines/engineconn-plugins/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/params/SqoopParamsResolver.scala
diff --git a/exchangis-plugins/engine/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/resource/SqoopEngineConnResourceFactory.scala b/exchangis-engines/engineconn-plugins/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/resource/SqoopEngineConnResourceFactory.scala
similarity index 100%
rename from exchangis-plugins/engine/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/resource/SqoopEngineConnResourceFactory.scala
rename to exchangis-engines/engineconn-plugins/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/resource/SqoopEngineConnResourceFactory.scala
diff --git a/exchangis-plugins/engine/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/util/ClassUtil.scala b/exchangis-engines/engineconn-plugins/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/util/ClassUtil.scala
similarity index 100%
rename from exchangis-plugins/engine/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/util/ClassUtil.scala
rename to exchangis-engines/engineconn-plugins/sqoop/src/main/scala/org/apache/linkis/engineconnplugin/sqoop/util/ClassUtil.scala
diff --git a/exchangis-plugins/engine/datax/datax-assembly/package.xml b/exchangis-engines/engines/datax/datax-assembly/package.xml
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-assembly/package.xml
rename to exchangis-engines/engines/datax/datax-assembly/package.xml
diff --git a/exchangis-plugins/engine/datax/datax-assembly/pom.xml b/exchangis-engines/engines/datax/datax-assembly/pom.xml
similarity index 94%
rename from exchangis-plugins/engine/datax/datax-assembly/pom.xml
rename to exchangis-engines/engines/datax/datax-assembly/pom.xml
index d4c7e1fc2..74b755512 100644
--- a/exchangis-plugins/engine/datax/datax-assembly/pom.xml
+++ b/exchangis-engines/engines/datax/datax-assembly/pom.xml
@@ -3,9 +3,9 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- exchangis-executor-engine-datax
+ exchangis-engine-datax
com.webank.wedatasphere.exchangis
- 1.0.0
+ 1.1.2
../pom.xml
4.0.0
diff --git a/exchangis-plugins/engine/datax/datax-core/pom.xml b/exchangis-engines/engines/datax/datax-core/pom.xml
similarity index 91%
rename from exchangis-plugins/engine/datax/datax-core/pom.xml
rename to exchangis-engines/engines/datax/datax-core/pom.xml
index a0cfd11b6..48be143d3 100644
--- a/exchangis-plugins/engine/datax/datax-core/pom.xml
+++ b/exchangis-engines/engines/datax/datax-core/pom.xml
@@ -3,14 +3,14 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- exchangis-executor-engine-datax
+ exchangis-engine-datax
com.webank.wedatasphere.exchangis
- 1.0.0
+ 1.1.2
../pom.xml
4.0.0
jar
- ${datax.engine.version}
+ 3.0.0-Plus-2
datax-core
@@ -19,8 +19,12 @@
1.0.15
- com.alibaba
- fastjson
+ com.fasterxml.jackson.core
+ jackson-core
+
+
+ com.fasterxml.jackson.core
+ jackson-databind
commons-configuration
@@ -75,6 +79,7 @@
ch.qos.logback
logback-classic
+ provided
org.slf4j
@@ -122,21 +127,21 @@
dm
16
system
- ${basedir}/src/main/lib/Dm7JdbcDriver16.jar
+ ${pom.basedir}/src/main/lib/Dm7JdbcDriver16.jar
com.sybase
jconn3
1.0.0-SNAPSHOT
system
- ${basedir}/src/main/lib/jconn3-1.0.0-SNAPSHOT.jar
+ ${pom.basedir}/src/main/lib/jconn3-1.0.0-SNAPSHOT.jar
ppas
ppas
16
system
- ${basedir}/src/main/lib/edb-jdbc16.jar
+ ${pom.basedir}/src/main/lib/edb-jdbc16.jar
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/assembly/package.xml b/exchangis-engines/engines/datax/datax-core/src/main/assembly/package.xml
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/assembly/package.xml
rename to exchangis-engines/engines/datax/datax-core/src/main/assembly/package.xml
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/bin/datax.py b/exchangis-engines/engines/datax/datax-core/src/main/bin/datax.py
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/bin/datax.py
rename to exchangis-engines/engines/datax/datax-core/src/main/bin/datax.py
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/bin/dxprof.py b/exchangis-engines/engines/datax/datax-core/src/main/bin/dxprof.py
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/bin/dxprof.py
rename to exchangis-engines/engines/datax/datax-core/src/main/bin/dxprof.py
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/bin/perftrace.py b/exchangis-engines/engines/datax/datax-core/src/main/bin/perftrace.py
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/bin/perftrace.py
rename to exchangis-engines/engines/datax/datax-core/src/main/bin/perftrace.py
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/base/BaseObject.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/common/base/BaseObject.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/base/BaseObject.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/common/base/BaseObject.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/constant/CommonConstant.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/common/constant/CommonConstant.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/constant/CommonConstant.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/common/constant/CommonConstant.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/constant/PluginType.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/common/constant/PluginType.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/constant/PluginType.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/common/constant/PluginType.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/element/BoolColumn.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/common/element/BoolColumn.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/element/BoolColumn.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/common/element/BoolColumn.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/element/BytesColumn.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/common/element/BytesColumn.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/element/BytesColumn.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/common/element/BytesColumn.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/element/Column.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/common/element/Column.java
similarity index 93%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/element/Column.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/common/element/Column.java
index c8d580e17..c5a121bd3 100644
--- a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/element/Column.java
+++ b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/common/element/Column.java
@@ -1,6 +1,7 @@
package com.alibaba.datax.common.element;
-import com.alibaba.fastjson.JSON;
+
+import com.webank.wedatasphere.exchangis.datax.util.Json;
import java.math.BigDecimal;
import java.math.BigInteger;
@@ -66,7 +67,7 @@ protected void setByteSize(int byteSize) {
@Override
public String toString() {
- return JSON.toJSONString(this);
+ return Json.toJson(this, null);
}
public enum Type {
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/element/ColumnCast.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/common/element/ColumnCast.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/element/ColumnCast.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/common/element/ColumnCast.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/element/DateColumn.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/common/element/DateColumn.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/element/DateColumn.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/common/element/DateColumn.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/element/DoubleColumn.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/common/element/DoubleColumn.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/element/DoubleColumn.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/common/element/DoubleColumn.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/element/LongColumn.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/common/element/LongColumn.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/element/LongColumn.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/common/element/LongColumn.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/element/OverFlowUtil.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/common/element/OverFlowUtil.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/element/OverFlowUtil.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/common/element/OverFlowUtil.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/element/Record.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/common/element/Record.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/element/Record.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/common/element/Record.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/element/StringColumn.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/common/element/StringColumn.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/element/StringColumn.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/common/element/StringColumn.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/exception/CommonErrorCode.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/common/exception/CommonErrorCode.java
similarity index 91%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/exception/CommonErrorCode.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/common/exception/CommonErrorCode.java
index 8679ffb47..0cd4ad7e2 100644
--- a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/exception/CommonErrorCode.java
+++ b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/common/exception/CommonErrorCode.java
@@ -15,7 +15,8 @@ public enum CommonErrorCode implements ErrorCode {
HOOK_INTERNAL_ERROR("Common-12", "Hook运行错误 ."),
SHUT_DOWN_TASK("Common-20", "Task收到了shutdown指令,为failover做准备"),
WAIT_TIME_EXCEED("Common-21", "等待时间超出范围"),
- TASK_HUNG_EXPIRED("Common-22", "任务hung住,Expired");
+ TASK_HUNG_EXPIRED("Common-22", "任务hung住,Expired"),
+ UNSUPPORTED_METHOD("Commmon-23", "暂不支持该方法");
private final String code;
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/exception/DataXException.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/common/exception/DataXException.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/exception/DataXException.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/common/exception/DataXException.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/exception/ExceptionTracker.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/common/exception/ExceptionTracker.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/exception/ExceptionTracker.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/common/exception/ExceptionTracker.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/plugin/AbstractJobPlugin.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/common/plugin/AbstractJobPlugin.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/plugin/AbstractJobPlugin.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/common/plugin/AbstractJobPlugin.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/plugin/AbstractPlugin.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/common/plugin/AbstractPlugin.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/plugin/AbstractPlugin.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/common/plugin/AbstractPlugin.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/plugin/AbstractTaskPlugin.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/common/plugin/AbstractTaskPlugin.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/plugin/AbstractTaskPlugin.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/common/plugin/AbstractTaskPlugin.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/plugin/BasicDataReceiver.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/common/plugin/BasicDataReceiver.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/plugin/BasicDataReceiver.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/common/plugin/BasicDataReceiver.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/plugin/JobPluginCollector.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/common/plugin/JobPluginCollector.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/plugin/JobPluginCollector.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/common/plugin/JobPluginCollector.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/plugin/PluginCollector.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/common/plugin/PluginCollector.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/plugin/PluginCollector.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/common/plugin/PluginCollector.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/plugin/PluginProcessorLoader.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/common/plugin/PluginProcessorLoader.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/plugin/PluginProcessorLoader.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/common/plugin/PluginProcessorLoader.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/plugin/Pluginable.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/common/plugin/Pluginable.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/plugin/Pluginable.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/common/plugin/Pluginable.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/plugin/RecordReceiver.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/common/plugin/RecordReceiver.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/plugin/RecordReceiver.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/common/plugin/RecordReceiver.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/plugin/RecordSender.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/common/plugin/RecordSender.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/plugin/RecordSender.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/common/plugin/RecordSender.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/plugin/TaskPluginCollector.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/common/plugin/TaskPluginCollector.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/plugin/TaskPluginCollector.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/common/plugin/TaskPluginCollector.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/spi/ErrorCode.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/common/spi/ErrorCode.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/spi/ErrorCode.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/common/spi/ErrorCode.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/spi/Hook.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/common/spi/Hook.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/spi/Hook.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/common/spi/Hook.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/spi/Reader.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/common/spi/Reader.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/spi/Reader.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/common/spi/Reader.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/spi/Writer.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/common/spi/Writer.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/spi/Writer.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/common/spi/Writer.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/statistics/PerfRecord.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/common/statistics/PerfRecord.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/statistics/PerfRecord.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/common/statistics/PerfRecord.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/statistics/PerfTrace.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/common/statistics/PerfTrace.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/statistics/PerfTrace.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/common/statistics/PerfTrace.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/statistics/VMInfo.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/common/statistics/VMInfo.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/statistics/VMInfo.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/common/statistics/VMInfo.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/util/Configuration.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/common/util/Configuration.java
similarity index 98%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/util/Configuration.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/common/util/Configuration.java
index b93d96c68..c6d5d2a1a 100644
--- a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/util/Configuration.java
+++ b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/common/util/Configuration.java
@@ -3,8 +3,7 @@
import com.alibaba.datax.common.exception.CommonErrorCode;
import com.alibaba.datax.common.exception.DataXException;
import com.alibaba.datax.common.spi.ErrorCode;
-import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.serializer.SerializerFeature;
+import com.webank.wedatasphere.exchangis.datax.util.Json;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.CharUtils;
import org.apache.commons.lang3.StringUtils;
@@ -210,7 +209,12 @@ public String getString(final String path) {
if (null == string) {
return null;
}
- return String.valueOf(string);
+ Class> clazz = string.getClass();
+ if(clazz.equals(String.class) ||
+ clazz.isPrimitive() || isWrapClass(clazz)){
+ return String.valueOf(string);
+ }
+ return Json.toJson(string, null);
}
/**
@@ -576,8 +580,7 @@ public T get(final String path, Class clazz) {
* 格式化Configuration输出
*/
public String beautify() {
- return JSON.toJSONString(this.getInternal(),
- SerializerFeature.PrettyFormat);
+ return Json.toJson(this.getInternal(), null, true);
}
/**
@@ -1059,7 +1062,7 @@ private static void checkJSON(final String json) {
private Configuration(final String json) {
try {
- this.root = JSON.parse(json);
+ this.root = Json.fromJson(json, Object.class);
} catch (Exception e) {
throw DataXException.asDataXException(CommonErrorCode.CONFIG_ERROR,
String.format("配置信息错误. 您提供的配置信息不是合法的JSON格式: %s . 请按照标准json格式提供配置信息. ", e.getMessage()));
@@ -1067,11 +1070,18 @@ private Configuration(final String json) {
}
private static String toJSONString(final Object object) {
- return JSON.toJSONString(object);
+ return Json.toJson(object, null);
}
public Set getSecretKeyPathSet() {
return secretKeyPathSet;
}
+ private static boolean isWrapClass(Class> clz){
+ try{
+ return ((Class>)clz.getField("TYPE").get(null)).isPrimitive();
+ }catch (Exception e){
+ return false;
+ }
+ }
}
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/util/FilterUtil.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/common/util/FilterUtil.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/util/FilterUtil.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/common/util/FilterUtil.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/util/HostUtils.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/common/util/HostUtils.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/util/HostUtils.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/common/util/HostUtils.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/util/ListUtil.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/common/util/ListUtil.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/util/ListUtil.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/common/util/ListUtil.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/util/RangeSplitUtil.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/common/util/RangeSplitUtil.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/util/RangeSplitUtil.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/common/util/RangeSplitUtil.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/util/RetryUtil.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/common/util/RetryUtil.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/util/RetryUtil.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/common/util/RetryUtil.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/util/StrUtil.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/common/util/StrUtil.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/util/StrUtil.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/common/util/StrUtil.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/AbstractContainer.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/AbstractContainer.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/AbstractContainer.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/AbstractContainer.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/Engine.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/Engine.java
similarity index 99%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/Engine.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/Engine.java
index 054a3ef39..b2e346b4d 100644
--- a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/Engine.java
+++ b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/Engine.java
@@ -44,6 +44,8 @@ public class Engine {
/* check job model (job/task) first */
public void start(Configuration allConf) {
+ //todo 放在DataxOnceExecutor实现
+
// 绑定column转换信息
ColumnCast.bind(allConf);
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/container/util/HookInvoker.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/container/util/HookInvoker.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/container/util/HookInvoker.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/container/util/HookInvoker.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/container/util/JobAssignUtil.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/container/util/JobAssignUtil.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/container/util/JobAssignUtil.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/container/util/JobAssignUtil.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/job/JobContainer.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/job/JobContainer.java
similarity index 95%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/job/JobContainer.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/job/JobContainer.java
index 4e967e822..c71523ece 100644
--- a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/job/JobContainer.java
+++ b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/job/JobContainer.java
@@ -34,7 +34,7 @@
import com.alibaba.datax.core.util.container.CoreConstant;
import com.alibaba.datax.core.util.container.LoadUtil;
import com.alibaba.datax.dataxservice.face.domain.enums.ExecuteMode;
-import com.alibaba.fastjson.JSON;
+import com.webank.wedatasphere.exchangis.datax.util.Json;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.filefilter.FileFileFilter;
import org.apache.commons.lang.StringUtils;
@@ -465,14 +465,14 @@ private int split() {
//change the channel speed when channel speed * taskNumber
List transformerList = this.configuration.getListConfiguration(CoreConstant.DATAX_JOB_CONTENT_TRANSFORMER);
- LOG.debug("transformer configuration: " + JSON.toJSONString(transformerList));
+ LOG.debug("transformer configuration: " + Json.toJson(transformerList, null));
//input: reader parameter list and writer task list(contain properties: parameter, name and processor)
//output: "content" array
List contentConfig = mergeReaderAndWriterTaskConfigs(
readerTaskConfigs, writerTaskConfigs, transformerList);
- LOG.debug("contentConfig configuration: " + JSON.toJSONString(contentConfig));
+ LOG.debug("contentConfig configuration: " + Json.toJson(contentConfig, null));
this.configuration.set(CoreConstant.DATAX_JOB_CONTENT, contentConfig);
@@ -720,33 +720,34 @@ private void logStatistics() {
}
//report to server
- try {
- HttpClientUtil httpClientUtil = HttpClientUtil.getHttpClientUtil();
- Map report =new HashMap<>(10);
- report.put("id", configuration.getLong(CoreConstant.DATAX_CORE_CONTAINER_JOB_ID));
- report.put("byteSpeedPerSecond",byteSpeedPerSecond);
- report.put("recordSpeedPerSecond",recordSpeedPerSecond);
- report.put("totalCosts",totalCosts);
- report.put("totalErrorRecords",CommunicationTool.getTotalErrorRecords(communication));
- report.put("totalReadRecords",CommunicationTool.getTotalReadRecords(communication));
- report.put("totalReadBytes", CommunicationTool.getTotalReadBytes(communication));
- report.put("transformerFailedRecords",communication.getLongCounter(CommunicationTool.TRANSFORMER_FAILED_RECORDS));
- report.put("transformerFilterRecords",communication.getLongCounter(CommunicationTool.TRANSFORMER_FILTER_RECORDS));
- report.put("transformerTotalRecords",communication.getLongCounter(CommunicationTool.TRANSFORMER_SUCCEED_RECORDS));
- StringEntity entity = new StringEntity(JSON.toJSONString(report));
- entity.setContentEncoding("UTF-8");
- entity.setContentType("application/json");
- HttpPost post = HttpClientUtil.getPostRequest(configuration.getString(CoreConstant.DATAX_CORE_DATAXSERVER_PROTOCOL)
- + "://" + configuration.getString(CoreConstant.DATAX_CORE_DATAXSERVER_ADDRESS)
- + configuration.getString(CoreConstant.DATAX_CORE_DATAXSERVER_ENDPOINT_REPORT),
- entity,
- "Content-Type", "application/json;charset=UTF-8");
- String response = httpClientUtil.executeAndGet(post, String.class);
- LOG.info("Send report respone,{}",response);
- }catch (Exception e){
- LOG.error("Post report error",e);
+ if (StringUtils.isNotBlank(configuration.getString(CoreConstant.DATAX_CORE_DATAXSERVER_ENDPOINT_REPORT))) {
+ try {
+ HttpClientUtil httpClientUtil = HttpClientUtil.getHttpClientUtil();
+ Map report = new HashMap<>(10);
+ report.put("id", configuration.getLong(CoreConstant.DATAX_CORE_CONTAINER_JOB_ID));
+ report.put("byteSpeedPerSecond", byteSpeedPerSecond);
+ report.put("recordSpeedPerSecond", recordSpeedPerSecond);
+ report.put("totalCosts", totalCosts);
+ report.put("totalErrorRecords", CommunicationTool.getTotalErrorRecords(communication));
+ report.put("totalReadRecords", CommunicationTool.getTotalReadRecords(communication));
+ report.put("totalReadBytes", CommunicationTool.getTotalReadBytes(communication));
+ report.put("transformerFailedRecords", communication.getLongCounter(CommunicationTool.TRANSFORMER_FAILED_RECORDS));
+ report.put("transformerFilterRecords", communication.getLongCounter(CommunicationTool.TRANSFORMER_FILTER_RECORDS));
+ report.put("transformerTotalRecords", communication.getLongCounter(CommunicationTool.TRANSFORMER_SUCCEED_RECORDS));
+ StringEntity entity = new StringEntity(Json.toJson(report, null));
+ entity.setContentEncoding("UTF-8");
+ entity.setContentType("application/json");
+ HttpPost post = HttpClientUtil.getPostRequest(configuration.getString(CoreConstant.DATAX_CORE_DATAXSERVER_PROTOCOL)
+ + "://" + configuration.getString(CoreConstant.DATAX_CORE_DATAXSERVER_ADDRESS)
+ + configuration.getString(CoreConstant.DATAX_CORE_DATAXSERVER_ENDPOINT_REPORT),
+ entity,
+ "Content-Type", "application/json;charset=UTF-8");
+ String response = httpClientUtil.executeAndGet(post, String.class);
+ LOG.info("Send report respone,{}", response);
+ } catch (Exception e) {
+ LOG.error("Post report error", e);
+ }
}
-
}
/**
@@ -1213,7 +1214,7 @@ private List doLoadProcessor(String namespace){
}
});
}
- LOG.info("Loading processors finished, " + JSON.toJSONString(processors));
+ LOG.info("Loading processors finished, " + Json.toJson(processors, null));
return processors;
}
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/job/meta/ExecuteMode.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/job/meta/ExecuteMode.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/job/meta/ExecuteMode.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/job/meta/ExecuteMode.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/job/meta/State.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/job/meta/State.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/job/meta/State.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/job/meta/State.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/job/scheduler/AbstractScheduler.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/job/scheduler/AbstractScheduler.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/job/scheduler/AbstractScheduler.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/job/scheduler/AbstractScheduler.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/job/scheduler/processinner/ProcessInnerScheduler.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/job/scheduler/processinner/ProcessInnerScheduler.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/job/scheduler/processinner/ProcessInnerScheduler.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/job/scheduler/processinner/ProcessInnerScheduler.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/job/scheduler/processinner/StandAloneScheduler.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/job/scheduler/processinner/StandAloneScheduler.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/job/scheduler/processinner/StandAloneScheduler.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/job/scheduler/processinner/StandAloneScheduler.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/communication/Communication.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/communication/Communication.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/communication/Communication.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/communication/Communication.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/communication/CommunicationTool.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/communication/CommunicationTool.java
similarity index 99%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/communication/CommunicationTool.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/communication/CommunicationTool.java
index 59a0ea6ca..5a106c7e2 100644
--- a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/communication/CommunicationTool.java
+++ b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/communication/CommunicationTool.java
@@ -2,7 +2,7 @@
import com.alibaba.datax.common.statistics.PerfTrace;
import com.alibaba.datax.common.util.StrUtil;
-import com.alibaba.fastjson.JSON;
+import com.webank.wedatasphere.exchangis.datax.util.Json;
import org.apache.commons.lang.Validate;
import java.text.DecimalFormat;
@@ -220,7 +220,7 @@ public static String getSnapshot(Communication communication) {
pair = getWaitWriterTime(communication);
state.put((String) pair.getKey(), pair.getValue());
- return JSON.toJSONString(state);
+ return Json.toJson(state, null);
}
private static Pair getTotalBytes(final Communication communication) {
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/communication/LocalTGCommunicationManager.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/communication/LocalTGCommunicationManager.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/communication/LocalTGCommunicationManager.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/communication/LocalTGCommunicationManager.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/container/collector/AbstractCollector.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/container/collector/AbstractCollector.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/container/collector/AbstractCollector.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/container/collector/AbstractCollector.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/container/collector/ProcessInnerCollector.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/container/collector/ProcessInnerCollector.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/container/collector/ProcessInnerCollector.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/container/collector/ProcessInnerCollector.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/container/communicator/AbstractContainerCommunicator.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/container/communicator/AbstractContainerCommunicator.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/container/communicator/AbstractContainerCommunicator.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/container/communicator/AbstractContainerCommunicator.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/container/communicator/job/StandAloneJobContainerCommunicator.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/container/communicator/job/StandAloneJobContainerCommunicator.java
similarity index 86%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/container/communicator/job/StandAloneJobContainerCommunicator.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/container/communicator/job/StandAloneJobContainerCommunicator.java
index 7044794ed..b05ac38c0 100644
--- a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/container/communicator/job/StandAloneJobContainerCommunicator.java
+++ b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/container/communicator/job/StandAloneJobContainerCommunicator.java
@@ -5,7 +5,9 @@
import com.alibaba.datax.core.statistics.communication.CommunicationTool;
import com.alibaba.datax.core.statistics.container.collector.ProcessInnerCollector;
import com.alibaba.datax.core.statistics.container.communicator.AbstractContainerCommunicator;
+import com.alibaba.datax.core.statistics.container.report.AbstractReporter;
import com.alibaba.datax.core.statistics.container.report.ProcessInnerReporter;
+import com.alibaba.datax.core.util.ClassUtil;
import com.alibaba.datax.core.util.container.CoreConstant;
import com.alibaba.datax.dataxservice.face.domain.enums.State;
import org.slf4j.Logger;
@@ -22,7 +24,9 @@ public StandAloneJobContainerCommunicator(Configuration configuration) {
super(configuration);
super.setCollector(new ProcessInnerCollector(configuration.getLong(
CoreConstant.DATAX_CORE_CONTAINER_JOB_ID)));
- super.setReporter(new ProcessInnerReporter(configuration));
+ // Set the reporter defined in configuration
+ super.setReporter(ClassUtil.instantiate(configuration.getString(CoreConstant.DATAX_CORE_STATISTICS_REPORTER_PLUGIN_CLASS),
+ AbstractReporter.class, configuration));
}
@Override
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/container/communicator/taskgroup/AbstractTGContainerCommunicator.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/container/communicator/taskgroup/AbstractTGContainerCommunicator.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/container/communicator/taskgroup/AbstractTGContainerCommunicator.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/container/communicator/taskgroup/AbstractTGContainerCommunicator.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/container/communicator/taskgroup/StandaloneTGContainerCommunicator.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/container/communicator/taskgroup/StandaloneTGContainerCommunicator.java
similarity index 60%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/container/communicator/taskgroup/StandaloneTGContainerCommunicator.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/container/communicator/taskgroup/StandaloneTGContainerCommunicator.java
index 82dba8bdf..8ea0ac5d6 100644
--- a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/container/communicator/taskgroup/StandaloneTGContainerCommunicator.java
+++ b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/container/communicator/taskgroup/StandaloneTGContainerCommunicator.java
@@ -2,13 +2,18 @@
import com.alibaba.datax.common.util.Configuration;
import com.alibaba.datax.core.statistics.communication.Communication;
+import com.alibaba.datax.core.statistics.container.report.AbstractReporter;
import com.alibaba.datax.core.statistics.container.report.ProcessInnerReporter;
+import com.alibaba.datax.core.util.ClassUtil;
+import com.alibaba.datax.core.util.container.CoreConstant;
public class StandaloneTGContainerCommunicator extends AbstractTGContainerCommunicator {
public StandaloneTGContainerCommunicator(Configuration configuration) {
super(configuration);
- super.setReporter(new ProcessInnerReporter(configuration));
+ // Set the reporter defined in configuration
+ super.setReporter(ClassUtil.instantiate(configuration.getString(CoreConstant.DATAX_CORE_STATISTICS_REPORTER_PLUGIN_CLASS),
+ AbstractReporter.class, configuration));
}
@Override
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/container/report/AbstractReporter.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/container/report/AbstractReporter.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/container/report/AbstractReporter.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/container/report/AbstractReporter.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/container/report/ProcessInnerReporter.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/container/report/ProcessInnerReporter.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/container/report/ProcessInnerReporter.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/container/report/ProcessInnerReporter.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/plugin/DefaultJobPluginCollector.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/plugin/DefaultJobPluginCollector.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/plugin/DefaultJobPluginCollector.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/plugin/DefaultJobPluginCollector.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/plugin/task/AbstractTaskPluginCollector.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/plugin/task/AbstractTaskPluginCollector.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/plugin/task/AbstractTaskPluginCollector.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/plugin/task/AbstractTaskPluginCollector.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/plugin/task/HttpPluginCollector.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/plugin/task/HttpPluginCollector.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/plugin/task/HttpPluginCollector.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/plugin/task/HttpPluginCollector.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/plugin/task/StdoutPluginCollector.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/plugin/task/StdoutPluginCollector.java
similarity index 96%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/plugin/task/StdoutPluginCollector.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/plugin/task/StdoutPluginCollector.java
index d64784cf8..a54ae4fb7 100644
--- a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/plugin/task/StdoutPluginCollector.java
+++ b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/plugin/task/StdoutPluginCollector.java
@@ -6,7 +6,7 @@
import com.alibaba.datax.core.statistics.communication.Communication;
import com.alibaba.datax.core.statistics.plugin.task.util.DirtyRecord;
import com.alibaba.datax.core.util.container.CoreConstant;
-import com.alibaba.fastjson.JSON;
+import com.webank.wedatasphere.exchangis.datax.util.Json;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -53,7 +53,7 @@ private String formatDirty(final Record dirty, final Throwable t,
.getColumns());
}
- return JSON.toJSONString(msgGroup);
+ return Json.toJson(msgGroup, null);
}
@Override
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/plugin/task/util/DirtyRecord.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/plugin/task/util/DirtyRecord.java
similarity index 97%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/plugin/task/util/DirtyRecord.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/plugin/task/util/DirtyRecord.java
index 8d95c398f..4ced82ca5 100644
--- a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/plugin/task/util/DirtyRecord.java
+++ b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/statistics/plugin/task/util/DirtyRecord.java
@@ -4,7 +4,7 @@
import com.alibaba.datax.common.element.Record;
import com.alibaba.datax.common.exception.DataXException;
import com.alibaba.datax.core.util.FrameworkErrorCode;
-import com.alibaba.fastjson.JSON;
+import com.webank.wedatasphere.exchangis.datax.util.Json;
import java.math.BigDecimal;
import java.math.BigInteger;
@@ -32,7 +32,7 @@ public void addColumn(Column column) {
@Override
public String toString() {
- return JSON.toJSONString(this.columns);
+ return Json.toJson(this.columns, null);
}
@Override
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/taskgroup/TaskGroupContainer.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/taskgroup/TaskGroupContainer.java
similarity index 99%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/taskgroup/TaskGroupContainer.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/taskgroup/TaskGroupContainer.java
index 43d378bd6..76cfa836e 100644
--- a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/taskgroup/TaskGroupContainer.java
+++ b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/taskgroup/TaskGroupContainer.java
@@ -31,7 +31,7 @@
import com.alibaba.datax.core.util.container.CoreConstant;
import com.alibaba.datax.core.util.container.LoadUtil;
import com.alibaba.datax.dataxservice.face.domain.enums.State;
-import com.alibaba.fastjson.JSON;
+import com.webank.wedatasphere.exchangis.datax.util.Json;
import org.apache.commons.lang3.Validate;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -145,7 +145,7 @@ public void start() {
if (LOG.isDebugEnabled()) {
LOG.debug("taskGroup[{}]'s task configs[{}]", this.taskGroupId,
- JSON.toJSONString(taskConfigs));
+ Json.toJson(taskConfigs, null));
}
int taskCountInThisTaskGroup = taskConfigs.size();
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/taskgroup/TaskMonitor.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/taskgroup/TaskMonitor.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/taskgroup/TaskMonitor.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/taskgroup/TaskMonitor.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/taskgroup/runner/AbstractRunner.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/taskgroup/runner/AbstractRunner.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/taskgroup/runner/AbstractRunner.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/taskgroup/runner/AbstractRunner.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/taskgroup/runner/ReaderRunner.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/taskgroup/runner/ReaderRunner.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/taskgroup/runner/ReaderRunner.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/taskgroup/runner/ReaderRunner.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/taskgroup/runner/TaskGroupContainerRunner.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/taskgroup/runner/TaskGroupContainerRunner.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/taskgroup/runner/TaskGroupContainerRunner.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/taskgroup/runner/TaskGroupContainerRunner.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/taskgroup/runner/WriterRunner.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/taskgroup/runner/WriterRunner.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/taskgroup/runner/WriterRunner.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/taskgroup/runner/WriterRunner.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/channel/AbstractChannel.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/channel/AbstractChannel.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/channel/AbstractChannel.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/channel/AbstractChannel.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/channel/RecordChannel.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/channel/RecordChannel.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/channel/RecordChannel.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/channel/RecordChannel.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/channel/memory/MemoryRecordChannel.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/channel/memory/MemoryRecordChannel.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/channel/memory/MemoryRecordChannel.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/channel/memory/MemoryRecordChannel.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/exchanger/BufferedRecordExchanger.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/exchanger/BufferedRecordExchanger.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/exchanger/BufferedRecordExchanger.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/exchanger/BufferedRecordExchanger.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/exchanger/BufferedRecordTransformerExchanger.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/exchanger/BufferedRecordTransformerExchanger.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/exchanger/BufferedRecordTransformerExchanger.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/exchanger/BufferedRecordTransformerExchanger.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/exchanger/RecordExchanger.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/exchanger/RecordExchanger.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/exchanger/RecordExchanger.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/exchanger/RecordExchanger.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/exchanger/TransformerExchanger.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/exchanger/TransformerExchanger.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/exchanger/TransformerExchanger.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/exchanger/TransformerExchanger.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/record/DefaultRecord.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/record/DefaultRecord.java
similarity index 97%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/record/DefaultRecord.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/record/DefaultRecord.java
index 808fe8a25..3d6446702 100644
--- a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/record/DefaultRecord.java
+++ b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/record/DefaultRecord.java
@@ -5,7 +5,7 @@
import com.alibaba.datax.common.exception.DataXException;
import com.alibaba.datax.core.util.ClassSize;
import com.alibaba.datax.core.util.FrameworkErrorCode;
-import com.alibaba.fastjson.JSON;
+import com.webank.wedatasphere.exchangis.datax.util.Json;
import java.util.ArrayList;
import java.util.HashMap;
@@ -68,7 +68,7 @@ public String toString() {
Map json = new HashMap();
json.put("size", this.getColumnNumber());
json.put("data", this.columns);
- return JSON.toJSONString(json);
+ return Json.toJson(json, null);
}
@Override
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/record/TerminateRecord.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/record/TerminateRecord.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/record/TerminateRecord.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/record/TerminateRecord.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/ComplexTransformerProxy.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/ComplexTransformerProxy.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/ComplexTransformerProxy.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/ComplexTransformerProxy.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/FilterTransformer.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/FilterTransformer.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/FilterTransformer.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/FilterTransformer.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/GroovyTransformer.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/GroovyTransformer.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/GroovyTransformer.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/GroovyTransformer.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/GroovyTransformerStaticUtil.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/GroovyTransformerStaticUtil.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/GroovyTransformerStaticUtil.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/GroovyTransformerStaticUtil.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/PadTransformer.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/PadTransformer.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/PadTransformer.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/PadTransformer.java
diff --git a/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/PrecisionTransformer.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/PrecisionTransformer.java
new file mode 100644
index 000000000..0ab4fda6d
--- /dev/null
+++ b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/PrecisionTransformer.java
@@ -0,0 +1,56 @@
+package com.alibaba.datax.core.transport.transformer;
+
+import com.alibaba.datax.common.element.Column;
+import com.alibaba.datax.common.element.Record;
+import com.alibaba.datax.common.element.StringColumn;
+import com.alibaba.datax.common.exception.DataXException;
+import com.alibaba.datax.transformer.Transformer;
+
+import java.math.BigDecimal;
+import java.util.Arrays;
+
+public class PrecisionTransformer extends Transformer {
+ public PrecisionTransformer() {
+ setTransformerName("dx_precision");
+ }
+
+ @Override
+ public Record evaluate(Record record, Object... paras) {
+
+ int columnIndex;
+ int precision;
+ try {
+ if (paras.length != 2) {
+ throw new RuntimeException("dx_precision paras must be 2");
+ }
+
+ columnIndex = (Integer) paras[0];
+ precision = Integer.valueOf((String) paras[1]);
+ } catch (Exception e) {
+ throw DataXException.asDataXException(TransformerErrorCode.TRANSFORMER_ILLEGAL_PARAMETER, "paras:" + Arrays.asList(paras).toString() + " => " + e.getMessage());
+ }
+
+ Column column = record.getColumn(columnIndex);
+
+ try {
+ String oriValue = column.asString();
+
+ //如果字段为空,跳过replace处理
+ if (oriValue == null) {
+ return record;
+ }
+ BigDecimal oriNum = new BigDecimal(oriValue);
+ BigDecimal zeroNum = new BigDecimal("0");
+ if(oriNum.doubleValue() == zeroNum.doubleValue()){
+ record.setColumn(columnIndex, new StringColumn("0"));
+ }
+ else {
+ BigDecimal newValue = new BigDecimal(oriValue).setScale(precision, BigDecimal.ROUND_DOWN);
+ record.setColumn(columnIndex, new StringColumn(newValue.toString()));
+ }
+ } catch (Exception e) {
+ throw DataXException.asDataXException(TransformerErrorCode.TRANSFORMER_RUN_EXCEPTION, e.getMessage(), e);
+ }
+ return record;
+ }
+}
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/ReplaceTransformer.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/ReplaceTransformer.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/ReplaceTransformer.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/ReplaceTransformer.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/SubstrTransformer.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/SubstrTransformer.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/SubstrTransformer.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/SubstrTransformer.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/TransformerErrorCode.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/TransformerErrorCode.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/TransformerErrorCode.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/TransformerErrorCode.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/TransformerExecution.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/TransformerExecution.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/TransformerExecution.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/TransformerExecution.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/TransformerExecutionParas.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/TransformerExecutionParas.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/TransformerExecutionParas.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/TransformerExecutionParas.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/TransformerInfo.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/TransformerInfo.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/TransformerInfo.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/TransformerInfo.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/TransformerRegistry.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/TransformerRegistry.java
similarity index 99%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/TransformerRegistry.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/TransformerRegistry.java
index b12367b44..9a657b691 100644
--- a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/TransformerRegistry.java
+++ b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/transport/transformer/TransformerRegistry.java
@@ -36,6 +36,7 @@ public class TransformerRegistry {
registTransformer(new ReplaceTransformer());
registTransformer(new FilterTransformer());
registTransformer(new GroovyTransformer());
+ registTransformer(new PrecisionTransformer());
}
public static void loadTransformerFromLocalStorage() {
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/ClassSize.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/util/ClassSize.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/ClassSize.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/util/ClassSize.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/ClassUtil.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/util/ClassUtil.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/ClassUtil.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/util/ClassUtil.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/CompressSuffixName.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/util/CompressSuffixName.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/CompressSuffixName.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/util/CompressSuffixName.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/ConfigParser.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/util/ConfigParser.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/ConfigParser.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/util/ConfigParser.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/ConfigurationValidate.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/util/ConfigurationValidate.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/ConfigurationValidate.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/util/ConfigurationValidate.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/ErrorRecordChecker.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/util/ErrorRecordChecker.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/ErrorRecordChecker.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/util/ErrorRecordChecker.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/ExceptionTracker.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/util/ExceptionTracker.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/ExceptionTracker.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/util/ExceptionTracker.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/FrameworkErrorCode.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/util/FrameworkErrorCode.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/FrameworkErrorCode.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/util/FrameworkErrorCode.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/HttpClientUtil.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/util/HttpClientUtil.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/HttpClientUtil.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/util/HttpClientUtil.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/LdapUtil.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/util/LdapUtil.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/LdapUtil.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/util/LdapUtil.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/SecretUtil.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/util/SecretUtil.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/SecretUtil.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/util/SecretUtil.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/TransformerUtil.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/util/TransformerUtil.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/TransformerUtil.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/util/TransformerUtil.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/container/ClassLoaderSwapper.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/util/container/ClassLoaderSwapper.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/container/ClassLoaderSwapper.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/util/container/ClassLoaderSwapper.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/container/CoreConstant.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/util/container/CoreConstant.java
similarity index 98%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/container/CoreConstant.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/util/container/CoreConstant.java
index dc654a822..1ce02b4d1 100644
--- a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/container/CoreConstant.java
+++ b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/util/container/CoreConstant.java
@@ -80,12 +80,15 @@ public class CoreConstant {
public static final String DATAX_CORE_STATISTICS_COLLECTOR_PLUGIN_MAXDIRTYNUM = "core.statistics.collector.plugin.maxDirtyNumber";
+ public static final String DATAX_CORE_STATISTICS_REPORTER_PLUGIN_CLASS = "core.statistics.reporter.plugin.class";
+
public static final String DATAX_CORE_PROCESSOR_LOADER_PLUGIN_CLASS = "core.processor.loader.plugin.class";
public static final String DATAX_CORE_PROCESSOR_LODAER_PLUGIN_SOURCEPATH = "core.processor.loader.plugin.sourcePath";
public static final String DATAX_CORE_PROCESSOR_LOADER_PLUGIN_PACKAGE = "core.processor.loader.plugin.package";
+
public static final String DATAX_JOB_CONTENT_READER_NAME = "job.content[0].reader.name";
public static final String DATAX_JOB_CONTENT_READER_PARAMETER = "job.content[0].reader.parameter";
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/container/JarLoader.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/util/container/JarLoader.java
similarity index 71%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/container/JarLoader.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/util/container/JarLoader.java
index abea439e3..a23af0d49 100644
--- a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/container/JarLoader.java
+++ b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/util/container/JarLoader.java
@@ -96,39 +96,39 @@ public boolean accept(File pathname) {
return jarURLs;
}
- /**
- * change the order to load class
- * @param name
- * @param resolve
- * @return
- * @throws ClassNotFoundException
- */
- @Override
- public Class> loadClass(String name, boolean resolve) throws ClassNotFoundException {
- synchronized (getClassLoadingLock(name)){
- //First, check if the class has already been loaded
- Class> c = findLoadedClass(name);
- if(c == null){
- long t0 = System.nanoTime();
- try {
- //invoke findClass in this class
- c = findClass(name);
- }catch(ClassNotFoundException e){
- // ClassNotFoundException thrown if class not found
- }
- if(c == null){
- return super.loadClass(name, resolve);
- }
- //For compatibility with higher versions > java 1.8.0_141
-// sun.misc.PerfCounter.getFindClasses().addElapsedTimeFrom(t0);
-// sun.misc.PerfCounter.getFindClasses().increment();
- }
- if(resolve){
- resolveClass(c);
- }
- return c;
- }
- }
+// /**
+// * change the order to load class
+// * @param name
+// * @param resolve
+// * @return
+// * @throws ClassNotFoundException
+// */
+// @Override
+// public Class> loadClass(String name, boolean resolve) throws ClassNotFoundException {
+// synchronized (getClassLoadingLock(name)){
+// //First, check if the class has already been loaded
+// Class> c = findLoadedClass(name);
+// if(c == null){
+// long t0 = System.nanoTime();
+// try {
+// //invoke findClass in this class
+// c = findClass(name);
+// }catch(ClassNotFoundException e){
+// // ClassNotFoundException thrown if class not found
+// }
+// if(c == null){
+// return super.loadClass(name, resolve);
+// }
+// //For compatibility with higher versions > java 1.8.0_141
+//// sun.misc.PerfCounter.getFindClasses().addElapsedTimeFrom(t0);
+//// sun.misc.PerfCounter.getFindClasses().increment();
+// }
+// if(resolve){
+// resolveClass(c);
+// }
+// return c;
+// }
+// }
/**
* defined class by bytes
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/container/LoadUtil.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/util/container/LoadUtil.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/core/util/container/LoadUtil.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/core/util/container/LoadUtil.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/dataxservice/face/domain/enums/EnumStrVal.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/dataxservice/face/domain/enums/EnumStrVal.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/dataxservice/face/domain/enums/EnumStrVal.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/dataxservice/face/domain/enums/EnumStrVal.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/dataxservice/face/domain/enums/EnumVal.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/dataxservice/face/domain/enums/EnumVal.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/dataxservice/face/domain/enums/EnumVal.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/dataxservice/face/domain/enums/EnumVal.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/dataxservice/face/domain/enums/ExecuteMode.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/dataxservice/face/domain/enums/ExecuteMode.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/dataxservice/face/domain/enums/ExecuteMode.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/dataxservice/face/domain/enums/ExecuteMode.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/dataxservice/face/domain/enums/State.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/dataxservice/face/domain/enums/State.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/dataxservice/face/domain/enums/State.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/dataxservice/face/domain/enums/State.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/reader/CommonRdbmsReader.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/reader/CommonRdbmsReader.java
similarity index 99%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/reader/CommonRdbmsReader.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/reader/CommonRdbmsReader.java
index cea1e37ce..d6d037507 100644
--- a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/reader/CommonRdbmsReader.java
+++ b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/reader/CommonRdbmsReader.java
@@ -14,6 +14,7 @@
import com.alibaba.datax.plugin.rdbms.util.*;
import com.google.common.collect.Lists;
import com.webank.wedatasphere.exchangis.datax.common.CryptoUtils;
+import com.webank.wedatasphere.exchangis.datax.util.Json;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -66,7 +67,7 @@ public void preCheck(Configuration originalConfig, DataBaseType dataBaseType) {
}
Collection taskList = new ArrayList();
for (int i = 0, len = connList.size(); i < len; i++) {
- Configuration connConf = Configuration.from(connList.get(i).toString());
+ Configuration connConf = Configuration.from(Json.toJson(connList.get(i), null));
PreCheckTask t = new PreCheckTask(username, password, proxyHost, proxyPort, connConf, dataBaseType, splitPK);
taskList.add(t);
}
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/reader/Constant.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/reader/Constant.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/reader/Constant.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/reader/Constant.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/reader/Key.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/reader/Key.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/reader/Key.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/reader/Key.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/reader/ResultSetReadProxy.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/reader/ResultSetReadProxy.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/reader/ResultSetReadProxy.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/reader/ResultSetReadProxy.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/reader/util/HintUtil.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/reader/util/HintUtil.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/reader/util/HintUtil.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/reader/util/HintUtil.java
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/reader/util/OriginalConfPretreatmentUtil.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/reader/util/OriginalConfPretreatmentUtil.java
similarity index 98%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/reader/util/OriginalConfPretreatmentUtil.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/reader/util/OriginalConfPretreatmentUtil.java
index b48818398..037c8ce1c 100644
--- a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/reader/util/OriginalConfPretreatmentUtil.java
+++ b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/reader/util/OriginalConfPretreatmentUtil.java
@@ -7,6 +7,7 @@
import com.alibaba.datax.plugin.rdbms.reader.Key;
import com.alibaba.datax.plugin.rdbms.util.*;
import com.webank.wedatasphere.exchangis.datax.common.CryptoUtils;
+import com.webank.wedatasphere.exchangis.datax.util.Json;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -90,7 +91,7 @@ private static void dealJdbcAndTable(Configuration originalConfig) {
for (int i = 0, len = conns.size(); i < len; i++) {
Configuration connConf = Configuration
- .from(conns.get(i).toString());
+ .from(Json.toJson(conns.get(i), null));
connConf.getNecessaryValue(Key.JDBC_URL,
DBUtilErrorCode.REQUIRED_VALUE);
@@ -265,7 +266,7 @@ private static boolean recognizeTableOrQuerySqlMode(
boolean isQuerySqlMode = false;
for (int i = 0, len = conns.size(); i < len; i++) {
Configuration connConf = Configuration
- .from(conns.get(i).toString());
+ .from(Json.toJson(conns.get(i), null));
table = connConf.getString(Key.TABLE, null);
querySql = connConf.getString(Key.QUERY_SQL, null);
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/reader/util/PreCheckTask.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/reader/util/PreCheckTask.java
similarity index 93%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/reader/util/PreCheckTask.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/reader/util/PreCheckTask.java
index 5fdb8054c..8c7b1df00 100644
--- a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/reader/util/PreCheckTask.java
+++ b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/reader/util/PreCheckTask.java
@@ -7,6 +7,7 @@
import com.alibaba.datax.plugin.rdbms.util.DataBaseType;
import com.alibaba.datax.plugin.rdbms.util.RdbmsException;
import com.alibaba.druid.sql.parser.ParserException;
+import com.webank.wedatasphere.exchangis.datax.util.Json;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -60,11 +61,11 @@ public Boolean call() throws DataXException {
for (int i = 0; i < querySqls.size(); i++) {
String splitPkSql = null;
- String querySql = querySqls.get(i).toString();
+ String querySql = Json.toJson(querySqls.get(i), null);
String table = null;
if (tables != null && !tables.isEmpty()) {
- table = tables.get(i).toString();
+ table = Json.toJson(tables.get(i), null);
}
/*verify query*/
@@ -84,7 +85,7 @@ public Boolean call() throws DataXException {
/*verify splitPK*/
try {
if (splitPkSqls != null && !splitPkSqls.isEmpty()) {
- splitPkSql = splitPkSqls.get(i).toString();
+ splitPkSql = Json.toJson(splitPkSqls.get(i), null);
DBUtil.sqlValid(splitPkSql, dataBaseType);
if (i == 0) {
SingleTableSplitUtil.precheckSplitPk(conn, splitPkSql, fetchSize, table, userName);
diff --git a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/reader/util/ReaderSplitUtil.java b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/reader/util/ReaderSplitUtil.java
similarity index 96%
rename from exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/reader/util/ReaderSplitUtil.java
rename to exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/reader/util/ReaderSplitUtil.java
index 928e81249..c72f0e61a 100644
--- a/exchangis-plugins/engine/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/reader/util/ReaderSplitUtil.java
+++ b/exchangis-engines/engines/datax/datax-core/src/main/java/com/alibaba/datax/plugin/rdbms/reader/util/ReaderSplitUtil.java
@@ -5,6 +5,7 @@
import com.alibaba.datax.plugin.rdbms.reader.Constant;
import com.alibaba.datax.plugin.rdbms.reader.Key;
import com.alibaba.datax.plugin.rdbms.util.DataBaseType;
+import com.webank.wedatasphere.exchangis.datax.util.Json;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.Validate;
import org.slf4j.Logger;
@@ -38,7 +39,7 @@ public static List doSplit(
for (int i = 0, len = conns.size(); i < len; i++) {
Configuration sliceConfig = originalSliceConfig.clone();
- Configuration connConf = Configuration.from(conns.get(i).toString());
+ Configuration connConf = Configuration.from(Json.toJson(conns.get(i), null));
String jdbcUrl = connConf.getString(Key.JDBC_URL);
sliceConfig.set(Key.JDBC_URL, jdbcUrl);
@@ -119,7 +120,7 @@ public static Configuration doPreCheckSplit(Configuration originalSliceConfig) {
List
-
- com.alibaba
- fastjson
- provided
-
com.google.guava
guava
diff --git a/exchangis-plugins/engine/datax/datax-textfilereader/src/main/assembly/package.xml b/exchangis-engines/engines/datax/datax-textfilereader/src/main/assembly/package.xml
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-textfilereader/src/main/assembly/package.xml
rename to exchangis-engines/engines/datax/datax-textfilereader/src/main/assembly/package.xml
diff --git a/exchangis-plugins/engine/datax/datax-textfilereader/src/main/java/com/alibaba/datax/plugin/reader/txtfilereader/Constant.java b/exchangis-engines/engines/datax/datax-textfilereader/src/main/java/com/alibaba/datax/plugin/reader/txtfilereader/Constant.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-textfilereader/src/main/java/com/alibaba/datax/plugin/reader/txtfilereader/Constant.java
rename to exchangis-engines/engines/datax/datax-textfilereader/src/main/java/com/alibaba/datax/plugin/reader/txtfilereader/Constant.java
diff --git a/exchangis-plugins/engine/datax/datax-textfilereader/src/main/java/com/alibaba/datax/plugin/reader/txtfilereader/Key.java b/exchangis-engines/engines/datax/datax-textfilereader/src/main/java/com/alibaba/datax/plugin/reader/txtfilereader/Key.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-textfilereader/src/main/java/com/alibaba/datax/plugin/reader/txtfilereader/Key.java
rename to exchangis-engines/engines/datax/datax-textfilereader/src/main/java/com/alibaba/datax/plugin/reader/txtfilereader/Key.java
diff --git a/exchangis-plugins/engine/datax/datax-textfilereader/src/main/java/com/alibaba/datax/plugin/reader/txtfilereader/TxtFileReader.java b/exchangis-engines/engines/datax/datax-textfilereader/src/main/java/com/alibaba/datax/plugin/reader/txtfilereader/TxtFileReader.java
similarity index 98%
rename from exchangis-plugins/engine/datax/datax-textfilereader/src/main/java/com/alibaba/datax/plugin/reader/txtfilereader/TxtFileReader.java
rename to exchangis-engines/engines/datax/datax-textfilereader/src/main/java/com/alibaba/datax/plugin/reader/txtfilereader/TxtFileReader.java
index 5b64e76c2..3106a0442 100644
--- a/exchangis-plugins/engine/datax/datax-textfilereader/src/main/java/com/alibaba/datax/plugin/reader/txtfilereader/TxtFileReader.java
+++ b/exchangis-engines/engines/datax/datax-textfilereader/src/main/java/com/alibaba/datax/plugin/reader/txtfilereader/TxtFileReader.java
@@ -11,9 +11,8 @@
import com.alibaba.datax.plugin.unstructuredstorage.PathMeta;
import com.alibaba.datax.plugin.unstructuredstorage.reader.UnstructuredStorageReaderErrorCode;
import com.alibaba.datax.plugin.unstructuredstorage.reader.UnstructuredStorageReaderUtil;
-import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.JSONObject;
import com.google.common.collect.Sets;
+import com.webank.wedatasphere.exchangis.datax.util.Json;
import org.apache.commons.io.Charsets;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.BooleanUtils;
@@ -442,7 +441,8 @@ public void destroy() {
public void startRead(RecordSender recordSender) {
LOG.debug("start read source files...");
for (Object sourceFile : this.sourceFiles) {
- PathMeta pathMeta = JSONObject.parseObject(JSON.toJSONString(sourceFile), PathMeta.class);
+ PathMeta pathMeta = Json.fromJson(Json.toJson(sourceFile, null), PathMeta.class);
+ assert pathMeta != null;
String fileName = pathMeta.getAbsolute();
LOG.info(String.format("reading file : [%s]", fileName));
InputStream inputStream;
@@ -468,7 +468,8 @@ public void startRead(RecordSender recordSender) {
public void startRead(ChannelOutput channelOutput) {
LOG.info("start read source files to stream channel...");
for(Object sourceFile: this.sourceFiles){
- PathMeta pathMeta = JSONObject.parseObject(JSON.toJSONString(sourceFile), PathMeta.class);
+ PathMeta pathMeta = Json.fromJson(Json.toJson(sourceFile, null), PathMeta.class);
+ assert pathMeta != null;
String absolutePath = pathMeta.getAbsolute();
String relativePath = pathMeta.getRelative();
LOG.info(String.format("reading file : [%s]", absolutePath));
diff --git a/exchangis-plugins/engine/datax/datax-textfilereader/src/main/java/com/alibaba/datax/plugin/reader/txtfilereader/TxtFileReaderErrorCode.java b/exchangis-engines/engines/datax/datax-textfilereader/src/main/java/com/alibaba/datax/plugin/reader/txtfilereader/TxtFileReaderErrorCode.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-textfilereader/src/main/java/com/alibaba/datax/plugin/reader/txtfilereader/TxtFileReaderErrorCode.java
rename to exchangis-engines/engines/datax/datax-textfilereader/src/main/java/com/alibaba/datax/plugin/reader/txtfilereader/TxtFileReaderErrorCode.java
diff --git a/exchangis-plugins/engine/datax/datax-textfilereader/src/main/resources/plugin.json b/exchangis-engines/engines/datax/datax-textfilereader/src/main/resources/plugin.json
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-textfilereader/src/main/resources/plugin.json
rename to exchangis-engines/engines/datax/datax-textfilereader/src/main/resources/plugin.json
diff --git a/exchangis-plugins/engine/datax/datax-textfilereader/src/main/resources/plugin_job_template.json b/exchangis-engines/engines/datax/datax-textfilereader/src/main/resources/plugin_job_template.json
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-textfilereader/src/main/resources/plugin_job_template.json
rename to exchangis-engines/engines/datax/datax-textfilereader/src/main/resources/plugin_job_template.json
diff --git a/exchangis-plugins/engine/datax/datax-textfilewriter/pom.xml b/exchangis-engines/engines/datax/datax-textfilewriter/pom.xml
similarity index 90%
rename from exchangis-plugins/engine/datax/datax-textfilewriter/pom.xml
rename to exchangis-engines/engines/datax/datax-textfilewriter/pom.xml
index dff38573f..1d0c9f1f3 100644
--- a/exchangis-plugins/engine/datax/datax-textfilewriter/pom.xml
+++ b/exchangis-engines/engines/datax/datax-textfilewriter/pom.xml
@@ -3,13 +3,13 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- exchangis-executor-engine-datax
+ exchangis-engine-datax
com.webank.wedatasphere.exchangis
- 1.0.0
+ 1.1.2
../pom.xml
4.0.0
- ${datax.engine.version}
+ 3.0.0-Plus-2
datax-textfilewriter
jar
@@ -51,11 +51,6 @@
${commons-codec}
provided
-
- com.alibaba
- fastjson
- provided
-
com.google.guava
guava
diff --git a/exchangis-plugins/engine/datax/datax-textfilewriter/src/main/assembly/package.xml b/exchangis-engines/engines/datax/datax-textfilewriter/src/main/assembly/package.xml
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-textfilewriter/src/main/assembly/package.xml
rename to exchangis-engines/engines/datax/datax-textfilewriter/src/main/assembly/package.xml
diff --git a/exchangis-plugins/engine/datax/datax-textfilewriter/src/main/java/com/alibaba/datax/plugin/writer/txtfilewriter/Key.java b/exchangis-engines/engines/datax/datax-textfilewriter/src/main/java/com/alibaba/datax/plugin/writer/txtfilewriter/Key.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-textfilewriter/src/main/java/com/alibaba/datax/plugin/writer/txtfilewriter/Key.java
rename to exchangis-engines/engines/datax/datax-textfilewriter/src/main/java/com/alibaba/datax/plugin/writer/txtfilewriter/Key.java
diff --git a/exchangis-plugins/engine/datax/datax-textfilewriter/src/main/java/com/alibaba/datax/plugin/writer/txtfilewriter/TxtFileWriter.java b/exchangis-engines/engines/datax/datax-textfilewriter/src/main/java/com/alibaba/datax/plugin/writer/txtfilewriter/TxtFileWriter.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-textfilewriter/src/main/java/com/alibaba/datax/plugin/writer/txtfilewriter/TxtFileWriter.java
rename to exchangis-engines/engines/datax/datax-textfilewriter/src/main/java/com/alibaba/datax/plugin/writer/txtfilewriter/TxtFileWriter.java
diff --git a/exchangis-plugins/engine/datax/datax-textfilewriter/src/main/java/com/alibaba/datax/plugin/writer/txtfilewriter/TxtFileWriterErrorCode.java b/exchangis-engines/engines/datax/datax-textfilewriter/src/main/java/com/alibaba/datax/plugin/writer/txtfilewriter/TxtFileWriterErrorCode.java
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-textfilewriter/src/main/java/com/alibaba/datax/plugin/writer/txtfilewriter/TxtFileWriterErrorCode.java
rename to exchangis-engines/engines/datax/datax-textfilewriter/src/main/java/com/alibaba/datax/plugin/writer/txtfilewriter/TxtFileWriterErrorCode.java
diff --git a/exchangis-plugins/engine/datax/datax-textfilewriter/src/main/resources/plugin.json b/exchangis-engines/engines/datax/datax-textfilewriter/src/main/resources/plugin.json
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-textfilewriter/src/main/resources/plugin.json
rename to exchangis-engines/engines/datax/datax-textfilewriter/src/main/resources/plugin.json
diff --git a/exchangis-plugins/engine/datax/datax-textfilewriter/src/main/resources/plugin_job_template.json b/exchangis-engines/engines/datax/datax-textfilewriter/src/main/resources/plugin_job_template.json
similarity index 100%
rename from exchangis-plugins/engine/datax/datax-textfilewriter/src/main/resources/plugin_job_template.json
rename to exchangis-engines/engines/datax/datax-textfilewriter/src/main/resources/plugin_job_template.json
diff --git a/exchangis-plugins/engine/datax/pom.xml b/exchangis-engines/engines/datax/pom.xml
similarity index 86%
rename from exchangis-plugins/engine/datax/pom.xml
rename to exchangis-engines/engines/datax/pom.xml
index 311769e66..15d7f5879 100644
--- a/exchangis-plugins/engine/datax/pom.xml
+++ b/exchangis-engines/engines/datax/pom.xml
@@ -3,19 +3,19 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- exchangis-plugins
com.webank.wedatasphere.exchangis
- 1.0.0
+ exchangis
+ 1.1.2
+ ../../../pom.xml
4.0.0
- exchangis-executor-engine-datax
+ exchangis-engine-datax
pom
1.7.25
1.2.3
- 1.2.68
3.1.1
16.0.1
2.8.2
@@ -25,11 +25,12 @@
1.10
1.2
1.9.4
- 2.7.2
- 1.2.1
+ 3.3.4
+ 3.1.3
6.7.1
1.11
3.0.0-Plus-2
+ 2.11.0
datax-core
@@ -58,11 +59,6 @@
commons-pool
${commons-pool}
-
- com.alibaba
- fastjson
- ${fastjson-version}
-
com.google.guava
guava
@@ -113,6 +109,16 @@
commons-configuration
${commons-configuration-version}
+
+ com.fasterxml.jackson.core
+ jackson-core
+ ${jackson.version}
+
+
+ com.fasterxml.jackson.core
+ jackson-databind
+ ${jackson.version}
+
\ No newline at end of file
diff --git a/exchangis-engines/exchangis-engine-common/pom.xml b/exchangis-engines/exchangis-engine-common/pom.xml
new file mode 100644
index 000000000..d6cf14efa
--- /dev/null
+++ b/exchangis-engines/exchangis-engine-common/pom.xml
@@ -0,0 +1,30 @@
+
+
+
+ exchangis-engines
+ com.webank.wedatasphere.exchangis
+ 1.1.2
+
+ 4.0.0
+
+ exchangis-engine-common
+
+
+ 8
+ 8
+
+
+
+ com.webank.wedatasphere.exchangis
+ exchangis-dao
+ ${exchangis.version}
+
+
+ org.apache.linkis
+ linkis-common
+ ${linkis.version}
+
+
+
\ No newline at end of file
diff --git a/exchangis-engines/exchangis-engine-common/src/main/java/com/webank/wedatasphere/exchangis/engine/config/ExchangisEngineConfiguration.java b/exchangis-engines/exchangis-engine-common/src/main/java/com/webank/wedatasphere/exchangis/engine/config/ExchangisEngineConfiguration.java
new file mode 100644
index 000000000..728bae3f0
--- /dev/null
+++ b/exchangis-engines/exchangis-engine-common/src/main/java/com/webank/wedatasphere/exchangis/engine/config/ExchangisEngineConfiguration.java
@@ -0,0 +1,23 @@
+package com.webank.wedatasphere.exchangis.engine.config;
+
+import org.apache.linkis.common.conf.CommonVars;
+
+/**
+ * Engine configuration
+ */
+public class ExchangisEngineConfiguration {
+
+ public static final CommonVars ENGINE_RESOURCE_ROOT_PATH = CommonVars.apply("wds.exchangis.engine.root.path",
+ System.getProperty("user.dir", "/tmp/exchangis/") + "/engine");
+ /**
+ * If need to store the merged resource into local path
+ */
+ public static final CommonVars ENGINE_RESOURCE_MERGE_LOCAL = CommonVars.apply("wds.exchangis.engine.resource.merge.local", true);
+
+ public static final CommonVars ENGINE_RESOURCE_TMP_PATH = CommonVars.apply("wds.exchangis.engine.resource.temp.path", "/tmp/exchangis/engine");
+
+ /**
+ * Packet suffix
+ */
+ public static final CommonVars ENGINE_RESOURCE_PACKET_SUFFIX = CommonVars.apply("wds.exchangis.engine.resource.packet.suffix", ".zip");
+}
diff --git a/exchangis-engines/exchangis-engine-common/src/main/java/com/webank/wedatasphere/exchangis/engine/domain/EngineBmlResource.java b/exchangis-engines/exchangis-engine-common/src/main/java/com/webank/wedatasphere/exchangis/engine/domain/EngineBmlResource.java
new file mode 100644
index 000000000..04806258e
--- /dev/null
+++ b/exchangis-engines/exchangis-engine-common/src/main/java/com/webank/wedatasphere/exchangis/engine/domain/EngineBmlResource.java
@@ -0,0 +1,105 @@
+package com.webank.wedatasphere.exchangis.engine.domain;
+
+import org.apache.commons.io.IOUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.Calendar;
+
+/**
+ * BML resources
+ */
+public class EngineBmlResource extends EngineResource {
+
+ private static final Logger LOG = LoggerFactory.getLogger(EngineBmlResource.class);
+
+ public static final String DEFAULT_SCHEME = "bml";
+
+ /**
+ * Resource id
+ */
+ private String resourceId;
+
+ /**
+ * Version
+ */
+ private String version;
+
+ public EngineBmlResource(String engineType,
+ String path, String name,
+ String resourceId, String version, String creator){
+ this.type = DEFAULT_SCHEME;
+ this.name = name;
+ this.engineType = engineType;
+ this.resourceId = resourceId;
+ // Use the bml resource id as id
+ this.id = resourceId;
+ this.version = version;
+ this.path = path;
+ this.creator = creator;
+ Calendar calendar = Calendar.getInstance();
+ this.createTime = calendar.getTime();
+ this.modifyTime = calendar.getTime();
+ }
+
+ /**
+ * Get bml resource from stored resource
+ * @param storeResource store resource
+ */
+ public EngineBmlResource(EngineStoreResource storeResource){
+ this(storeResource.engineType, storeResource.path, storeResource.name, null, null,
+ storeResource.creator);
+ this.createTime = storeResource.createTime;
+ this.modifyTime = storeResource.modifyTime;
+ String storeUri = storeResource.getStoreUri();
+ if (StringUtils.isNotBlank(storeUri)){
+ try {
+ String storePath = new URI(storeUri).getPath();
+ if (storePath.startsWith(IOUtils.DIR_SEPARATOR_UNIX + "")){
+ storePath = storePath.substring(1);
+ }
+ String[] storeParts = storePath.split(IOUtils.DIR_SEPARATOR_UNIX + "");
+ if (storeParts.length >= 2){
+ this.resourceId = storeParts[0];
+ this.version = storeParts[1];
+ }
+ } catch (URISyntaxException e) {
+ LOG.warn("Unrecognized bml stored uri: [{}]", storeUri, e);
+ }
+ }
+ }
+
+ @Override
+ public InputStream getInputStream() throws IOException {
+ // TODO get input stream from BML
+ return null;
+ }
+
+ @Override
+ public URI getURI() throws URISyntaxException {
+ return new URI(DEFAULT_SCHEME, "", IOUtils.DIR_SEPARATOR_UNIX +
+ resourceId + IOUtils.DIR_SEPARATOR_UNIX + version, null, null);
+ }
+
+ public String getResourceId() {
+ return resourceId;
+ }
+
+ public void setResourceId(String resourceId) {
+ this.resourceId = resourceId;
+ }
+
+ public String getVersion() {
+ return version;
+ }
+
+ public void setVersion(String version) {
+ this.version = version;
+ }
+
+}
diff --git a/exchangis-engines/exchangis-engine-common/src/main/java/com/webank/wedatasphere/exchangis/engine/domain/EngineLocalPathResource.java b/exchangis-engines/exchangis-engine-common/src/main/java/com/webank/wedatasphere/exchangis/engine/domain/EngineLocalPathResource.java
new file mode 100644
index 000000000..5c038ab57
--- /dev/null
+++ b/exchangis-engines/exchangis-engine-common/src/main/java/com/webank/wedatasphere/exchangis/engine/domain/EngineLocalPathResource.java
@@ -0,0 +1,91 @@
+package com.webank.wedatasphere.exchangis.engine.domain;
+
+import com.webank.wedatasphere.exchangis.common.EnvironmentUtils;
+
+import java.io.*;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.Calendar;
+import java.util.UUID;
+
+/**
+ * Local engine resource
+ */
+public class EngineLocalPathResource extends EngineResource{
+
+ public static final String DEFAULT_SCHEME = "file";
+
+ /**
+ * Local file
+ */
+ private final File localFile;
+
+ /**
+ * Whether the resource is a packet
+ */
+ private boolean isPacket;
+
+ public EngineLocalPathResource(String engineType, URI baseUri, String path){
+ this(engineType, baseUri, path, false);
+ }
+
+ public EngineLocalPathResource(String engineType, URI baseUri, String path, boolean isPacket){
+ this.type = DEFAULT_SCHEME;
+ this.engineType = engineType;
+ this.path = path;
+ this.localFile = new File(baseUri.getPath(), path);
+ this.name = localFile.getName();
+ this.isPacket = isPacket;
+ Calendar calendar = Calendar.getInstance();
+ this.createTime = calendar.getTime();
+ this.modifyTime = calendar.getTime();
+ // Set the creator as jvm user
+ this.creator = EnvironmentUtils.getJvmUser();
+ // Random resource id
+ this.id = UUID.randomUUID().toString();
+ }
+ @Override
+ public InputStream getInputStream() throws IOException {
+ if (localFile.exists() && localFile.isFile()){
+ return new FileInputStream(this.localFile);
+ }
+ return null;
+ }
+
+ @Override
+ public URI getURI() throws URISyntaxException {
+ return this.localFile.toURI();
+ }
+
+
+ public String getPath() {
+ return path;
+ }
+
+ public File getLocalFile(){
+ return this.localFile;
+ }
+
+ public boolean isPacket() {
+ return isPacket;
+ }
+
+ public void setPacket(boolean isPacket){
+ this.isPacket = isPacket;
+ }
+
+ @Override
+ public int hashCode() {
+ return (getEngineType() + ":" + this.localFile.getPath()).hashCode();
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (obj instanceof EngineLocalPathResource){
+ EngineLocalPathResource other = (EngineLocalPathResource)obj;
+ return this.engineType.equals(other.getEngineType()) &&
+ this.localFile.getPath().equals(other.localFile.getPath());
+ }
+ return super.equals(obj);
+ }
+}
diff --git a/exchangis-engines/exchangis-engine-common/src/main/java/com/webank/wedatasphere/exchangis/engine/domain/EngineResource.java b/exchangis-engines/exchangis-engine-common/src/main/java/com/webank/wedatasphere/exchangis/engine/domain/EngineResource.java
new file mode 100644
index 000000000..ba74d2596
--- /dev/null
+++ b/exchangis-engines/exchangis-engine-common/src/main/java/com/webank/wedatasphere/exchangis/engine/domain/EngineResource.java
@@ -0,0 +1,127 @@
+package com.webank.wedatasphere.exchangis.engine.domain;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.Date;
+
+/**
+ * Engine resource
+ */
+public abstract class EngineResource {
+
+ /**
+ * Engine type
+ */
+ protected String engineType;
+
+ /**
+ * Resource id
+ */
+ protected String id;
+
+ /**
+ * Resource name
+ */
+ protected String name;
+
+ /**
+ * Resource type
+ */
+ protected String type;
+
+ /**
+ * Resource path
+ */
+ protected String path;
+
+ /**
+ * Create time
+ */
+ protected Date createTime;
+
+ /**
+ * Modify time
+ */
+ protected Date modifyTime;
+ /**
+ * Create user
+ */
+ protected String creator;
+ /**
+ * Get input stream from resource
+ * @return input stream
+ */
+ public abstract InputStream getInputStream() throws IOException;
+
+ /**
+ * URI value
+ * @return uri
+ */
+ public abstract URI getURI() throws URISyntaxException;
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public String getEngineType() {
+ return engineType;
+ }
+
+ public void setEngineType(String engineType) {
+ this.engineType = engineType;
+ }
+
+ public Date getCreateTime() {
+ return createTime;
+ }
+
+ public void setCreateTime(Date createTime) {
+ this.createTime = createTime;
+ }
+
+ public Date getModifyTime() {
+ return modifyTime;
+ }
+
+ public void setModifyTime(Date modifyTime) {
+ this.modifyTime = modifyTime;
+ }
+
+ public String getCreator() {
+ return creator;
+ }
+
+ public void setCreator(String creator) {
+ this.creator = creator;
+ }
+
+ public String getPath() {
+ return path;
+ }
+
+ public void setPath(String path) {
+ this.path = path;
+ }
+}
diff --git a/exchangis-engines/exchangis-engine-common/src/main/java/com/webank/wedatasphere/exchangis/engine/domain/EngineSettings.java b/exchangis-engines/exchangis-engine-common/src/main/java/com/webank/wedatasphere/exchangis/engine/domain/EngineSettings.java
new file mode 100644
index 000000000..10eb47a42
--- /dev/null
+++ b/exchangis-engines/exchangis-engine-common/src/main/java/com/webank/wedatasphere/exchangis/engine/domain/EngineSettings.java
@@ -0,0 +1,179 @@
+package com.webank.wedatasphere.exchangis.engine.domain;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.linkis.common.utils.JsonUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.*;
+
+/**
+ * Engine settings
+ */
+public class EngineSettings {
+
+ private static final Logger LOG = LoggerFactory.getLogger(EngineSettings.class);
+ /**
+ * ID
+ */
+ private String id;
+
+ /**
+ * Engine name: engine_name
+ */
+ private String name;
+
+ /**
+ * Description: engine_desc
+ */
+ private String description;
+
+ /**
+ * Settings: engine_settings_value
+ */
+ @JsonIgnoreProperties
+ private String settings;
+ /**
+ * Direction: engine_direction => hdfs->local,mysql->hdfs,mysql->hdfs
+ */
+ @JsonIgnoreProperties
+ private String direction;
+
+ /**
+ * Resource loader class: res_loader_class
+ */
+ private String resourceLoaderClass;
+
+ /**
+ * Resource uploader class: res_uploader_class
+ */
+ private String resourceUploaderClass;
+
+ /**
+ * Direct rules
+ */
+ private final List directionRules = new ArrayList<>();
+
+ /**
+ * Setting map
+ */
+ private final Map settingsMap = new HashMap<>();
+
+
+ public List getDirectionRules(){
+ if (directionRules.isEmpty() && StringUtils.isNotBlank(direction)){
+ synchronized (directionRules) {
+ if (directionRules.isEmpty()) {
+ String[] directs = direction.split(",");
+ for (String direct : directs) {
+ String[] parts = direct.trim().split("->");
+ if (parts.length == 2) {
+ directionRules.add(new Direction(parts[0].trim(), parts[1].trim()));
+ }
+ }
+ }
+ }
+ }
+ return directionRules;
+ }
+
+ @SuppressWarnings("unchecked")
+ public Map getSettingsMap(){
+ if (settingsMap.isEmpty() && StringUtils.isNotBlank(settings)){
+ synchronized (settingsMap){
+ if (settingsMap.isEmpty()){
+ try {
+ settingsMap.putAll(JsonUtils.jackson().reader().readValue(settings, Map.class));
+ }catch(Exception e){
+ // Ignore
+ LOG.warn("Fail to load engine settings properties", e);
+ }
+ }
+ }
+ }
+ return settingsMap;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public String getSettings() {
+ return settings;
+ }
+
+ public void setSettings(String settings) {
+ this.settings = settings;
+ }
+
+ public String getDirection() {
+ return direction;
+ }
+
+ public void setDirection(String direction) {
+ this.direction = direction;
+ }
+
+ public String getResourceLoaderClass() {
+ return resourceLoaderClass;
+ }
+
+ public void setResourceLoaderClass(String resourceLoaderClass) {
+ this.resourceLoaderClass = resourceLoaderClass;
+ }
+
+ public String getResourceUploaderClass() {
+ return resourceUploaderClass;
+ }
+
+ public void setResourceUploaderClass(String resourceUploaderClass) {
+ this.resourceUploaderClass = resourceUploaderClass;
+ }
+
+
+ public static class Direction{
+ /**
+ * Source type
+ */
+ private final String source;
+
+ /**
+ * Sink type
+ */
+ private final String sink;
+
+ public Direction(String source, String sink){
+ this.source = source;
+ this.sink = sink;
+ }
+
+ public String getSource() {
+ return source;
+ }
+
+ public String getSink() {
+ return sink;
+ }
+ }
+}
diff --git a/exchangis-engines/exchangis-engine-common/src/main/java/com/webank/wedatasphere/exchangis/engine/domain/EngineStoreResource.java b/exchangis-engines/exchangis-engine-common/src/main/java/com/webank/wedatasphere/exchangis/engine/domain/EngineStoreResource.java
new file mode 100644
index 000000000..dd220d0ed
--- /dev/null
+++ b/exchangis-engines/exchangis-engine-common/src/main/java/com/webank/wedatasphere/exchangis/engine/domain/EngineStoreResource.java
@@ -0,0 +1,59 @@
+package com.webank.wedatasphere.exchangis.engine.domain;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.Calendar;
+import java.util.Objects;
+import java.util.Optional;
+
+/**
+ * Engine store into database
+ */
+public class EngineStoreResource extends EngineResource{
+
+ private String storeUri;
+
+ public EngineStoreResource(EngineResource engineResource){
+ this.engineType = engineResource.getEngineType();
+ this.name = engineResource.getName();
+ this.type = engineResource.getType();
+ this.path = engineResource.getPath();
+ this.createTime = Optional.ofNullable(engineResource.getCreateTime())
+ .orElse(Calendar.getInstance().getTime());
+ this.modifyTime = Optional.ofNullable(engineResource.getModifyTime())
+ .orElse(Calendar.getInstance().getTime());
+ this.creator = engineResource.getCreator();
+ try {
+ URI uri = engineResource.getURI();
+ if (Objects.nonNull(uri)){
+ this.storeUri = uri.toString();
+ }
+ } catch (Exception e){
+ // Ignore
+ }
+
+ }
+
+ public EngineStoreResource(){
+
+ }
+ @Override
+ public InputStream getInputStream() throws IOException {
+ throw new IllegalArgumentException("Unsupported method 'getInputStream()'");
+ }
+
+ @Override
+ public URI getURI() throws URISyntaxException {
+ throw new IllegalArgumentException("Unsupported method 'getURI()'");
+ }
+
+ public String getStoreUri() {
+ return storeUri;
+ }
+
+ public void setStoreUri(String storeUri) {
+ this.storeUri = storeUri;
+ }
+}
diff --git a/exchangis-engines/exchangis-engine-common/src/main/java/com/webank/wedatasphere/exchangis/engine/exception/ExchangisEngineExceptionCode.java b/exchangis-engines/exchangis-engine-common/src/main/java/com/webank/wedatasphere/exchangis/engine/exception/ExchangisEngineExceptionCode.java
new file mode 100644
index 000000000..db1b957f4
--- /dev/null
+++ b/exchangis-engines/exchangis-engine-common/src/main/java/com/webank/wedatasphere/exchangis/engine/exception/ExchangisEngineExceptionCode.java
@@ -0,0 +1,25 @@
+package com.webank.wedatasphere.exchangis.engine.exception;
+
+/**
+ * Exception code fo engine
+ * 32000 ~ 32999
+ */
+public enum ExchangisEngineExceptionCode {
+ RESOURCE_ERROR(32000),
+ RESOURCE_LOAD_ERROR(32001),
+ RESOURCE_UPLOAD_ERROR(32002);
+
+ private int code;
+
+ ExchangisEngineExceptionCode(int code) {
+ this.code = code;
+ }
+
+ public int getCode() {
+ return code;
+ }
+
+ public void setCode(int code) {
+ this.code = code;
+ }
+}
diff --git a/exchangis-engines/exchangis-engine-common/src/main/java/com/webank/wedatasphere/exchangis/engine/exception/ExchangisEngineResException.java b/exchangis-engines/exchangis-engine-common/src/main/java/com/webank/wedatasphere/exchangis/engine/exception/ExchangisEngineResException.java
new file mode 100644
index 000000000..c195cfd0f
--- /dev/null
+++ b/exchangis-engines/exchangis-engine-common/src/main/java/com/webank/wedatasphere/exchangis/engine/exception/ExchangisEngineResException.java
@@ -0,0 +1,19 @@
+package com.webank.wedatasphere.exchangis.engine.exception;
+
+import org.apache.linkis.common.exception.ErrorException;
+
+import static com.webank.wedatasphere.exchangis.engine.exception.ExchangisEngineExceptionCode.RESOURCE_ERROR;
+
+/**
+ * Engine resource exception
+ */
+public class ExchangisEngineResException extends ErrorException {
+ public ExchangisEngineResException(String desc) {
+ this(desc, null);
+ }
+
+ public ExchangisEngineResException(String desc, Throwable t){
+ super(RESOURCE_ERROR.getCode(), desc);
+ super.initCause(t);
+ }
+}
diff --git a/exchangis-engines/exchangis-engine-common/src/main/java/com/webank/wedatasphere/exchangis/engine/exception/ExchangisEngineResLoadException.java b/exchangis-engines/exchangis-engine-common/src/main/java/com/webank/wedatasphere/exchangis/engine/exception/ExchangisEngineResLoadException.java
new file mode 100644
index 000000000..afebd8911
--- /dev/null
+++ b/exchangis-engines/exchangis-engine-common/src/main/java/com/webank/wedatasphere/exchangis/engine/exception/ExchangisEngineResLoadException.java
@@ -0,0 +1,19 @@
+package com.webank.wedatasphere.exchangis.engine.exception;
+
+import static com.webank.wedatasphere.exchangis.engine.exception.ExchangisEngineExceptionCode.RESOURCE_LOAD_ERROR;
+
+/**
+ * Engine resource load exception
+ */
+public class ExchangisEngineResLoadException extends ExchangisEngineResException {
+
+
+ public ExchangisEngineResLoadException(String desc) {
+ super(desc);
+ }
+
+ public ExchangisEngineResLoadException(String desc, Throwable t) {
+ super(desc, t);
+ super.setErrCode(RESOURCE_LOAD_ERROR.getCode());
+ }
+}
diff --git a/exchangis-engines/exchangis-engine-common/src/main/java/com/webank/wedatasphere/exchangis/engine/exception/ExchangisEngineResUploadException.java b/exchangis-engines/exchangis-engine-common/src/main/java/com/webank/wedatasphere/exchangis/engine/exception/ExchangisEngineResUploadException.java
new file mode 100644
index 000000000..02e415d62
--- /dev/null
+++ b/exchangis-engines/exchangis-engine-common/src/main/java/com/webank/wedatasphere/exchangis/engine/exception/ExchangisEngineResUploadException.java
@@ -0,0 +1,17 @@
+package com.webank.wedatasphere.exchangis.engine.exception;
+
+import static com.webank.wedatasphere.exchangis.engine.exception.ExchangisEngineExceptionCode.RESOURCE_UPLOAD_ERROR;
+
+/**
+ * Engine resource upload exception
+ */
+public class ExchangisEngineResUploadException extends ExchangisEngineResException{
+ public ExchangisEngineResUploadException(String desc) {
+ super(desc);
+ }
+
+ public ExchangisEngineResUploadException(String desc, Throwable t) {
+ super(desc, t);
+ super.setErrCode(RESOURCE_UPLOAD_ERROR.getCode());
+ }
+}
diff --git a/exchangis-engines/exchangis-engine-core/pom.xml b/exchangis-engines/exchangis-engine-core/pom.xml
new file mode 100644
index 000000000..5d040b341
--- /dev/null
+++ b/exchangis-engines/exchangis-engine-core/pom.xml
@@ -0,0 +1,37 @@
+
+
+
+ exchangis-engines
+ com.webank.wedatasphere.exchangis
+ 1.1.2
+
+ 4.0.0
+
+ exchangis-engine-core
+
+
+ 8
+ 8
+
+
+
+
+ com.webank.wedatasphere.exchangis
+ exchangis-engine-common
+ ${exchangis.version}
+
+
+ com.webank.wedatasphere.exchangis
+ exchangis-dao
+ ${exchangis.version}
+
+
+
+ org.apache.linkis
+ linkis-bml-client
+ ${linkis.version}
+
+
+
\ No newline at end of file
diff --git a/exchangis-engines/exchangis-engine-core/src/main/java/com/webank/wedatasphere/exchangis/engine/ExchangisEngine.java b/exchangis-engines/exchangis-engine-core/src/main/java/com/webank/wedatasphere/exchangis/engine/ExchangisEngine.java
new file mode 100644
index 000000000..2902dbad8
--- /dev/null
+++ b/exchangis-engines/exchangis-engine-core/src/main/java/com/webank/wedatasphere/exchangis/engine/ExchangisEngine.java
@@ -0,0 +1,29 @@
+package com.webank.wedatasphere.exchangis.engine;
+
+import com.webank.wedatasphere.exchangis.engine.domain.EngineResource;
+import com.webank.wedatasphere.exchangis.engine.domain.EngineSettings;
+import com.webank.wedatasphere.exchangis.engine.resource.EngineResourceContainer;
+
+/**
+ * Exchangis engine
+ */
+public interface ExchangisEngine {
+
+ /**
+ * engine name
+ * @return
+ */
+ String getName();
+
+ /**
+ * Settings
+ * @return settings
+ */
+ EngineSettings getSettings();
+
+ /**
+ * Resource container
+ * @return container
+ */
+ EngineResourceContainer getResourceContainer();
+}
diff --git a/exchangis-engines/exchangis-engine-core/src/main/java/com/webank/wedatasphere/exchangis/engine/GenericExchangisEngine.java b/exchangis-engines/exchangis-engine-core/src/main/java/com/webank/wedatasphere/exchangis/engine/GenericExchangisEngine.java
new file mode 100644
index 000000000..190934005
--- /dev/null
+++ b/exchangis-engines/exchangis-engine-core/src/main/java/com/webank/wedatasphere/exchangis/engine/GenericExchangisEngine.java
@@ -0,0 +1,46 @@
+package com.webank.wedatasphere.exchangis.engine;
+
+import com.webank.wedatasphere.exchangis.engine.domain.EngineResource;
+import com.webank.wedatasphere.exchangis.engine.domain.EngineSettings;
+import com.webank.wedatasphere.exchangis.engine.resource.EngineResourceContainer;
+
+import java.util.Objects;
+
+/**
+ * Generic implement
+ */
+public class GenericExchangisEngine implements ExchangisEngine{
+
+ @Override
+ public String getName() {
+ return Objects.nonNull(settings) ? settings.getName(): null;
+ }
+
+ /**
+ * Settings
+ */
+ private EngineSettings settings;
+
+ /**
+ * Resource container
+ */
+ private EngineResourceContainer, ?> resourceContainer;
+
+ public EngineSettings getSettings() {
+ return settings;
+ }
+
+ public void setSettings(EngineSettings settings) {
+ this.settings = settings;
+ }
+
+ @SuppressWarnings("unchecked")
+ public EngineResourceContainer getResourceContainer() {
+ return (EngineResourceContainer) resourceContainer;
+ }
+
+ public void setResourceContainer(EngineResourceContainer, ?> resourceContainer) {
+ this.resourceContainer = resourceContainer;
+ }
+
+}
diff --git a/exchangis-engines/exchangis-engine-core/src/main/java/com/webank/wedatasphere/exchangis/engine/dao/EngineResourceDao.java b/exchangis-engines/exchangis-engine-core/src/main/java/com/webank/wedatasphere/exchangis/engine/dao/EngineResourceDao.java
new file mode 100644
index 000000000..bc0b006b9
--- /dev/null
+++ b/exchangis-engines/exchangis-engine-core/src/main/java/com/webank/wedatasphere/exchangis/engine/dao/EngineResourceDao.java
@@ -0,0 +1,30 @@
+package com.webank.wedatasphere.exchangis.engine.dao;
+
+import com.webank.wedatasphere.exchangis.engine.domain.EngineStoreResource;
+
+import java.util.List;
+
+/**
+ * Engine resource dao
+ */
+public interface EngineResourceDao {
+
+ /**
+ * Get resources by engine type
+ * @param engineType engine type
+ * @return store resource
+ */
+ List getResources(String engineType);
+
+ /**
+ * Insert Resource
+ * @param storeResource store resource
+ */
+ void insertResource(EngineStoreResource storeResource);
+
+ /**
+ * Update resource
+ * @param storeResource store resource
+ */
+ void updateResource(EngineStoreResource storeResource);
+}
diff --git a/exchangis-engines/exchangis-engine-core/src/main/java/com/webank/wedatasphere/exchangis/engine/dao/EngineSettingsDao.java b/exchangis-engines/exchangis-engine-core/src/main/java/com/webank/wedatasphere/exchangis/engine/dao/EngineSettingsDao.java
new file mode 100644
index 000000000..8ac429feb
--- /dev/null
+++ b/exchangis-engines/exchangis-engine-core/src/main/java/com/webank/wedatasphere/exchangis/engine/dao/EngineSettingsDao.java
@@ -0,0 +1,16 @@
+package com.webank.wedatasphere.exchangis.engine.dao;
+
+import com.webank.wedatasphere.exchangis.engine.domain.EngineSettings;
+
+import java.util.List;
+
+/**
+ * Engine settings dao
+ */
+public interface EngineSettingsDao {
+ /**
+ * Settings
+ * @return list
+ */
+ List getSettings();
+}
diff --git a/exchangis-engines/exchangis-engine-core/src/main/java/com/webank/wedatasphere/exchangis/engine/manager/DefaultExchangisEngineManager.java b/exchangis-engines/exchangis-engine-core/src/main/java/com/webank/wedatasphere/exchangis/engine/manager/DefaultExchangisEngineManager.java
new file mode 100644
index 000000000..5a2cd179b
--- /dev/null
+++ b/exchangis-engines/exchangis-engine-core/src/main/java/com/webank/wedatasphere/exchangis/engine/manager/DefaultExchangisEngineManager.java
@@ -0,0 +1,34 @@
+package com.webank.wedatasphere.exchangis.engine.manager;
+
+import com.webank.wedatasphere.exchangis.engine.ExchangisEngine;
+import com.webank.wedatasphere.exchangis.engine.GenericExchangisEngine;
+import com.webank.wedatasphere.exchangis.engine.domain.EngineResource;
+import com.webank.wedatasphere.exchangis.engine.domain.EngineSettings;
+import com.webank.wedatasphere.exchangis.engine.resource.EngineResourceContainer;
+
+import java.util.HashMap;
+import java.util.Map;
+
+
+/**
+ * Default Engine manager
+ */
+public class DefaultExchangisEngineManager implements ExchangisEngineManager {
+
+ private static final ExchangisEngine EMPTY_ENGINE = new GenericExchangisEngine();
+ /**
+ * Engine context
+ */
+ protected Map engineContextMap = new HashMap<>();
+ @Override
+ public EngineSettings getSettings(String engine) {
+ return engineContextMap.getOrDefault(engine, EMPTY_ENGINE).getSettings();
+ }
+
+ @Override
+ @SuppressWarnings("unchecked")
+ public EngineResourceContainer getResourceContainer(String engine) {
+ return (EngineResourceContainer)
+ engineContextMap.getOrDefault(engine, EMPTY_ENGINE).getResourceContainer();
+ }
+}
diff --git a/exchangis-engines/exchangis-engine-core/src/main/java/com/webank/wedatasphere/exchangis/engine/manager/ExchangisEngineManager.java b/exchangis-engines/exchangis-engine-core/src/main/java/com/webank/wedatasphere/exchangis/engine/manager/ExchangisEngineManager.java
new file mode 100644
index 000000000..907bb669a
--- /dev/null
+++ b/exchangis-engines/exchangis-engine-core/src/main/java/com/webank/wedatasphere/exchangis/engine/manager/ExchangisEngineManager.java
@@ -0,0 +1,27 @@
+package com.webank.wedatasphere.exchangis.engine.manager;
+
+import com.webank.wedatasphere.exchangis.engine.domain.EngineResource;
+import com.webank.wedatasphere.exchangis.engine.domain.EngineSettings;
+import com.webank.wedatasphere.exchangis.engine.resource.EngineResourceContainer;
+
+/**
+ * Engine manager
+ */
+public interface ExchangisEngineManager {
+
+ /**
+ *
+ * @param engine engine
+ * @return
+ */
+ EngineSettings getSettings(String engine);
+
+ /**
+ * Get engine resource container
+ * @param engine engine
+ * @param
+ * @param
+ * @return
+ */
+ EngineResourceContainer getResourceContainer(String engine);
+}
diff --git a/exchangis-engines/exchangis-engine-core/src/main/java/com/webank/wedatasphere/exchangis/engine/provider/ExchangisEngineProvider.java b/exchangis-engines/exchangis-engine-core/src/main/java/com/webank/wedatasphere/exchangis/engine/provider/ExchangisEngineProvider.java
new file mode 100644
index 000000000..2dc4f7fb5
--- /dev/null
+++ b/exchangis-engines/exchangis-engine-core/src/main/java/com/webank/wedatasphere/exchangis/engine/provider/ExchangisEngineProvider.java
@@ -0,0 +1,11 @@
+package com.webank.wedatasphere.exchangis.engine.provider;
+
+import com.webank.wedatasphere.exchangis.engine.ExchangisEngine;
+
+import java.util.Map;
+
+public interface ExchangisEngineProvider {
+
+
+ ExchangisEngine getEngines(Map params);
+}
diff --git a/exchangis-engines/exchangis-engine-core/src/main/java/com/webank/wedatasphere/exchangis/engine/resource/AbstractEngineResourceContainer.java b/exchangis-engines/exchangis-engine-core/src/main/java/com/webank/wedatasphere/exchangis/engine/resource/AbstractEngineResourceContainer.java
new file mode 100644
index 000000000..b7994bac4
--- /dev/null
+++ b/exchangis-engines/exchangis-engine-core/src/main/java/com/webank/wedatasphere/exchangis/engine/resource/AbstractEngineResourceContainer.java
@@ -0,0 +1,394 @@
+package com.webank.wedatasphere.exchangis.engine.resource;
+
+import com.webank.wedatasphere.exchangis.engine.config.ExchangisEngineConfiguration;
+import com.webank.wedatasphere.exchangis.engine.dao.EngineResourceDao;
+import com.webank.wedatasphere.exchangis.engine.domain.EngineResource;
+import com.webank.wedatasphere.exchangis.engine.domain.EngineStoreResource;
+import com.webank.wedatasphere.exchangis.engine.exception.ExchangisEngineResException;
+import com.webank.wedatasphere.exchangis.engine.utils.ResourceUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.File;
+import java.net.URI;
+import java.util.*;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.atomic.AtomicLong;
+import java.util.concurrent.locks.ReentrantReadWriteLock;
+import java.util.function.Consumer;
+
+/**
+ * Abstract engine resource container
+ */
+public abstract class AbstractEngineResourceContainer implements EngineResourceContainer {
+
+ private static final Logger LOG = LoggerFactory.getLogger(AbstractEngineResourceContainer.class);
+
+ /**
+ * Resource root uri
+ */
+ protected final URI rootUri;
+ /**
+ * Engine type
+ */
+ private final String engineType;
+
+ /**
+ * Resource dao
+ */
+ protected final EngineResourceDao engineResourceDao;
+
+ /**
+ * Resource loader in container
+ */
+ protected final EngineResourceLoader engineResourceLoader;
+
+ /**
+ * Resource uploader in container
+ */
+ protected final EngineResourceUploader engineResourceUploader;
+
+ /**
+ * Root node
+ */
+ private final ResourcePathNode rootNode = new ResourcePathNode("/");
+
+ public AbstractEngineResourceContainer(String engineType, String rootPath, EngineResourceDao resourceDao,
+ EngineResourceLoader resourceLoader,
+ EngineResourceUploader resourceUploader){
+ this.engineType = engineType;
+ this.rootUri = new File(ResourceUtils.normalizeFilePath(rootPath)).toURI();
+ this.engineResourceDao = resourceDao;
+ this.engineResourceLoader = resourceLoader;
+ this.engineResourceUploader = resourceUploader;
+ }
+
+ @Override
+ public String getEngineType() {
+ return engineType;
+ }
+
+ @Override
+ public List getResources(String resourcePath) {
+ String[] paths = pathSplit(resourcePath);
+ if (Objects.nonNull(paths)){
+ ResourcePathNode pathNode = searchResPathNode(paths);
+ if (Objects.nonNull(pathNode)){
+ return pathNode.getSubEngineResources();
+ }
+ }
+ return null;
+ }
+
+ @Override
+ public void addResource(String resourcePath, T engineResource) {
+ String[] paths = pathSplit(resourcePath);
+ if (Objects.nonNull(paths)){
+ operateResPathNode(paths, pathNode -> pathNode.addSubEngineResource(engineResource));
+ }
+ }
+
+ @Override
+ public void updateResources(String resourcePath, T[] engineResources) {
+ String[] paths = pathSplit(resourcePath);
+ if (Objects.nonNull(paths)){
+ ResourcePathNode pathNode = searchResPathNode(paths);
+ if (Objects.nonNull(pathNode)){
+ pathNode.updateSubEngineResource(engineResources);
+ }
+ }
+ }
+
+ @Override
+ public T getResource(String resourcePath, String resourceId) {
+ String[] paths = pathSplit(resourcePath);
+ if (Objects.nonNull(paths)){
+ ResourcePathNode pathNode = searchResPathNode(paths);
+ if (Objects.nonNull(pathNode)){
+ return pathNode.getSubEngineResource(resourceId);
+ }
+ }
+ return null;
+ }
+
+ @Override
+ public void flushResources(String resourcePath) throws ExchangisEngineResException{
+ String[] paths = pathSplit(resourcePath);
+ if (Objects.nonNull(paths)){
+ flushResources(searchResPathNode(paths));
+ }
+ }
+
+ @Override
+ public void flushAllResources() throws ExchangisEngineResException{
+ Queue queue = new LinkedList<>();
+ queue.offer(this.rootNode);
+ while(!queue.isEmpty()){
+ ResourcePathNode currentNode = queue.poll();
+ if (currentNode.hasSubEngineResources()){
+ flushResources(currentNode);
+ }
+ currentNode.childNodes.values().forEach(queue::offer);
+ }
+ }
+
+ @Override
+ public U getRemoteResource(String resourcePath) {
+ String[] paths = pathSplit(resourcePath);
+ if (Objects.nonNull(paths)){
+ ResourcePathNode pathNode = searchResPathNode(paths);
+ if (Objects.nonNull(pathNode)){
+ return pathNode.getRemoteResource();
+ }
+ }
+ return null;
+ }
+
+ @Override
+ public void removeResource(String resourcePath, String resourceId) {
+ String[] paths = pathSplit(resourcePath);
+ if (Objects.nonNull(paths)){
+ ResourcePathNode pathNode = searchResPathNode(paths);
+ if (Objects.nonNull(pathNode)){
+ pathNode.removeSubEngineResource(resourceId);
+ }
+ }
+ }
+
+ @Override
+ public EngineResourceLoader getResourceLoader() {
+ return engineResourceLoader;
+ }
+
+ @Override
+ public EngineResourceUploader getResourceUploader() {
+ return engineResourceUploader;
+ }
+
+ protected void operateResPathNode(String[] paths, Consumer operate){
+ operateResPathNode(null, paths, 0, operate);
+ }
+
+ protected ResourcePathNode searchResPathNode(String[] paths){
+ return searchResPathNode(null, paths, 0);
+ }
+ /**
+ * Operate resource path node
+ * @param parentNode parent node
+ * @param paths paths
+ * @param pos pos
+ * @param operate operate function
+ */
+ private void operateResPathNode(ResourcePathNode parentNode, String[] paths, int pos,
+ Consumer operate){
+ int upper = Math.min(pos + 1, paths.length);
+ String[] subPath = new String[upper];
+ System.arraycopy(paths, 0, subPath, 0, upper);
+ // path
+ String path = subPath.length <= 1 ? "/" : StringUtils.join(subPath, "/");
+ ResourcePathNode currentNode;
+ if (null == parentNode){
+ if (path.equals("/")) {
+ currentNode = this.rootNode;
+ } else {
+ LOG.warn("Path: {} should start with '/'", StringUtils.join(paths, "/"));
+ return;
+ }
+ } else {
+ currentNode = parentNode.childNodes.computeIfAbsent(path, ResourcePathNode::new);
+ }
+ if (upper >= paths.length){
+ operate.accept(currentNode);
+ } else {
+ operateResPathNode(currentNode, paths, pos + 1, operate);
+ }
+ }
+
+ /**
+ * Search resource path node
+ * @param parentNode parent node
+ * @param paths paths
+ * @param pos pos
+ * @return resource path node
+ */
+ private ResourcePathNode searchResPathNode(ResourcePathNode parentNode, String[] paths, int pos){
+ int upper = Math.min(pos + 1, paths.length);
+ String[] subPath = new String[upper];
+ System.arraycopy(paths, 0, subPath, 0, upper);
+ // path
+ String path = subPath.length <= 1 ? "/" : StringUtils.join(subPath, "/");
+ ResourcePathNode currentNode;
+ if (null == parentNode){
+ if (path.equals("/")) {
+ currentNode = this.rootNode;
+ } else {
+ LOG.warn("Path: {} should start with '/'", StringUtils.join(paths, "/"));
+ return null;
+ }
+ } else {
+ currentNode = parentNode.childNodes.get(path);
+ }
+ if (upper >= paths.length || Objects.isNull(currentNode)){
+ return currentNode;
+ }
+ return searchResPathNode(currentNode, paths, pos + 1);
+ }
+
+ private void flushResources(ResourcePathNode pathNode) throws ExchangisEngineResException {
+ if(Objects.nonNull(pathNode)){
+ LOG.info("Flush the {} engine resources in path: [{}]", getEngineType(), pathNode.getPath());
+ T nodeEngineRes = mergeNodeEngineResource(pathNode);
+ if (Objects.nonNull(nodeEngineRes)){
+ // Mark the resource under the path
+ nodeEngineRes.setPath(pathNode.path);
+ // Try tp upload the node engine resource
+ try {
+ U uploadedRes = this.engineResourceUploader.upload(nodeEngineRes, pathNode.getRemoteResource());
+ if (Objects.nonNull(uploadedRes)) {
+ // Store the uploaded remoted resource information
+ if (Objects.nonNull(pathNode.getRemoteResource())) {
+ this.engineResourceDao.updateResource(new EngineStoreResource(uploadedRes));
+ } else {
+ this.engineResourceDao.insertResource(new EngineStoreResource(uploadedRes));
+ }
+ pathNode.setRemoteResource(uploadedRes);
+ }
+ }catch(Exception e){
+ // Not throw
+ LOG.warn(null, e);
+ }
+ }
+ }
+ }
+ protected String[] pathSplit(String path){
+ return path == null ? null : path.split("/");
+ }
+
+ /**
+ * Merge the engine resources in path node
+ * @param pathNode path node
+ * @return
+ */
+ protected abstract T mergeNodeEngineResource(ResourcePathNode pathNode);
+ /**
+ * Resource path node (in tree)
+ */
+ protected class ResourcePathNode{
+
+ /**
+ * Resource path
+ */
+ protected final String path;
+ /**
+ * Node lock
+ */
+ protected final ReentrantReadWriteLock nodeLock;
+
+ /**
+ * Modify time
+ */
+ protected long lastModifyTime = -1;
+
+ /**
+ * Resource in data
+ */
+ protected final Map subResources = new HashMap<>();
+
+ /**
+ * Remote resource
+ */
+ protected U remoteResource;
+
+ /**
+ * Children nodes
+ */
+ protected Map childNodes = new ConcurrentHashMap<>();
+
+ public ResourcePathNode(String path){
+ this.path = path;
+ this.nodeLock = new ReentrantReadWriteLock();
+ this.lastModifyTime = 0L;
+ }
+
+ public void updateSubEngineResource(T[] engineResources){
+ nodeLock.writeLock().lock();
+ try{
+ subResources.clear();
+ if (Objects.nonNull(engineResources)){
+ final AtomicLong modifyTime = new AtomicLong(0);
+ Arrays.asList(engineResources).forEach(engineResource -> {
+ Date resourceTime = engineResource.getModifyTime();
+ if (resourceTime.getTime() > modifyTime.get()){
+ modifyTime.set(resourceTime.getTime());
+ }
+ subResources.put(engineResource.getId(), engineResource);
+ });
+ this.lastModifyTime = modifyTime.get();
+ }
+ } finally {
+ nodeLock.writeLock().unlock();
+ }
+ }
+ public void addSubEngineResource(T engineResource){
+ nodeLock.writeLock().lock();
+ try{
+ subResources.put(engineResource.getId(), engineResource);
+ Date resourceTime = engineResource.getModifyTime();
+ if (resourceTime.getTime() > lastModifyTime){
+ this.lastModifyTime = resourceTime.getTime();
+ }
+ }finally {
+ nodeLock.writeLock().unlock();
+ }
+ }
+
+ public List getSubEngineResources(){
+ nodeLock.readLock().lock();
+ try{
+ List resources = new ArrayList<>();
+ subResources.forEach((key, resource) -> resources.add(resource));
+ return resources;
+ }finally {
+ nodeLock.readLock().unlock();
+ }
+ }
+ public boolean hasSubEngineResources(){
+ nodeLock.readLock().lock();
+ try{
+ return !subResources.isEmpty();
+ }finally {
+ nodeLock.readLock().unlock();
+ }
+ }
+ public T getSubEngineResource(String resourceId){
+ nodeLock.readLock().lock();
+ try{
+ return subResources.get(resourceId);
+ }finally {
+ nodeLock.readLock().unlock();
+ }
+ }
+
+ public EngineResource removeSubEngineResource(String resourceId){
+ nodeLock.writeLock().lock();
+ try{
+ return subResources.remove(resourceId);
+ }finally {
+ nodeLock.writeLock().unlock();
+ }
+ }
+ public U getRemoteResource(){
+ return remoteResource;
+ }
+
+ public void setRemoteResource(U engineResource){
+ this.remoteResource = engineResource;
+ }
+
+ public String getPath() {
+ return path;
+ }
+ }
+
+}
diff --git a/exchangis-engines/exchangis-engine-core/src/main/java/com/webank/wedatasphere/exchangis/engine/resource/AbstractEngineResourceLoader.java b/exchangis-engines/exchangis-engine-core/src/main/java/com/webank/wedatasphere/exchangis/engine/resource/AbstractEngineResourceLoader.java
new file mode 100644
index 000000000..2933c6453
--- /dev/null
+++ b/exchangis-engines/exchangis-engine-core/src/main/java/com/webank/wedatasphere/exchangis/engine/resource/AbstractEngineResourceLoader.java
@@ -0,0 +1,22 @@
+package com.webank.wedatasphere.exchangis.engine.resource;
+
+import com.webank.wedatasphere.exchangis.engine.domain.EngineResource;
+import com.webank.wedatasphere.exchangis.engine.resource.uri.ResourceURLStreamHandlerFactory;
+import org.apache.linkis.common.conf.CommonVars;
+
+import java.net.URL;
+
+/**
+ * Abstract resource loader
+ * @param
+ */
+public abstract class AbstractEngineResourceLoader implements EngineResourceLoader{
+ /**
+ * Support schemes for uri
+ */
+ private static final CommonVars SUPPORT_SCHEMES = CommonVars.apply("wds.exchangis.engine.resource.schemes", "bml,hdfs,viewfs");
+ static{
+ URL.setURLStreamHandlerFactory(new ResourceURLStreamHandlerFactory(
+ SUPPORT_SCHEMES.getValue().split(",")));
+ }
+}
diff --git a/exchangis-engines/exchangis-engine-core/src/main/java/com/webank/wedatasphere/exchangis/engine/resource/DefaultEngineResourceContainer.java b/exchangis-engines/exchangis-engine-core/src/main/java/com/webank/wedatasphere/exchangis/engine/resource/DefaultEngineResourceContainer.java
new file mode 100644
index 000000000..07117fd5b
--- /dev/null
+++ b/exchangis-engines/exchangis-engine-core/src/main/java/com/webank/wedatasphere/exchangis/engine/resource/DefaultEngineResourceContainer.java
@@ -0,0 +1,107 @@
+package com.webank.wedatasphere.exchangis.engine.resource;
+
+import com.webank.wedatasphere.exchangis.engine.config.ExchangisEngineConfiguration;
+import com.webank.wedatasphere.exchangis.engine.dao.EngineResourceDao;
+import com.webank.wedatasphere.exchangis.engine.domain.EngineBmlResource;
+import com.webank.wedatasphere.exchangis.engine.domain.EngineLocalPathResource;
+import com.webank.wedatasphere.exchangis.engine.domain.EngineResource;
+import com.webank.wedatasphere.exchangis.engine.domain.EngineStoreResource;
+import com.webank.wedatasphere.exchangis.engine.utils.ResourceUtils;
+import org.apache.commons.io.IOUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.util.List;
+import java.util.Objects;
+import java.util.UUID;
+import java.util.concurrent.locks.ReentrantReadWriteLock;
+import java.util.stream.Collectors;
+
+public class DefaultEngineResourceContainer extends AbstractEngineResourceContainer {
+
+ private static final Logger LOG = LoggerFactory.getLogger(DefaultEngineResourceContainer.class);
+
+ public DefaultEngineResourceContainer(String engineType, String rootPath, EngineResourceDao resourceDao,
+ EngineResourceLoader resourceLoader,
+ EngineResourceUploader resourceUploader) {
+ super(engineType, rootPath, resourceDao, resourceLoader, resourceUploader);
+ }
+
+ @Override
+ public void init() {
+ List storeResources = this.engineResourceDao.getResources(getEngineType());
+ storeResources.forEach(storeResource -> {
+ String path = storeResource.getPath();
+ if (StringUtils.isNotBlank(path)){
+ operateResPathNode(pathSplit(path), resourcePathNode ->
+ resourcePathNode.setRemoteResource(new EngineBmlResource(storeResource)));
+ }
+ });
+ }
+ /**
+ *
+ * @param pathNode resource path node
+ * @return engine resource
+ */
+ protected EngineLocalPathResource mergeNodeEngineResource(ResourcePathNode pathNode){
+ if (Objects.isNull(pathNode.getRemoteResource()) || pathNode.getRemoteResource()
+ .getModifyTime().getTime() < pathNode.lastModifyTime) {
+ ReentrantReadWriteLock nodeLock = pathNode.nodeLock;
+ List resourcesFiltered;
+ nodeLock.readLock().lock();
+ try {
+ resourcesFiltered = pathNode.subResources.values().stream().filter(Objects::nonNull)
+ .collect(Collectors.toList());
+ }finally {
+ nodeLock.readLock().unlock();
+ }
+ if (resourcesFiltered.size() == 1 && resourcesFiltered.get(0).isPacket()){
+ //Ignore the packet resource
+ return resourcesFiltered.get(0);
+ }
+ // Merged resource is a local resource, its name is equal to the path in pathNode
+ String mergedResourcePath;
+ boolean temp = false;
+ if (ExchangisEngineConfiguration.ENGINE_RESOURCE_MERGE_LOCAL.getValue()) {
+ // Need to store the merged resource into local path
+ String rootPath = rootUri.getPath();
+ mergedResourcePath = (rootPath.endsWith(IOUtils.DIR_SEPARATOR + "")? rootPath : rootPath + IOUtils.DIR_SEPARATOR )
+ + pathNode.getPath() + ExchangisEngineConfiguration.ENGINE_RESOURCE_PACKET_SUFFIX.getValue();
+ } else {
+ File temporaryPath = new File(ExchangisEngineConfiguration.ENGINE_RESOURCE_TMP_PATH.getValue());
+ if (temporaryPath.mkdir()) {
+ LOG.info("Auto create the engine temporary directory [{}]", temporaryPath.getAbsolutePath());
+ }
+ mergedResourcePath = temporaryPath.getAbsolutePath() + IOUtils.DIR_SEPARATOR + UUID.randomUUID();
+ temp = true;
+ }
+ synchronized ((getEngineType() + ":" + pathNode.getPath()).intern()){
+ // 1. DELETE the exists local resource
+ File resourceFile = new File(mergedResourcePath);
+ if (resourceFile.exists()){
+ if (resourceFile.delete()){
+ LOG.info("Success to delete the existed local resource file [{}] before", resourceFile.getPath());
+ }else {
+ LOG.warn("Fail to delete the existed local resource file [{}], please examine the file permissions or occupation from the other program!", resourceFile.getPath());
+ }
+ }
+ try {
+ if (resourceFile.createNewFile()) {
+ ResourceUtils.combinePacket(resourcesFiltered.stream().toArray(value -> new EngineResource[resourcesFiltered.size()]), new FileOutputStream(resourceFile));
+ if (temp) {
+ resourceFile.deleteOnExit();
+ }
+ return new EngineLocalPathResource(getEngineType(), rootUri, pathNode.getPath() + ExchangisEngineConfiguration.ENGINE_RESOURCE_PACKET_SUFFIX.getValue());
+ }
+ } catch (IOException e) {
+ LOG.warn("Exception in combing and packet resources in [{}]", pathNode.getPath(), e);
+ }
+ }
+ }
+ return null;
+ }
+}
diff --git a/exchangis-engines/exchangis-engine-core/src/main/java/com/webank/wedatasphere/exchangis/engine/resource/DefaultEngineResourcePathScanner.java b/exchangis-engines/exchangis-engine-core/src/main/java/com/webank/wedatasphere/exchangis/engine/resource/DefaultEngineResourcePathScanner.java
new file mode 100644
index 000000000..3cd53a1c0
--- /dev/null
+++ b/exchangis-engines/exchangis-engine-core/src/main/java/com/webank/wedatasphere/exchangis/engine/resource/DefaultEngineResourcePathScanner.java
@@ -0,0 +1,139 @@
+package com.webank.wedatasphere.exchangis.engine.resource;
+
+import com.webank.wedatasphere.exchangis.engine.config.ExchangisEngineConfiguration;
+import com.webank.wedatasphere.exchangis.engine.domain.EngineLocalPathResource;
+import com.webank.wedatasphere.exchangis.engine.domain.EngineResource;
+import com.webank.wedatasphere.exchangis.engine.exception.ExchangisEngineResException;
+import com.webank.wedatasphere.exchangis.engine.exception.ExchangisEngineResLoadException;
+import com.webank.wedatasphere.exchangis.engine.utils.ResourceUtils;
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.io.FilenameUtils;
+import org.apache.commons.io.IOUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.File;
+import java.io.FilenameFilter;
+import java.net.URI;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.util.*;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.function.BiFunction;
+import java.util.function.Function;
+import java.util.stream.Collectors;
+
+/**
+ * Default path scanner
+ */
+public class DefaultEngineResourcePathScanner implements EngineResourcePathScanner{
+
+ private static final Logger LOG = LoggerFactory.getLogger(DefaultEngineResourcePathScanner.class);
+ /**
+ * Resource loader list
+ */
+ private final Map> resourceLoaders = new ConcurrentHashMap<>();
+
+ @Override
+ public void registerResourceLoader(EngineResourceLoader extends EngineLocalPathResource> resourceLoader) {
+ LOG.info("Register the resource loader: '{}'", resourceLoader.getClass().getCanonicalName());
+ this.resourceLoaders.put(resourceLoader.engineType(), resourceLoader);
+ }
+
+ @Override
+ public Set doScan(String rootPath) throws ExchangisEngineResException {
+ rootPath = FilenameUtils.normalize(rootPath);
+ File rootFile = new File(rootPath);
+ List resources = new ArrayList<>();
+ if (!rootFile.exists()){
+ throw new ExchangisEngineResLoadException("The engine resource root path: [" + rootPath +"] doesn't exist");
+ }
+ if (rootFile.isFile()){
+ throw new ExchangisEngineResLoadException("The engine resource root path: [" + rootPath + "] should be a directory/link, but not a file");
+ } else {
+ LOG.info("Start to scan the resource root path: [{}]", rootPath);
+ resourceLoaders.forEach((engine, resourceLoader) ->{
+ File engineFile = new File(rootFile, engine.toLowerCase());
+ if (engineFile.exists() && engineFile.isDirectory()){
+ LOG.info("Scan the resource path for engine: [{}] in [{}]", engine.toLowerCase(), engineFile.getPath());
+ resources.addAll(scanPathAndLoadResource(rootFile.toURI(),
+ IOUtils.DIR_SEPARATOR + engineFile.getName(), (baseUri, path) -> resourceLoader.accept(baseUri, path)? resourceLoader : null));
+ } else {
+ LOG.warn("Cannot find the resource path for engine: [{}] in [{}], ignore it.", engine.toLowerCase(), engineFile.getPath());
+ }
+ });
+ }
+ return new HashSet<>(resources);
+ }
+
+
+ private List scanPathAndLoadResource(URI baseUri, String path,
+ BiFunction> getResLoader) {
+ List resources = new ArrayList<>();
+ File rootFile = new File(baseUri.getPath(), path);
+ if (rootFile.isDirectory()) {
+ File[] childFiles = rootFile.listFiles((dir, name) -> {
+ // skip the hidden file
+ return !name.startsWith(".");
+ });
+ if (Objects.nonNull(childFiles)) {
+ List scanDirs = new ArrayList<>();
+ List skipNames = new ArrayList<>();
+ List directories = Arrays.stream(childFiles)
+ .filter(File::isDirectory).collect(Collectors.toList());
+ directories.forEach(dir -> {
+ try {
+ String dirPath = path + IOUtils.DIR_SEPARATOR + dir.getName();
+ EngineResourceLoader extends EngineLocalPathResource> resourceLoader
+ = getResLoader.apply(baseUri, dirPath);
+ if (Objects.nonNull(resourceLoader)) {
+ resources.addAll(Arrays.asList(resourceLoader.loadResource(baseUri, dirPath)));
+ skipNames.add(dir.getName());
+ } else {
+ scanDirs.add(dir);
+ }
+ } catch (Exception e) {
+ LOG.warn("Exception in loading engine directory resource: [" + dir.getPath() + "]", e);
+ }
+ });
+ List rawFiles = Arrays.stream(childFiles).filter(file ->
+ file.isFile() && skipNames.stream().noneMatch(skipName ->
+ file.getName().equals(skipName + ExchangisEngineConfiguration.ENGINE_RESOURCE_PACKET_SUFFIX.getValue())))
+ .collect(Collectors.toList());
+ rawFiles.forEach(rawFile -> {
+ try {
+ String rawFilePath = path + IOUtils.DIR_SEPARATOR + rawFile.getName();
+ EngineResourceLoader extends EngineLocalPathResource> resourceLoader =
+ getResLoader.apply(baseUri, rawFilePath);
+ if (Objects.nonNull(resourceLoader)){
+ EngineLocalPathResource[] resArray = resourceLoader.loadResource(baseUri, rawFilePath);
+ if (resArray.length == 1 && rawFile.getName()
+ .endsWith(ExchangisEngineConfiguration.ENGINE_RESOURCE_PACKET_SUFFIX.getValue())) {
+ LOG.info("Mark the engine resource: [{}] as a packet({}) resource", rawFile.getPath(),
+ ExchangisEngineConfiguration.ENGINE_RESOURCE_PACKET_SUFFIX.getValue());
+ resArray[0].setPacket(true);
+ Path source = rawFile.toPath();
+ Path dest = source.resolveSibling(StringUtils.substringBefore(rawFile.getName(), "."));
+ if (!Files.isDirectory(dest)) {
+ Files.createDirectory(dest);
+ }
+ LOG.info("Un packet the engine resource: [{}] to [{}]", source, dest);
+ ResourceUtils.unPacket(source, dest);
+ // Update the path value
+ resArray[0].setPath(StringUtils.substringBeforeLast(rawFilePath, "."));
+ }
+ resources.addAll(Arrays.asList(resArray));
+ }
+ } catch (Exception e){
+ LOG.warn("Exception in loading engine file resource: [" + rawFile.getPath() + "]", e);
+ }
+ });
+ for(File scanDir : scanDirs) {
+ resources.addAll(scanPathAndLoadResource(baseUri, path + IOUtils.DIR_SEPARATOR + scanDir.getName(), getResLoader));
+ }
+ }
+ }
+ return resources;
+ }
+}
diff --git a/exchangis-engines/exchangis-engine-core/src/main/java/com/webank/wedatasphere/exchangis/engine/resource/EngineResourceContainer.java b/exchangis-engines/exchangis-engine-core/src/main/java/com/webank/wedatasphere/exchangis/engine/resource/EngineResourceContainer.java
new file mode 100644
index 000000000..c698f3450
--- /dev/null
+++ b/exchangis-engines/exchangis-engine-core/src/main/java/com/webank/wedatasphere/exchangis/engine/resource/EngineResourceContainer.java
@@ -0,0 +1,89 @@
+package com.webank.wedatasphere.exchangis.engine.resource;
+
+import com.webank.wedatasphere.exchangis.engine.domain.EngineResource;
+import com.webank.wedatasphere.exchangis.engine.exception.ExchangisEngineResException;
+
+import java.util.List;
+
+/**
+ * Resource container
+ */
+public interface EngineResourceContainer {
+
+ /**
+ * Engine type related
+ * @return string
+ */
+ String getEngineType();
+
+ /**
+ * Init method
+ */
+ void init();
+ /**
+ * Get existed engine resources from resource path
+ * @param resourcePath resource path
+ * @return engine resources
+ */
+ List getResources(String resourcePath);
+
+ /**
+ * Add resource to path in container
+ * @param resourcePath resource path
+ * @param engineResource engine resource
+ */
+ void addResource(String resourcePath, T engineResource);
+
+ /**
+ * Update resource
+ * @param resourcePath resource path
+ * @param engineResource engine resource
+ * @return resource list
+ */
+ void updateResources(String resourcePath, T[] engineResource);
+
+ /**
+ * Get resource by path and id
+ * @param resourcePath resource path
+ * @param resourceId resource id
+ * @return engine
+ */
+ T getResource(String resourcePath, String resourceId);
+
+ /**
+ * Flush(upload) resources in path
+ * @param resourcePath resource path
+ * @return (merged)resource
+ */
+ void flushResources(String resourcePath) throws ExchangisEngineResException;
+
+ /**
+ * Flush(upload) all the resources in container
+ */
+ void flushAllResources() throws ExchangisEngineResException;
+
+ /**
+ * Get remote(upload) resource in path
+ * @param resourcePath resource path
+ * @return (merged)resource
+ */
+ U getRemoteResource(String resourcePath);
+ /**
+ * Remove resource
+ * @param resourcePath resource path
+ * @param resourceId resource id
+ */
+ void removeResource(String resourcePath, String resourceId);
+
+ /**
+ * Engine resource loader
+ * @return scanner
+ */
+ EngineResourceLoader getResourceLoader();
+
+ /**
+ * Engine resource uploader
+ * @return resource uploader
+ */
+ EngineResourceUploader getResourceUploader();
+}
diff --git a/exchangis-engines/exchangis-engine-core/src/main/java/com/webank/wedatasphere/exchangis/engine/resource/EngineResourceLoader.java b/exchangis-engines/exchangis-engine-core/src/main/java/com/webank/wedatasphere/exchangis/engine/resource/EngineResourceLoader.java
new file mode 100644
index 000000000..dd5a74241
--- /dev/null
+++ b/exchangis-engines/exchangis-engine-core/src/main/java/com/webank/wedatasphere/exchangis/engine/resource/EngineResourceLoader.java
@@ -0,0 +1,31 @@
+package com.webank.wedatasphere.exchangis.engine.resource;
+
+import com.webank.wedatasphere.exchangis.engine.domain.EngineResource;
+import com.webank.wedatasphere.exchangis.engine.exception.ExchangisEngineResLoadException;
+
+import java.net.URI;
+
+/**
+ * Engine resource loader
+ * @param
+ */
+public interface EngineResourceLoader {
+ /**
+ * Engine type
+ * @return engine
+ */
+ String engineType();
+ /**
+ * Accept uri
+ * @param baseUri uri
+ * @return boolean
+ */
+ boolean accept(URI baseUri, String path);
+
+ /**
+ * Load resources from uri
+ * @param baseUri uri
+ * @return resource array
+ */
+ T[] loadResource(URI baseUri, String path) throws ExchangisEngineResLoadException;
+}
diff --git a/exchangis-engines/exchangis-engine-core/src/main/java/com/webank/wedatasphere/exchangis/engine/resource/EngineResourcePathScanner.java b/exchangis-engines/exchangis-engine-core/src/main/java/com/webank/wedatasphere/exchangis/engine/resource/EngineResourcePathScanner.java
new file mode 100644
index 000000000..1621abb7b
--- /dev/null
+++ b/exchangis-engines/exchangis-engine-core/src/main/java/com/webank/wedatasphere/exchangis/engine/resource/EngineResourcePathScanner.java
@@ -0,0 +1,23 @@
+package com.webank.wedatasphere.exchangis.engine.resource;
+
+import com.webank.wedatasphere.exchangis.engine.domain.EngineLocalPathResource;
+import com.webank.wedatasphere.exchangis.engine.exception.ExchangisEngineResException;
+
+import java.util.Set;
+
+/**
+ * Engine resource path scanner
+ */
+public interface EngineResourcePathScanner {
+
+ /**
+ * Register resource loader
+ * @param resourceLoader resource loader
+ */
+ void registerResourceLoader(EngineResourceLoader extends EngineLocalPathResource> resourceLoader);
+ /**
+ * Scan entrance
+ * @param rootPath root path
+ */
+ Set doScan(String rootPath) throws ExchangisEngineResException;
+}
diff --git a/exchangis-engines/exchangis-engine-core/src/main/java/com/webank/wedatasphere/exchangis/engine/resource/EngineResourceUploader.java b/exchangis-engines/exchangis-engine-core/src/main/java/com/webank/wedatasphere/exchangis/engine/resource/EngineResourceUploader.java
new file mode 100644
index 000000000..3e059e937
--- /dev/null
+++ b/exchangis-engines/exchangis-engine-core/src/main/java/com/webank/wedatasphere/exchangis/engine/resource/EngineResourceUploader.java
@@ -0,0 +1,21 @@
+package com.webank.wedatasphere.exchangis.engine.resource;
+
+import com.webank.wedatasphere.exchangis.engine.domain.EngineResource;
+import com.webank.wedatasphere.exchangis.engine.exception.ExchangisEngineResUploadException;
+
+/**
+ * Engine resource uploader
+ * @param
+ * @param
+ */
+public interface EngineResourceUploader {
+
+ /**
+ * upload method
+ * @param needUploadResource resource need to be uploaded
+ * @return uploaded resource
+ */
+ R upload(T needUploadResource) throws ExchangisEngineResUploadException;
+
+ R upload(T needUploadResource, R relatedResource) throws ExchangisEngineResUploadException;
+}
diff --git a/exchangis-engines/exchangis-engine-core/src/main/java/com/webank/wedatasphere/exchangis/engine/resource/bml/BmlClients.java b/exchangis-engines/exchangis-engine-core/src/main/java/com/webank/wedatasphere/exchangis/engine/resource/bml/BmlClients.java
new file mode 100644
index 000000000..bb41f626e
--- /dev/null
+++ b/exchangis-engines/exchangis-engine-core/src/main/java/com/webank/wedatasphere/exchangis/engine/resource/bml/BmlClients.java
@@ -0,0 +1,20 @@
+package com.webank.wedatasphere.exchangis.engine.resource.bml;
+
+import org.apache.linkis.bml.client.BmlClient;
+import org.apache.linkis.bml.client.BmlClientFactory;
+
+/**
+ * BML client
+ */
+public class BmlClients {
+
+ private static final BmlClient DEFAULT_CLIENT;
+ static{
+ //TODO use the common client configuration
+ DEFAULT_CLIENT = BmlClientFactory.createBmlClient();
+ }
+
+ public static BmlClient getInstance(){
+ return DEFAULT_CLIENT;
+ }
+}
diff --git a/exchangis-engines/exchangis-engine-core/src/main/java/com/webank/wedatasphere/exchangis/engine/resource/bml/BmlEngineResourceUploader.java b/exchangis-engines/exchangis-engine-core/src/main/java/com/webank/wedatasphere/exchangis/engine/resource/bml/BmlEngineResourceUploader.java
new file mode 100644
index 000000000..a65a3cd0d
--- /dev/null
+++ b/exchangis-engines/exchangis-engine-core/src/main/java/com/webank/wedatasphere/exchangis/engine/resource/bml/BmlEngineResourceUploader.java
@@ -0,0 +1,53 @@
+package com.webank.wedatasphere.exchangis.engine.resource.bml;
+
+import com.webank.wedatasphere.exchangis.engine.domain.EngineBmlResource;
+import com.webank.wedatasphere.exchangis.engine.domain.EngineLocalPathResource;
+import com.webank.wedatasphere.exchangis.engine.exception.ExchangisEngineResUploadException;
+import com.webank.wedatasphere.exchangis.engine.resource.EngineResourceUploader;
+import org.apache.linkis.bml.protocol.BmlUpdateResponse;
+import org.apache.linkis.bml.protocol.BmlUploadResponse;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.Objects;
+
+/**
+ * Bml engine resource uploader
+ */
+public class BmlEngineResourceUploader implements EngineResourceUploader {
+
+ private static final Logger LOG = LoggerFactory.getLogger(BmlEngineResourceUploader.class);
+
+ @Override
+ public EngineBmlResource upload(EngineLocalPathResource res) throws ExchangisEngineResUploadException {
+ try {
+ BmlUploadResponse uploadResponse = BmlClients.getInstance()
+ .uploadResource(res.getCreator(), res.getName(), res.getInputStream());
+ return new EngineBmlResource(res.getEngineType(), res.getPath(),
+ res.getName(), uploadResponse.resourceId(), uploadResponse.version(), res.getCreator());
+ } catch (Exception e){
+ throw new ExchangisEngineResUploadException(
+ "Fail to upload resource: [name: " + res.getName() + ", path: " + res.getPath()
+ + ", type: "+ res.getType() + ", creator: "+ res.getCreator() + "]", e);
+ }
+ }
+
+ @Override
+ public EngineBmlResource upload(EngineLocalPathResource res, EngineBmlResource relatedResource) throws ExchangisEngineResUploadException {
+ if (Objects.isNull(relatedResource)){
+ return upload(res);
+ }
+ try {
+ BmlUpdateResponse response = BmlClients.getInstance()
+ .updateResource(res.getCreator(), relatedResource.getResourceId(),
+ res.getName(), res.getInputStream());
+ return new EngineBmlResource(relatedResource.getEngineType(), res.getPath(),
+ res.getName(), response.resourceId(), response.version(), res.getCreator());
+ } catch (Exception e){
+ throw new ExchangisEngineResUploadException(
+ "Fail to upload resource: [name: " + res.getName() + ", path: " + res.getPath()
+ + ", type: "+ res.getType() + ", resourceId: " + relatedResource.getResourceId() +
+ ",creator: "+ res.getCreator() + "]", e);
+ }
+ }
+}
diff --git a/exchangis-engines/exchangis-engine-core/src/main/java/com/webank/wedatasphere/exchangis/engine/resource/loader/AbstractEngineLocalPathResourceLoader.java b/exchangis-engines/exchangis-engine-core/src/main/java/com/webank/wedatasphere/exchangis/engine/resource/loader/AbstractEngineLocalPathResourceLoader.java
new file mode 100644
index 000000000..34705b1e7
--- /dev/null
+++ b/exchangis-engines/exchangis-engine-core/src/main/java/com/webank/wedatasphere/exchangis/engine/resource/loader/AbstractEngineLocalPathResourceLoader.java
@@ -0,0 +1,129 @@
+package com.webank.wedatasphere.exchangis.engine.resource.loader;
+
+import com.webank.wedatasphere.exchangis.engine.domain.EngineLocalPathResource;
+import com.webank.wedatasphere.exchangis.engine.exception.ExchangisEngineResLoadException;
+import com.webank.wedatasphere.exchangis.engine.resource.AbstractEngineResourceLoader;
+import org.apache.commons.io.IOUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.File;
+import java.net.URI;
+import java.util.Arrays;
+import java.util.Date;
+import java.util.Objects;
+import java.util.regex.Pattern;
+
+/**
+ * Load the engine resources by local path
+ */
+public abstract class AbstractEngineLocalPathResourceLoader extends AbstractEngineResourceLoader {
+
+ private static final Logger LOG = LoggerFactory.getLogger(AbstractEngineLocalPathResourceLoader.class);
+ private static final String DEFAULT_SUPPORT_SCHEMA = "file";
+
+ /**
+ * Pattern object
+ */
+ private Pattern[] patterns = new Pattern[0];
+
+ public AbstractEngineLocalPathResourceLoader(){
+ String[] pathPatterns = pathPatterns();
+ if (Objects.nonNull(pathPatterns)){
+ patterns = new Pattern[pathPatterns.length];
+ for(int i = 0; i < pathPatterns.length; i++){
+ Pattern pattern = Pattern.compile(pathPatterns[i]);
+ patterns[i] = pattern;
+ }
+ }
+ }
+
+ @Override
+ public boolean accept(URI baseUri, String path) {
+ if (StringUtils.isBlank(baseUri.getScheme()) || DEFAULT_SUPPORT_SCHEMA.equals(baseUri.getScheme())){
+ return Arrays.stream(patterns)
+ .anyMatch(pattern -> pattern.matcher(path).matches());
+ }
+ return false;
+ }
+
+ @Override
+ public EngineLocalPathResource[] loadResource(URI baseUri, String path) throws ExchangisEngineResLoadException {
+ LOG.info("Load local engine resource, path: {}", path);
+ String scheme = baseUri.getScheme();
+ if (StringUtils.isBlank(baseUri.getScheme()) || DEFAULT_SUPPORT_SCHEMA.equals(scheme)){
+ return loadLocalResource(baseUri, path);
+ } else {
+ throw new ExchangisEngineResLoadException("Unsupported scheme: [" + scheme + "] in basic uri: [" + baseUri + "] for local resource loader.");
+ }
+ }
+
+ /**
+ * Path pattern list
+ * @return pattern string array
+ */
+ protected abstract String[] pathPatterns();
+ /**
+ * Load local resource
+ * @param path path
+ * @return resource array
+ */
+ private EngineLocalPathResource[] loadLocalResource(URI baseUri, String path) throws ExchangisEngineResLoadException {
+ File localFile = new File(baseUri.getPath(), path);
+ EngineLocalPathResource[] resources = new EngineLocalPathResource[0];
+ if (localFile.isDirectory()) {
+ File[] resourceFiles = localFile.listFiles();
+ if (Objects.nonNull(resourceFiles)) {
+ resources = new EngineLocalPathResource[resourceFiles.length];
+ for (int i = 0; i < resources.length; i++) {
+ resources[i] = createLocalResource(resourceFiles[i], baseUri, path);
+ }
+ }
+ } else if (localFile.isFile()) {
+ resources = new EngineLocalPathResource[]{createLocalResource(localFile, baseUri, path)};
+ }
+ // Important: make all the resources have the same value in 'path'
+ for(EngineLocalPathResource resource : resources){
+ resource.setPath(path);
+ }
+ return resources;
+ }
+
+ /**
+ * Create local resource
+ * @param localFile local file
+ * @param baseUri base uri
+ * @param path path
+ * @return local resource
+ */
+ private EngineLocalPathResource createLocalResource(File localFile, URI baseUri, String path){
+ EngineLocalPathResource localResource = new EngineLocalPathResource(engineType(), baseUri,
+ path + IOUtils.DIR_SEPARATOR + localFile.getName());
+ long lastModifyTime = traverseExtractTime(localFile, 0L);
+ localResource.setCreateTime(new Date(lastModifyTime));
+ localResource.setModifyTime(new Date(lastModifyTime));
+ return localResource;
+ }
+ /**
+ * Traverse the extract last time
+ * @param localFile local file
+ * @param timestamp timestamp
+ * @return
+ */
+ private long traverseExtractTime(File localFile, long timestamp){
+ long lastTime = timestamp;
+ if (localFile.lastModified() > lastTime){
+ lastTime = localFile.lastModified();
+ }
+ if (localFile.isDirectory()){
+ File[] subFiles = localFile.listFiles();
+ if (Objects.nonNull(subFiles)) {
+ for (File subFile : subFiles) {
+ lastTime = traverseExtractTime(subFile, lastTime);
+ }
+ }
+ }
+ return lastTime;
+ }
+}
diff --git a/exchangis-engines/exchangis-engine-core/src/main/java/com/webank/wedatasphere/exchangis/engine/resource/loader/datax/DataxEngineResourceConf.java b/exchangis-engines/exchangis-engine-core/src/main/java/com/webank/wedatasphere/exchangis/engine/resource/loader/datax/DataxEngineResourceConf.java
new file mode 100644
index 000000000..20dc2f841
--- /dev/null
+++ b/exchangis-engines/exchangis-engine-core/src/main/java/com/webank/wedatasphere/exchangis/engine/resource/loader/datax/DataxEngineResourceConf.java
@@ -0,0 +1,14 @@
+package com.webank.wedatasphere.exchangis.engine.resource.loader.datax;
+
+import org.apache.linkis.common.conf.CommonVars;
+
+/**
+ * Resource config for datax
+ */
+public class DataxEngineResourceConf {
+
+ /**
+ * Resource path prefix
+ */
+ public static final CommonVars RESOURCE_PATH_PREFIX = CommonVars.apply("wds.exchangis.engine.datax.resource.path-prefix", "/datax/plugin");
+}
diff --git a/exchangis-engines/exchangis-engine-core/src/main/java/com/webank/wedatasphere/exchangis/engine/resource/loader/datax/DataxEngineResourceLoader.java b/exchangis-engines/exchangis-engine-core/src/main/java/com/webank/wedatasphere/exchangis/engine/resource/loader/datax/DataxEngineResourceLoader.java
new file mode 100644
index 000000000..cdec9aeae
--- /dev/null
+++ b/exchangis-engines/exchangis-engine-core/src/main/java/com/webank/wedatasphere/exchangis/engine/resource/loader/datax/DataxEngineResourceLoader.java
@@ -0,0 +1,30 @@
+package com.webank.wedatasphere.exchangis.engine.resource.loader.datax;
+
+import com.webank.wedatasphere.exchangis.engine.resource.loader.AbstractEngineLocalPathResourceLoader;
+import org.apache.commons.lang.StringUtils;
+import org.apache.linkis.common.conf.CommonVars;
+
+import java.util.regex.Pattern;
+
+/**
+ * Datax engine resource loader
+ */
+public class DataxEngineResourceLoader extends AbstractEngineLocalPathResourceLoader {
+
+ private static final CommonVars ENGINE_DATAX_LOADER_PATH_PATTERN = CommonVars.apply("engine.datax.resource.loader.path-pattern",
+ StringUtils.join(new String[]{
+ DataxEngineResourceConf.RESOURCE_PATH_PREFIX.getValue() + "/reader/.*[/]?",
+ DataxEngineResourceConf.RESOURCE_PATH_PREFIX.getValue() + "/writer/.*[/]?"
+ }, ","));
+ @Override
+ protected String[] pathPatterns() {
+ return ENGINE_DATAX_LOADER_PATH_PATTERN.getValue().split(",");
+ }
+
+
+ @Override
+ public String engineType() {
+ return "datax";
+ }
+
+}
diff --git a/exchangis-engines/exchangis-engine-core/src/main/java/com/webank/wedatasphere/exchangis/engine/resource/uri/ResourceURLStreamHandler.java b/exchangis-engines/exchangis-engine-core/src/main/java/com/webank/wedatasphere/exchangis/engine/resource/uri/ResourceURLStreamHandler.java
new file mode 100644
index 000000000..93fe1c9a7
--- /dev/null
+++ b/exchangis-engines/exchangis-engine-core/src/main/java/com/webank/wedatasphere/exchangis/engine/resource/uri/ResourceURLStreamHandler.java
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2021 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.webank.wedatasphere.exchangis.engine.resource.uri;
+
+import java.io.IOException;
+import java.net.URL;
+import java.net.URLConnection;
+import java.net.URLStreamHandler;
+
+/**
+ * URL stream handler for linkis client (cannot open connection)
+ */
+public class ResourceURLStreamHandler extends URLStreamHandler {
+ @Override
+ protected URLConnection openConnection(URL url) throws IOException {
+ throw new IllegalArgumentException("Cannot open connection for url [" + url + "]");
+ }
+}
diff --git a/exchangis-engines/exchangis-engine-core/src/main/java/com/webank/wedatasphere/exchangis/engine/resource/uri/ResourceURLStreamHandlerFactory.java b/exchangis-engines/exchangis-engine-core/src/main/java/com/webank/wedatasphere/exchangis/engine/resource/uri/ResourceURLStreamHandlerFactory.java
new file mode 100644
index 000000000..bcf6c10e5
--- /dev/null
+++ b/exchangis-engines/exchangis-engine-core/src/main/java/com/webank/wedatasphere/exchangis/engine/resource/uri/ResourceURLStreamHandlerFactory.java
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2021 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.webank.wedatasphere.exchangis.engine.resource.uri;
+
+import java.net.URLStreamHandler;
+import java.net.URLStreamHandlerFactory;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * Engine resource stream handler factory (support specific schemas)
+ */
+public class ResourceURLStreamHandlerFactory implements URLStreamHandlerFactory {
+
+ /**
+ * Support schemas
+ */
+ private final List supportSchemas = new ArrayList<>();
+
+ /**
+ * Stream handler
+ */
+ private final URLStreamHandler defaultStreamHandler;
+
+ public ResourceURLStreamHandlerFactory(String... schemas){
+ supportSchemas.addAll(Arrays.asList(schemas));
+ this.defaultStreamHandler = new ResourceURLStreamHandler();
+ }
+
+ @Override
+ public URLStreamHandler createURLStreamHandler(String protocol) {
+ if (supportSchemas.stream().anyMatch( schema -> schema.equals(protocol))){
+ return this.defaultStreamHandler;
+ }
+ return null;
+ }
+}
diff --git a/exchangis-engines/exchangis-engine-core/src/main/java/com/webank/wedatasphere/exchangis/engine/utils/ResourceUtils.java b/exchangis-engines/exchangis-engine-core/src/main/java/com/webank/wedatasphere/exchangis/engine/utils/ResourceUtils.java
new file mode 100644
index 000000000..f63422313
--- /dev/null
+++ b/exchangis-engines/exchangis-engine-core/src/main/java/com/webank/wedatasphere/exchangis/engine/utils/ResourceUtils.java
@@ -0,0 +1,134 @@
+package com.webank.wedatasphere.exchangis.engine.utils;
+
+import com.webank.wedatasphere.exchangis.engine.domain.EngineLocalPathResource;
+import com.webank.wedatasphere.exchangis.engine.domain.EngineResource;
+import org.apache.commons.io.FilenameUtils;
+import org.apache.commons.io.IOUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.nio.file.Files;
+import java.nio.file.LinkOption;
+import java.nio.file.Path;
+import java.nio.file.StandardOpenOption;
+import java.util.Objects;
+import java.util.stream.Collectors;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipFile;
+import java.util.zip.ZipInputStream;
+import java.util.zip.ZipOutputStream;
+
+/**
+ * Resource utils
+ */
+public class ResourceUtils {
+
+ private static final Logger LOG = LoggerFactory.getLogger(ResourceUtils.class);
+
+ private static final Integer BUFFER_SIZE = 2 * 1024;
+
+ public static String normalizeFilePath(String path){
+ return FilenameUtils.normalize(path);
+ }
+
+ /**
+ * Combine the resources and packet
+ * @param resources resources
+ * @param outputStream output stream
+ * @throws IOException
+ */
+ public static void combinePacket(EngineResource[] resources, OutputStream outputStream) throws IOException {
+ LOG.info("Start to combine the resources to packet file...");
+ long startTime = System.currentTimeMillis();
+ try(ZipOutputStream zipOutputStream = new ZipOutputStream(outputStream)) {
+ for (EngineResource resource : resources) {
+ if (resource instanceof EngineLocalPathResource) {
+ packet(resource.getName(), ((EngineLocalPathResource) resource).getLocalFile().toPath(),
+ zipOutputStream);
+ } else {
+ packet(resource.getName(), resource.getInputStream(), zipOutputStream);
+ }
+ }
+ }
+ LOG.info("Success to combine the resources to packet file, taken: {}", System.currentTimeMillis() - startTime);
+ }
+
+ public static void packet(Path source, Path target, boolean includeBaseDir) throws IOException {
+
+ }
+
+ public static void unPacket(Path source, Path target) throws IOException{
+ if (Files.isRegularFile(source, LinkOption.NOFOLLOW_LINKS)){
+ ZipFile zipFile = new ZipFile(source.toFile());
+ InputStream inputStream = Files.newInputStream(source);
+ try(ZipInputStream zipInputStream = new ZipInputStream(inputStream)) {
+ ZipEntry zipEntry = null;
+ while (null != (zipEntry = zipInputStream.getNextEntry())) {
+ Path entryPath = target.resolve(zipEntry.getName());
+ if (zipEntry.isDirectory()) {
+ if (!Files.isDirectory(entryPath)) {
+ Files.createDirectories(entryPath);
+ }
+ } else {
+ try (InputStream entryStream = zipFile.getInputStream(zipEntry)) {
+ try (OutputStream outputStream = Files.newOutputStream(entryPath, StandardOpenOption.CREATE_NEW)) {
+ byte[] buffer = new byte[BUFFER_SIZE];
+ int pos = -1;
+ while ((pos = entryStream.read(buffer)) != -1) {
+ outputStream.write(buffer, 0, pos);
+ }
+ outputStream.flush();
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * Packet path source
+ * @param name name
+ * @param source source path
+ * @param outputStream stream
+ * @throws IOException
+ */
+ private static void packet(String name, Path source, ZipOutputStream outputStream) throws IOException {
+ if (Files.isDirectory(source, LinkOption.NOFOLLOW_LINKS)){
+ name = name + IOUtils.DIR_SEPARATOR_UNIX;
+ // Accept empty directory
+ ZipEntry zipEntry = new ZipEntry(name);
+ outputStream.putNextEntry(zipEntry);
+ outputStream.closeEntry();
+ for(Path child : Files.list(source).collect(Collectors.toList())) {
+ packet(name + child.toFile().getName(), child, outputStream);
+ }
+ } else if (Files.isRegularFile(source, LinkOption.NOFOLLOW_LINKS)){
+ packet(name, Files.newInputStream(source), outputStream);
+ }
+ }
+
+ /**
+ * Packet input stream
+ * @param name name
+ * @param inputStream input stream
+ * @param outputStream output stream
+ * @throws IOException
+ */
+ private static void packet(String name, InputStream inputStream, ZipOutputStream outputStream) throws IOException{
+ if (Objects.nonNull(inputStream)) {
+ ZipEntry zipEntry = new ZipEntry(name);
+ outputStream.putNextEntry(zipEntry);
+ byte[] buffer = new byte[BUFFER_SIZE];
+ int pos = -1;
+ while ((pos = inputStream.read(buffer)) != -1) {
+ outputStream.write(buffer, 0, pos);
+ }
+ outputStream.closeEntry();
+ }
+ }
+}
diff --git a/exchangis-engines/exchangis-engine-server/pom.xml b/exchangis-engines/exchangis-engine-server/pom.xml
new file mode 100644
index 000000000..5873fe538
--- /dev/null
+++ b/exchangis-engines/exchangis-engine-server/pom.xml
@@ -0,0 +1,56 @@
+
+
+
+ exchangis-engines
+ com.webank.wedatasphere.exchangis
+ 1.1.2
+
+ 4.0.0
+
+ exchangis-engine-server
+
+
+ 8
+ 8
+
+
+
+
+ com.webank.wedatasphere.exchangis
+ exchangis-dao
+ ${exchangis.version}
+
+
+ com.webank.wedatasphere.exchangis
+ exchangis-engine-core
+ ${exchangis.version}
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-deploy-plugin
+
+
+
+ net.alchim31.maven
+ scala-maven-plugin
+
+
+ org.apache.maven.plugins
+ maven-jar-plugin
+
+
+
+
+ src/main/java
+
+ **/*.xml
+
+
+
+
+
\ No newline at end of file
diff --git a/exchangis-engines/exchangis-engine-server/src/main/java/com/webank/wedatasphere/exchangis/engine/server/ExchangisEngineAutoConfiguration.java b/exchangis-engines/exchangis-engine-server/src/main/java/com/webank/wedatasphere/exchangis/engine/server/ExchangisEngineAutoConfiguration.java
new file mode 100644
index 000000000..20ad739fb
--- /dev/null
+++ b/exchangis-engines/exchangis-engine-server/src/main/java/com/webank/wedatasphere/exchangis/engine/server/ExchangisEngineAutoConfiguration.java
@@ -0,0 +1,33 @@
+package com.webank.wedatasphere.exchangis.engine.server;
+
+import com.webank.wedatasphere.exchangis.engine.config.ExchangisEngineConfiguration;
+import com.webank.wedatasphere.exchangis.engine.dao.EngineResourceDao;
+import com.webank.wedatasphere.exchangis.engine.dao.EngineSettingsDao;
+import com.webank.wedatasphere.exchangis.engine.manager.ExchangisEngineManager;
+import com.webank.wedatasphere.exchangis.engine.resource.DefaultEngineResourcePathScanner;
+import com.webank.wedatasphere.exchangis.engine.resource.EngineResourcePathScanner;
+import com.webank.wedatasphere.exchangis.engine.server.manager.SpringExchangisEngineManager;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+/**
+ * Auto configure the beans in engine
+ */
+@Configuration
+public class ExchangisEngineAutoConfiguration {
+
+ @Bean
+ @ConditionalOnMissingBean(EngineResourcePathScanner.class)
+ public EngineResourcePathScanner resourcePathScanner(){
+ return new DefaultEngineResourcePathScanner();
+ }
+
+ @Bean(initMethod = "init")
+ @ConditionalOnMissingBean(ExchangisEngineManager.class)
+ public ExchangisEngineManager engineManager(EngineResourceDao resourceDao,
+ EngineSettingsDao settingsDao, EngineResourcePathScanner scanner){
+ return new SpringExchangisEngineManager(ExchangisEngineConfiguration.ENGINE_RESOURCE_ROOT_PATH.getValue(),
+ resourceDao, settingsDao, scanner);
+ }
+}
diff --git a/exchangis-engines/exchangis-engine-server/src/main/java/com/webank/wedatasphere/exchangis/engine/server/manager/SpringExchangisEngineManager.java b/exchangis-engines/exchangis-engine-server/src/main/java/com/webank/wedatasphere/exchangis/engine/server/manager/SpringExchangisEngineManager.java
new file mode 100644
index 000000000..8fa6b88e4
--- /dev/null
+++ b/exchangis-engines/exchangis-engine-server/src/main/java/com/webank/wedatasphere/exchangis/engine/server/manager/SpringExchangisEngineManager.java
@@ -0,0 +1,127 @@
+package com.webank.wedatasphere.exchangis.engine.server.manager;
+
+import com.webank.wedatasphere.exchangis.engine.ExchangisEngine;
+import com.webank.wedatasphere.exchangis.engine.GenericExchangisEngine;
+import com.webank.wedatasphere.exchangis.engine.dao.EngineResourceDao;
+import com.webank.wedatasphere.exchangis.engine.dao.EngineSettingsDao;
+import com.webank.wedatasphere.exchangis.engine.domain.EngineBmlResource;
+import com.webank.wedatasphere.exchangis.engine.domain.EngineLocalPathResource;
+import com.webank.wedatasphere.exchangis.engine.domain.EngineSettings;
+import com.webank.wedatasphere.exchangis.engine.exception.ExchangisEngineResException;
+import com.webank.wedatasphere.exchangis.engine.manager.DefaultExchangisEngineManager;
+import com.webank.wedatasphere.exchangis.engine.resource.DefaultEngineResourceContainer;
+import com.webank.wedatasphere.exchangis.engine.resource.EngineResourceContainer;
+import com.webank.wedatasphere.exchangis.engine.resource.EngineResourcePathScanner;
+import com.webank.wedatasphere.exchangis.engine.resource.bml.BmlEngineResourceUploader;
+import com.webank.wedatasphere.exchangis.engine.resource.loader.AbstractEngineLocalPathResourceLoader;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.linkis.common.utils.JsonUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.Set;
+
+/**
+ * Engine manager of spring context
+ */
+public class SpringExchangisEngineManager extends DefaultExchangisEngineManager {
+
+ private static final Logger LOG = LoggerFactory.getLogger(SpringExchangisEngineManager.class);
+
+ /**
+ * Resource dao
+ */
+ private final EngineResourceDao resourceDao;
+
+ /**
+ * Settings dao
+ */
+ private final EngineSettingsDao settingsDao;
+
+ /**
+ * Resource root path
+ */
+ private final String rootPath;
+
+ private final EngineResourcePathScanner scanner;
+
+ public SpringExchangisEngineManager(String rootPath, EngineResourceDao resourceDao,
+ EngineSettingsDao settingsDao, EngineResourcePathScanner scanner){
+ this.rootPath = rootPath;
+ this.resourceDao = resourceDao;
+ this.settingsDao = settingsDao;
+ this.scanner = scanner;
+ }
+
+ public void init(){
+ List settingsList = this.settingsDao.getSettings();
+ try {
+ String settingsJson = JsonUtils.jackson().writer().writeValueAsString(settingsList);
+ LOG.info("Engine settings: {}", settingsJson);
+ }catch(Exception e){
+ //Ignore
+ }
+ settingsList.forEach(settings -> {
+ GenericExchangisEngine engine = new GenericExchangisEngine();
+ engine.setSettings(settings);
+ AbstractEngineLocalPathResourceLoader loader = null;
+ BmlEngineResourceUploader uploader = null;
+ String loaderClassName = settings.getResourceLoaderClass();
+ if (StringUtils.isNotBlank(loaderClassName)){
+ try {
+ Class> loaderClass = Class.forName(loaderClassName);
+ if (AbstractEngineLocalPathResourceLoader.class.isAssignableFrom(loaderClass)){
+ loader = (AbstractEngineLocalPathResourceLoader) loaderClass.newInstance();
+ this.scanner.registerResourceLoader(loader);
+ } else {
+ LOG.warn("Not allow the loader class: '{}' which does not implement '{}'", loaderClass, AbstractEngineLocalPathResourceLoader.class.getName());
+ }
+ } catch (ClassNotFoundException e) {
+ LOG.warn("Cannot find the loader class: '{}' for engine [{}]", loaderClassName, engine.getName());
+ } catch (InstantiationException | IllegalAccessException e) {
+ LOG.warn("Fail to instantiate the loader class: '{}'", loaderClassName, e);
+ }
+ }
+ String uploaderClassName = Optional.ofNullable(settings.getResourceUploaderClass())
+ .orElse(BmlEngineResourceUploader.class.getCanonicalName());
+ try {
+ Class> uploaderClass = Class.forName(uploaderClassName);
+ if (BmlEngineResourceUploader.class.isAssignableFrom(uploaderClass)){
+ uploader = (BmlEngineResourceUploader) uploaderClass.newInstance();
+ } else {
+ LOG.warn("Not allow the uploader class: '{}' which does not implement '{}'", uploaderClass,
+ BmlEngineResourceUploader.class.getName());
+ }
+ } catch (ClassNotFoundException e) {
+ LOG.warn("Cannot find the uploader class: '{}' for engine [{}]", uploaderClassName, engine.getName());
+ } catch (InstantiationException | IllegalAccessException e) {
+ LOG.warn("Fail to instantiate the uploader class: '{}'", uploaderClassName, e);
+ }
+ EngineResourceContainer
+ resourceContainer = new DefaultEngineResourceContainer(engine.getName(), rootPath, resourceDao, loader, uploader);
+ LOG.info("Init engine resource container for engine: [{}]", engine.getName());
+ resourceContainer.init();
+ engine.setResourceContainer(resourceContainer);
+ engineContextMap.put(engine.getName(), engine);
+ });
+ try {
+ // Start to scan and load local resources
+ Set localResources = this.scanner.doScan(this.rootPath);
+ localResources.forEach(resource -> Optional.ofNullable(engineContextMap.get(resource.getEngineType()))
+ .ifPresent(engine -> engine.getResourceContainer().addResource(resource.getPath(), resource)));
+ }catch (ExchangisEngineResException e){
+ LOG.warn("Exception happened when scanning root path: [{}]", this.rootPath, e);
+ }
+ LOG.info("Flush all the resources in engine resource containers");
+ for(Map.Entry entry : engineContextMap.entrySet()){
+ try {
+ entry.getValue().getResourceContainer().flushAllResources();
+ } catch (ExchangisEngineResException e) {
+ LOG.warn("Unable to flush the resources in container for engine: [{}]", entry.getValue().getName(), e);
+ }
+ }
+ }
+}
diff --git a/exchangis-engines/exchangis-engine-server/src/main/java/com/webank/wedatasphere/exchangis/engine/server/mapper/EngineSettingsMapper.xml b/exchangis-engines/exchangis-engine-server/src/main/java/com/webank/wedatasphere/exchangis/engine/server/mapper/EngineSettingsMapper.xml
new file mode 100644
index 000000000..f8d7aac95
--- /dev/null
+++ b/exchangis-engines/exchangis-engine-server/src/main/java/com/webank/wedatasphere/exchangis/engine/server/mapper/EngineSettingsMapper.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/exchangis-engines/exchangis-engine-server/src/main/java/com/webank/wedatasphere/exchangis/engine/server/mapper/ProjectExportService.xml b/exchangis-engines/exchangis-engine-server/src/main/java/com/webank/wedatasphere/exchangis/engine/server/mapper/ProjectExportService.xml
new file mode 100644
index 000000000..71fee099e
--- /dev/null
+++ b/exchangis-engines/exchangis-engine-server/src/main/java/com/webank/wedatasphere/exchangis/engine/server/mapper/ProjectExportService.xml
@@ -0,0 +1,41 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/exchangis-engines/pom.xml b/exchangis-engines/pom.xml
new file mode 100644
index 000000000..7dfac3c51
--- /dev/null
+++ b/exchangis-engines/pom.xml
@@ -0,0 +1,31 @@
+
+
+
+ exchangis
+ com.webank.wedatasphere.exchangis
+ 1.1.2
+
+ 4.0.0
+
+ exchangis-engines
+ pom
+ 1.1.2
+
+
+ exchangis-engine-common
+ exchangis-engine-core
+ exchangis-engine-server
+
+ engines/datax
+
+ engineconn-plugins/sqoop
+ engineconn-plugins/datax
+
+
+ 8
+ 8
+
+
+
\ No newline at end of file
diff --git a/exchangis-job/exchangis-job-builder/pom.xml b/exchangis-job/exchangis-job-builder/pom.xml
index 9b971105b..acfbb460a 100644
--- a/exchangis-job/exchangis-job-builder/pom.xml
+++ b/exchangis-job/exchangis-job-builder/pom.xml
@@ -5,7 +5,7 @@
exchangis-job
com.webank.wedatasphere.exchangis
- 1.0.0
+ 1.1.2
4.0.0
@@ -15,7 +15,7 @@
com.webank.wedatasphere.exchangis
exchangis-job-common
- 1.0.0
+ 1.1.2
com.google.code.gson
@@ -25,7 +25,7 @@
com.webank.wedatasphere.exchangis
exchangis-datasource-service
- 1.0.0
+ 1.1.2
compile
diff --git a/exchangis-job/exchangis-job-builder/src/main/java/com/webank/wedatasphere/exchangis/job/builder/api/AbstractExchangisJobBuilder.java b/exchangis-job/exchangis-job-builder/src/main/java/com/webank/wedatasphere/exchangis/job/builder/api/AbstractExchangisJobBuilder.java
index 9f8fa61d8..d2800991c 100644
--- a/exchangis-job/exchangis-job-builder/src/main/java/com/webank/wedatasphere/exchangis/job/builder/api/AbstractExchangisJobBuilder.java
+++ b/exchangis-job/exchangis-job-builder/src/main/java/com/webank/wedatasphere/exchangis/job/builder/api/AbstractExchangisJobBuilder.java
@@ -61,7 +61,7 @@ public E build(T inputJob, E expectOut, ExchangisJobBuilderContext ctx) throws E
* Get current job builder context
* @return
*/
- protected static ExchangisJobBuilderContext getCurrentBuilderContext(){
+ public static ExchangisJobBuilderContext getCurrentBuilderContext(){
return contextThreadLocal.get();
}
}
diff --git a/exchangis-job/exchangis-job-common/pom.xml b/exchangis-job/exchangis-job-common/pom.xml
index 8abdf342c..1bae2fa82 100644
--- a/exchangis-job/exchangis-job-common/pom.xml
+++ b/exchangis-job/exchangis-job-common/pom.xml
@@ -5,7 +5,7 @@
exchangis-job
com.webank.wedatasphere.exchangis
- 1.0.0
+ 1.1.2
4.0.0
@@ -15,13 +15,18 @@
com.webank.wedatasphere.exchangis
exchangis-dao
- 1.0.0
+ 1.1.2
org.apache.linkis
linkis-label-common
${linkis.version}
+
+ com.webank.wedatasphere.exchangis
+ exchangis-engine-common
+ 1.1.2
+
org.apache.linkis
linkis-protocol
diff --git a/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/domain/ExchangisEngineJob.java b/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/domain/ExchangisEngineJob.java
index 2354018ce..72d979504 100644
--- a/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/domain/ExchangisEngineJob.java
+++ b/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/domain/ExchangisEngineJob.java
@@ -1,17 +1,30 @@
package com.webank.wedatasphere.exchangis.job.domain;
+import com.webank.wedatasphere.exchangis.engine.domain.EngineResource;
import com.webank.wedatasphere.exchangis.job.utils.MemUtils;
-import java.util.HashMap;
-import java.util.Map;
+import java.util.*;
/**
* EngineJob
*/
public class ExchangisEngineJob extends GenericExchangisJob {
+ public ExchangisEngineJob(){
+ }
+
+ public ExchangisEngineJob(ExchangisEngineJob engineJob){
+ if (Objects.nonNull(engineJob)) {
+ setName(engineJob.getName());
+ setEngineType(engineJob.getEngineType());
+ getJobContent().putAll(engineJob.getJobContent());
+ getRuntimeParams().putAll(engineJob.getRuntimeParams());
+ setMemoryUsed(engineJob.getMemoryUsed());
+ getResources().addAll(engineJob.getResources());
+ }
+ }
/**
* Job content
*/
@@ -29,11 +42,20 @@ public class ExchangisEngineJob extends GenericExchangisJob {
private String memoryUnit = MemUtils.StoreUnit.MB.name();
+ /**
+ * If lock the unit of memory
+ */
+ private boolean memoryUnitLock = false;
/**
* Cpu used in engine job
*/
private Long cpuUsed;
+ /**
+ * Engine resources
+ */
+ private List resources = new ArrayList<>();
+
public Map getJobContent() {
return jobContent;
}
@@ -50,6 +72,7 @@ public void setRuntimeParams(Map runtimeParams) {
this.runtimeParams = runtimeParams;
}
+
public Long getMemoryUsed() {
return memoryUsed;
}
@@ -73,4 +96,20 @@ public String getMemoryUnit() {
public void setMemoryUnit(String memoryUnit) {
this.memoryUnit = memoryUnit;
}
+
+ public List getResources() {
+ return resources;
+ }
+
+ public void setResources(List resources) {
+ this.resources = resources;
+ }
+
+ public boolean isMemoryUnitLock() {
+ return memoryUnitLock;
+ }
+
+ public void setMemoryUnitLock(boolean memoryUnitLock) {
+ this.memoryUnitLock = memoryUnitLock;
+ }
}
diff --git a/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/domain/OperationType.java b/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/domain/OperationType.java
new file mode 100644
index 000000000..d8c97943c
--- /dev/null
+++ b/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/domain/OperationType.java
@@ -0,0 +1,44 @@
+package com.webank.wedatasphere.exchangis.job.domain;
+
+/**
+ * @author jefftlin
+ * @create 2022-09-15
+ **/
+public enum OperationType {
+
+ /**
+ * job operation:
+ * query project
+ */
+ JOB_QUERY("JOB_QUERY"),
+
+ /**
+ * job operation:
+ * create jpb
+ * update job info
+ * update job config
+ * update job content
+ * delete job
+ */
+ JOB_ALTER("JOB_ALTER"),
+
+ /**
+ * job operation:
+ * job execute
+ * job kill
+ * sub job delete
+ */
+ JOB_EXECUTE("JOB_EXECUTE"),
+
+ /**
+ * job operation:
+ * job release
+ */
+ JOB_RELEASE("JOB_RELEASE");
+
+ private String type;
+
+ OperationType(String type) {
+ this.type = type;
+ }
+}
diff --git a/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/domain/SubExchangisJob.java b/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/domain/SubExchangisJob.java
index be89f6e07..1679e38ff 100644
--- a/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/domain/SubExchangisJob.java
+++ b/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/domain/SubExchangisJob.java
@@ -3,6 +3,8 @@
import com.webank.wedatasphere.exchangis.job.domain.params.JobParam;
import com.webank.wedatasphere.exchangis.job.domain.params.JobParamSet;
+import java.util.ArrayList;
+import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Collectors;
@@ -26,12 +28,27 @@ public class SubExchangisJob extends GenericExchangisJob {
public static final String REALM_JOB_CONTENT_SOURCE = "job.realm.content.source";
- public static final String REALM_JOB_COLUMN_MAPPING = "job.realm.column-mappings";
+// public static final String REALM_JOB_COLUMN_MAPPING = "job.realm.column-mappings";
/**
* Realm params set
*/
- private Map realmParamSet = new ConcurrentHashMap<>();
+ private final Map realmParamSet = new ConcurrentHashMap<>();
+
+ /**
+ * Source columns
+ */
+ private final List sourceColumns = new ArrayList<>();
+
+ /**
+ * Sink columns
+ */
+ private final List sinkColumns = new ArrayList<>();
+
+ /**
+ * Functions
+ */
+ private final List columnFunctions = new ArrayList<>();
public String getSourceType() {
return sourceType;
@@ -49,7 +66,6 @@ public void setSinkType(String sinkType) {
this.sinkType = sinkType;
}
-
/**
* Add
* @param realm realm info
@@ -93,5 +109,109 @@ public Map getParamsToMap(boolean isTemp){
.collect(Collectors.toMap(JobParam::getStrKey, JobParam::getValue, (left, right) -> right));
}
+ public List getSourceColumns() {
+ return sourceColumns;
+ }
+
+ public List getSinkColumns() {
+ return sinkColumns;
+ }
+
+ public List getColumnFunctions() {
+ return columnFunctions;
+ }
+ /**
+ * Column definition
+ */
+ public static class ColumnDefine{
+
+ /**
+ * Column name
+ */
+ private String name;
+
+ /**
+ * Column type
+ */
+ private String type;
+ /**
+ * Column index
+ */
+ private Integer index;
+
+ public ColumnDefine(){
+
+ }
+
+ public ColumnDefine(String name, String type, Integer index){
+ this.name = name;
+ this.type = type;
+ this.index = index;
+ }
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public Integer getIndex() {
+ return index;
+ }
+
+ public void setIndex(Integer index) {
+ this.index = index;
+ }
+ }
+
+ /**
+ * Column function
+ */
+ public static class ColumnFunction{
+
+ private Integer index;
+ /**
+ * Function name
+ */
+ private String name;
+
+ /**
+ * Function params
+ */
+ private List params = new ArrayList<>();
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public List getParams() {
+ return params;
+ }
+
+ public void setParams(List params) {
+ this.params = params;
+ }
+
+ public Integer getIndex() {
+ return index;
+ }
+
+ public void setIndex(Integer index) {
+ this.index = index;
+ }
+ }
}
diff --git a/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/domain/params/JobParamDefine.java b/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/domain/params/JobParamDefine.java
index 055cbc8c5..341b4bf2e 100644
--- a/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/domain/params/JobParamDefine.java
+++ b/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/domain/params/JobParamDefine.java
@@ -3,6 +3,7 @@
import java.util.Objects;
import java.util.function.BiFunction;
+import java.util.function.Function;
/**
* Definition of job params
@@ -21,6 +22,16 @@ public class JobParamDefine{
this.key = key;
this.valueLoader = (BiFunction)valueLoader;
}
+ JobParamDefine(String key, Function valueLoader){
+ this.key = key;
+ this.valueLoader = (s, paramSet) -> valueLoader.apply((JobParamSet) paramSet);
+ }
+
+ @SuppressWarnings("unchecked")
+ JobParamDefine(String key, Function valueLoader, Class clazz){
+ this.key = key;
+ this.valueLoader = (s, paramSet) -> valueLoader.apply((U) paramSet);
+ }
public String getKey() {
return key;
diff --git a/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/domain/params/JobParamSet.java b/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/domain/params/JobParamSet.java
index e81470598..6d7480251 100644
--- a/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/domain/params/JobParamSet.java
+++ b/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/domain/params/JobParamSet.java
@@ -32,6 +32,13 @@ public JobParamSet addNonNull(JobParamDefine> jobParamDefine){
}
return null;
}
+
+ public JobParamSet addNonNull(JobParam> jobParam){
+ if (Objects.nonNull(jobParam.getValue())) {
+ jobParamStore.put(jobParam.getStrKey(), jobParam);
+ }
+ return this;
+ }
/**
* Append
* @param key custom key
diff --git a/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/domain/params/JobParams.java b/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/domain/params/JobParams.java
index 5f8047092..a19256c7c 100644
--- a/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/domain/params/JobParams.java
+++ b/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/domain/params/JobParams.java
@@ -1,10 +1,10 @@
package com.webank.wedatasphere.exchangis.job.domain.params;
-import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import java.util.function.BiFunction;
+import java.util.function.Function;
import java.util.function.Supplier;
/**
@@ -24,6 +24,14 @@ public static JobParamDefine define(String key, BiFunction(key, valueLoader);
}
+ public static JobParamDefine define(String key, Function valueLoader){
+ return new JobParamDefine<>(key, valueLoader);
+ }
+
+ public static JobParamDefine define(String key, Function valueLoader, Class type){
+ return new JobParamDefine<>(key, valueLoader, type);
+ }
+
@SuppressWarnings({"unchecked", "rawtypes"})
public static JobParamDefine define(String key){
return new JobParamDefine<>(key, (paramKey, source) -> {
@@ -39,50 +47,41 @@ public static JobParamDefine define(String key){
});
}
- @SuppressWarnings({"unchecked", "rawtypes"})
- public static JobParamDefine define(String key, Class valueType){
- return new JobParamDefine<>(key,(paramKey, source) -> {
- if(Objects.nonNull(source)){
- if(source instanceof JobParamSet) {
- JobParam> result = ((JobParamSet)source).get(key);
- return Objects.nonNull(result)? (T)result.getValue() : null;
- }else if (source instanceof Map){
- return (T) ((Map)source).get(key);
- }
- }
- return null;
- });
- }
+
/**
* Use default value loader: (string, JobParamSet) -> ?
* @param key key
* @param mappingKey mapping key
* @return
*/
- @SuppressWarnings({"unchecked", "rawtypes"})
- public static JobParamDefine define(String key, String mappingKey){
- return new JobParamDefine<>(key, (paramKey, source) -> {
- if(Objects.nonNull(source)){
- if(source instanceof JobParamSet) {
- JobParam> result = ((JobParamSet)source).remove(mappingKey);
- return Objects.nonNull(result)? (U)result.getValue() : null;
- }else if (source instanceof Map){
- return (U) ((Map)source).remove(mappingKey);
- }
- }
- return null;
- });
+ public static JobParamDefine define(String key, String mappingKey){
+ return define(key, new String[]{mappingKey}, result-> result, (Class)null);
+ }
+
+ public static JobParamDefine define(String key, String mappingKey, Function transform, Class inputType){
+ return define(key, new String[]{mappingKey}, transform, inputType);
}
@SuppressWarnings({"unchecked", "rawtypes"})
- public static JobParamDefine define(String key, String mappingKey, Class valueType){
- return new JobParamDefine(key, (paramKey, source) -> {
- if(Objects.nonNull(source)){
- if(source instanceof JobParamSet) {
- JobParam> result = ((JobParamSet)source).remove(mappingKey);
- return Objects.nonNull(result)? (T)result.getValue() : null;
- }else if (source instanceof Map){
- return (T) ((Map)source).remove(mappingKey);
+ private static JobParamDefine define(String key, String[] mappingKeys, Function transform, Class inputType){
+ return new JobParamDefine<>(key, (paramKey, source) -> {
+ if (Objects.nonNull(source)) {
+ if (source instanceof JobParamSet) {
+ for (String mappingKey : mappingKeys) {
+ JobParam> result = ((JobParamSet) source).remove(mappingKey);
+ if (Objects.nonNull(result)) {
+ return transform.apply((U)result.getValue());
+ }
+ }
+ return null;
+ } else if (source instanceof Map) {
+ for (String mappingKey : mappingKeys) {
+ Object result = ((Map) source).remove(mappingKey);
+ if (Objects.nonNull(result)) {
+ return transform.apply((U)result);
+ }
+ }
+ return null;
}
}
return null;
@@ -96,8 +95,25 @@ public static JobParamDefine define(String key, String mappingKey, Class
* @return
*/
+ @SuppressWarnings({"unchecked", "rawtypes"})
public static JobParamDefine define(String key, Supplier operator){
- return new JobParamDefine<>(key, (paramKey, source) -> operator.get());
+ return new JobParamDefine<>(key, (paramKey, source) -> {
+ T finalValue = null;
+ if (Objects.nonNull(source)) {
+ if (source instanceof JobParamSet) {
+ JobParam> result = ((JobParamSet) source).get(key);
+ if (Objects.nonNull(result)){
+ finalValue = (T)result.getValue();
+ }
+ } else if (source instanceof Map) {
+ Object result = ((Map) source).get(key);
+ if (Objects.nonNull(result)){
+ return (T)result;
+ }
+ }
+ }
+ return Objects.nonNull(finalValue) ? finalValue : operator.get();
+ });
}
public static JobParam newOne(String key, T value){
diff --git a/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/enums/EngineTypeEnum.java b/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/enums/EngineTypeEnum.java
index 89902f901..a6ccf9f51 100644
--- a/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/enums/EngineTypeEnum.java
+++ b/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/enums/EngineTypeEnum.java
@@ -1,5 +1,5 @@
package com.webank.wedatasphere.exchangis.job.enums;
public enum EngineTypeEnum {
- DATAX, SQOOP, DICTCOPY;
+ DATAX, SQOOP, DICTCOPY, NONE
}
diff --git a/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/exception/ExchangisJobExceptionCode.java b/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/exception/ExchangisJobExceptionCode.java
index 9e08768be..fd1609ccd 100644
--- a/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/exception/ExchangisJobExceptionCode.java
+++ b/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/exception/ExchangisJobExceptionCode.java
@@ -4,6 +4,7 @@
* Exception code, range:(31000 ~ 31999), the same as "ExchangisDataSourceExceptionCode"
*/
public enum ExchangisJobExceptionCode {
+ RENDER_TRANSFORM_ERROR(31885),
METRICS_OP_ERROR(31886),
TASK_LAUNCH_NOT_EXIST(31887),
TASK_LAUNCH_ERROR(31888),
@@ -13,12 +14,13 @@ public enum ExchangisJobExceptionCode {
TASK_OBSERVER_ERROR(31992),
ON_EVENT_ERROR(31993),
SCHEDULER_ERROR(31994),
- TASK_BUILDER_ERROR(31995),
+ JOB_BUILDER_ERROR(31995),
UNSUPPORTED_TASK_LAUNCH_ENGINE(31996),
TASK_GENERATE_ERROR(31997),
JOB_EXCEPTION_CODE(31999),
- ENGINE_JOB_ERROR(31998),
- TRANSFORM_JOB_ERROR(31998);
+ BUILDER_ENGINE_ERROR(31998),
+ BUILDER_TRANSFORM_ERROR(31998),
+ UNSUPPORTED_OPERATION(31999);
private int code;
ExchangisJobExceptionCode(int code) {
diff --git a/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/vo/ExchangisJobQueryVo.java b/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/vo/ExchangisJobQueryVo.java
index d0ba5d4f9..3806e8c44 100644
--- a/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/vo/ExchangisJobQueryVo.java
+++ b/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/vo/ExchangisJobQueryVo.java
@@ -4,8 +4,15 @@
public class ExchangisJobQueryVo extends ExchangisJobPageQuery {
+ private static final Integer defaultCurrentPage = 1;
+
+ private static final Integer defaultPageSize = 10;
+
public ExchangisJobQueryVo(){
+ }
+ public ExchangisJobQueryVo(Long projectId, String jobType, String name) {
+ this(projectId, jobType, name, defaultCurrentPage, defaultPageSize);
}
public ExchangisJobQueryVo(Long projectId, String jobType,
diff --git a/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/vo/ExchangisJobVo.java b/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/vo/ExchangisJobVo.java
index b97f77ad3..6bc16b717 100644
--- a/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/vo/ExchangisJobVo.java
+++ b/exchangis-job/exchangis-job-common/src/main/java/com/webank/wedatasphere/exchangis/job/vo/ExchangisJobVo.java
@@ -3,7 +3,7 @@
import com.webank.wedatasphere.exchangis.common.validator.groups.InsertGroup;
-import com.webank.wedatasphere.exchangis.job.domain.ExchangisJobInfo;
+import com.webank.wedatasphere.exchangis.job.domain.ExchangisJobEntity;
import org.hibernate.validator.constraints.NotBlank;
import javax.validation.constraints.NotNull;
@@ -115,20 +115,21 @@ public ExchangisJobVo(){
}
- public ExchangisJobVo(ExchangisJobInfo jobInfo){
- if (Objects.nonNull(jobInfo)) {
- this.id = jobInfo.getId();
- this.engineType = jobInfo.getEngineType();
- this.jobDesc = jobInfo.getJobDesc();
- this.jobLabels = jobInfo.getJobLabel();
- this.jobName = jobInfo.getName();
- this.jobType = jobInfo.getJobType();
- this.createTime = jobInfo.getCreateTime();
- this.createUser = jobInfo.getCreateUser();
- this.modifyTime = jobInfo.getLastUpdateTime();
- this.jobParams = jobInfo.getJobParams();
- this.executeUser = jobInfo.getExecuteUser();
- this.proxyUser = jobInfo.getExecuteUser();
+ public ExchangisJobVo(ExchangisJobEntity jobEntity){
+ if (Objects.nonNull(jobEntity)) {
+ this.id = jobEntity.getId();
+ this.projectId = jobEntity.getProjectId();
+ this.engineType = jobEntity.getEngineType();
+ this.jobDesc = jobEntity.getJobDesc();
+ this.jobLabels = jobEntity.getJobLabel();
+ this.jobName = jobEntity.getName();
+ this.jobType = jobEntity.getJobType();
+ this.createTime = jobEntity.getCreateTime();
+ this.createUser = jobEntity.getCreateUser();
+ this.modifyTime = jobEntity.getLastUpdateTime();
+ this.jobParams = jobEntity.getJobParams();
+ this.executeUser = jobEntity.getExecuteUser();
+ this.proxyUser = jobEntity.getExecuteUser();
}
}
diff --git a/exchangis-job/exchangis-job-launcher/pom.xml b/exchangis-job/exchangis-job-launcher/pom.xml
index 41bb083b9..2375cdea3 100644
--- a/exchangis-job/exchangis-job-launcher/pom.xml
+++ b/exchangis-job/exchangis-job-launcher/pom.xml
@@ -5,7 +5,7 @@
exchangis-job
com.webank.wedatasphere.exchangis
- 1.0.0
+ 1.1.2
4.0.0
@@ -15,12 +15,12 @@
com.webank.wedatasphere.exchangis
exchangis-job-common
- 1.0.0
+ 1.1.2
com.webank.wedatasphere.exchangis
exchangis-job-builder
- 1.0.0
+ 1.1.2
org.apache.linkis
diff --git a/exchangis-job/exchangis-job-launcher/src/main/java/com/webank/wedatasphere/exchangis/job/launcher/ExchangisLauncherConfiguration.java b/exchangis-job/exchangis-job-launcher/src/main/java/com/webank/wedatasphere/exchangis/job/launcher/ExchangisLauncherConfiguration.java
index 3ba907a48..4f3c714b6 100644
--- a/exchangis-job/exchangis-job-launcher/src/main/java/com/webank/wedatasphere/exchangis/job/launcher/ExchangisLauncherConfiguration.java
+++ b/exchangis-job/exchangis-job-launcher/src/main/java/com/webank/wedatasphere/exchangis/job/launcher/ExchangisLauncherConfiguration.java
@@ -14,6 +14,12 @@ public class ExchangisLauncherConfiguration {
public static final String LAUNCHER_LINKIS_REQUEST_MEMORY = "wds.linkis.engineconn.java.driver.memory";
+ public static final String LAUNCHER_LINKIS_RESOURCES = "wds.linkis.engineconn.${engine}.bml.resources";
+
+ public static final String LAUNCHER_LINKIS_EXEC_ID = "wds.linkis.engineconn.${engine}.execution.id";
+
+ public static final String LAUNCHER_LINKIS_CUSTOM_PARAM_PREFIX = "_${engine}_.";
+
public static final CommonVars LAUNCHER_LINKIS_CREATOR = CommonVars.apply("wds.exchangis.job.task.launcher.linkis.creator", "exchangis");
public static final CommonVars LAUNCHER_LINKIS_ENGINE_CONN_MODE = CommonVars.apply("wds.exchangis.job.task.launcher.linkis.engineConn.mode", "once");
@@ -22,7 +28,6 @@ public class ExchangisLauncherConfiguration {
public static final CommonVars LAUNCHER_LINKIS_MAX_ERROR = CommonVars.apply("wds.exchangis.job.task.launcher.linkis.max.error", 3);
- public static final CommonVars LINKIS_SERVER_URL = CommonVars.apply("wds.exchangis.client.linkis.server-url", "http://127.0.0.1:9001");
+ public static final CommonVars LIMIT_INTERFACE = CommonVars.apply("wds.exchangis.limit.interface.value", true);
- public static final CommonVars LINKIS_TOKEN_VALUE = CommonVars.apply("wds.exchangis.client.linkis.token.value", "EXCHANGIS-TOKEN");
}
diff --git a/exchangis-job/exchangis-job-launcher/src/main/java/com/webank/wedatasphere/exchangis/job/launcher/builder/LinkisExchangisLauncherJobBuilder.java b/exchangis-job/exchangis-job-launcher/src/main/java/com/webank/wedatasphere/exchangis/job/launcher/builder/LinkisExchangisLauncherJobBuilder.java
index 8b6fda944..82386557d 100644
--- a/exchangis-job/exchangis-job-launcher/src/main/java/com/webank/wedatasphere/exchangis/job/launcher/builder/LinkisExchangisLauncherJobBuilder.java
+++ b/exchangis-job/exchangis-job-launcher/src/main/java/com/webank/wedatasphere/exchangis/job/launcher/builder/LinkisExchangisLauncherJobBuilder.java
@@ -1,16 +1,22 @@
package com.webank.wedatasphere.exchangis.job.launcher.builder;
+import com.webank.wedatasphere.exchangis.engine.domain.EngineResource;
import com.webank.wedatasphere.exchangis.job.builder.ExchangisJobBuilderContext;
import com.webank.wedatasphere.exchangis.job.builder.api.AbstractExchangisJobBuilder;
import com.webank.wedatasphere.exchangis.job.domain.ExchangisEngineJob;
import com.webank.wedatasphere.exchangis.job.exception.ExchangisJobException;
import com.webank.wedatasphere.exchangis.job.launcher.domain.LaunchableExchangisTask;
import com.webank.wedatasphere.exchangis.job.utils.MemUtils;
+import org.apache.linkis.datasourcemanager.common.exception.JsonErrorException;
+import org.apache.linkis.datasourcemanager.common.util.PatternInjectUtils;
+import org.apache.linkis.datasourcemanager.common.util.json.Json;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Objects;
+import java.util.*;
+import java.util.stream.Collectors;
+import static com.webank.wedatasphere.exchangis.job.exception.ExchangisJobExceptionCode.TASK_EXECUTE_ERROR;
import static com.webank.wedatasphere.exchangis.job.launcher.ExchangisLauncherConfiguration.*;
/**
@@ -21,8 +27,11 @@ public class LinkisExchangisLauncherJobBuilder extends AbstractExchangisJobBuild
private static final String LAUNCHER_NAME = "Linkis";
+ private static final Logger LOG = LoggerFactory.getLogger(LinkisExchangisLauncherJobBuilder.class);
+
@Override
public LaunchableExchangisTask buildJob(ExchangisEngineJob inputJob, LaunchableExchangisTask expectOut, ExchangisJobBuilderContext ctx) throws ExchangisJobException {
+ String engine = inputJob.getEngineType().toLowerCase(Locale.ROOT);
LaunchableExchangisTask launchableTask = new LaunchableExchangisTask();
launchableTask.setName(inputJob.getName());
launchableTask.setJobId(inputJob.getId());
@@ -31,11 +40,29 @@ public LaunchableExchangisTask buildJob(ExchangisEngineJob inputJob, LaunchableE
launchableTask.setLinkisContentMap(inputJob.getJobContent());
Map linkisParams = new HashMap<>();
Map startUpParams = new HashMap<>();
- linkisParams.put(LAUNCHER_LINKIS_RUNTIME_PARAM_NAME, inputJob.getRuntimeParams());
linkisParams.put(LAUNCHER_LINKIS_STARTUP_PARAM_NAME, startUpParams);
- long memoryUsed = Objects.nonNull(inputJob.getMemoryUsed())? MemUtils.convertToGB(inputJob.getMemoryUsed(),
- inputJob.getMemoryUnit()) : 0;
- startUpParams.put(LAUNCHER_LINKIS_REQUEST_MEMORY, String.valueOf(memoryUsed <= 0 ? 1 : memoryUsed));
+ try {
+ String customParamPrefix = PatternInjectUtils.inject(LAUNCHER_LINKIS_CUSTOM_PARAM_PREFIX, new String[]{engine});
+ // Add the runtime params to startup params for once job
+ startUpParams.putAll(appendPrefixToParams(customParamPrefix, inputJob.getRuntimeParams()));
+ } catch (JsonErrorException e) {
+ throw new ExchangisJobException(TASK_EXECUTE_ERROR.getCode(), "Fail to convert custom params for launching", e);
+ }
+ long memoryUsed = Optional.ofNullable(inputJob.getMemoryUsed()).orElse(0L);
+ if (!inputJob.isMemoryUnitLock() && memoryUsed > 0){
+ memoryUsed = MemUtils.convertToGB(inputJob.getMemoryUsed(), inputJob.getMemoryUnit());
+ inputJob.setMemoryUnit("G");
+ }
+ startUpParams.put(LAUNCHER_LINKIS_REQUEST_MEMORY, (memoryUsed <= 0 ? 1 : memoryUsed) + inputJob.getMemoryUnit());
+ List resources = inputJob.getResources();
+ if (!resources.isEmpty()){
+ try {
+ LOG.info("Use the engine resources: {} for job/task: [{}]", Json.toJson(resources, null), inputJob.getName());
+ startUpParams.put(PatternInjectUtils.inject(LAUNCHER_LINKIS_RESOURCES, new String[]{engine}), Json.toJson(resources, null));
+ } catch (JsonErrorException e) {
+ throw new ExchangisJobException(TASK_EXECUTE_ERROR.getCode(), "Fail to use engine resources", e);
+ }
+ }
launchableTask.setLinkisParamsMap(linkisParams);
launchableTask.setEngineType(inputJob.getEngineType());
launchableTask.setLabels(inputJob.getJobLabel());
@@ -44,4 +71,15 @@ public LaunchableExchangisTask buildJob(ExchangisEngineJob inputJob, LaunchableE
launchableTask.setLinkisJobName(LAUNCHER_NAME);
return launchableTask;
}
+
+ /**
+ * Append prefix to params
+ * @param prefix prefix
+ * @param customParams custom params
+ * @return params
+ */
+ private Map appendPrefixToParams(String prefix, Map customParams){
+ return customParams.entrySet().stream().collect(Collectors.toMap(entry -> prefix + entry.getKey(),
+ Map.Entry::getValue));
+ }
}
diff --git a/exchangis-job/exchangis-job-launcher/src/main/java/com/webank/wedatasphere/exchangis/job/launcher/linkis/LinkisExchangisTaskLauncher.java b/exchangis-job/exchangis-job-launcher/src/main/java/com/webank/wedatasphere/exchangis/job/launcher/linkis/LinkisExchangisTaskLauncher.java
index d719b8c67..d5ef7e8e0 100644
--- a/exchangis-job/exchangis-job-launcher/src/main/java/com/webank/wedatasphere/exchangis/job/launcher/linkis/LinkisExchangisTaskLauncher.java
+++ b/exchangis-job/exchangis-job-launcher/src/main/java/com/webank/wedatasphere/exchangis/job/launcher/linkis/LinkisExchangisTaskLauncher.java
@@ -1,19 +1,29 @@
package com.webank.wedatasphere.exchangis.job.launcher.linkis;
-import com.webank.wedatasphere.exchangis.job.domain.ExchangisTask;
+import com.webank.wedatasphere.exchangis.common.linkis.ClientConfiguration;
import com.webank.wedatasphere.exchangis.job.enums.EngineTypeEnum;
import com.webank.wedatasphere.exchangis.job.launcher.AccessibleLauncherTask;
import com.webank.wedatasphere.exchangis.job.launcher.exception.ExchangisTaskLaunchException;
-import com.webank.wedatasphere.exchangis.job.launcher.ExchangisLauncherConfiguration;
import com.webank.wedatasphere.exchangis.job.launcher.ExchangisTaskLaunchManager;
import com.webank.wedatasphere.exchangis.job.launcher.ExchangisTaskLauncher;
import com.webank.wedatasphere.exchangis.job.launcher.domain.LaunchableExchangisTask;
import com.webank.wedatasphere.exchangis.job.launcher.domain.LaunchedExchangisTask;
import org.apache.commons.lang.StringUtils;
-import org.apache.linkis.computation.client.LinkisJobBuilder;
+import org.apache.linkis.common.conf.Configuration;
+import org.apache.linkis.common.conf.Configuration$;
+import org.apache.linkis.common.exception.LinkisRetryException;
+import org.apache.linkis.common.utils.DefaultRetryHandler;
+import org.apache.linkis.common.utils.RetryHandler;
import org.apache.linkis.computation.client.LinkisJobClient;
+import org.apache.linkis.computation.client.LinkisJobClient$;
+import org.apache.linkis.httpclient.config.ClientConfig;
+import org.apache.linkis.httpclient.dws.authentication.TokenAuthenticationStrategy;
+import org.apache.linkis.httpclient.dws.config.DWSClientConfig;
+import org.apache.linkis.httpclient.dws.config.DWSClientConfigBuilder;
+import org.apache.linkis.httpclient.dws.config.DWSClientConfigBuilder$;
import java.util.*;
+import java.util.concurrent.TimeUnit;
/**
* Linkis task launcher
@@ -35,8 +45,25 @@ public String name() {
public void init(ExchangisTaskLaunchManager jobLaunchManager) {
this.engineVersions.put(EngineTypeEnum.SQOOP.name().toLowerCase(), "1.4.6");
this.engineVersions.put(EngineTypeEnum.DATAX.name().toLowerCase(), "3.0.0");
- LinkisJobClient.config().setDefaultAuthToken(ExchangisLauncherConfiguration.LINKIS_TOKEN_VALUE.getValue());
- LinkisJobClient.config().setDefaultServerUrl(ExchangisLauncherConfiguration.LINKIS_SERVER_URL.getValue());
+ RetryHandler retryHandler = new DefaultRetryHandler(){};
+ retryHandler.addRetryException(LinkisRetryException.class);
+ ClientConfig clientConfig = DWSClientConfigBuilder$.MODULE$
+ .newBuilder()
+ .setDWSVersion(Configuration.LINKIS_WEB_VERSION().getValue())
+ .addServerUrl(ClientConfiguration.LINKIS_SERVER_URL.getValue())
+ .connectionTimeout(45000)
+ .discoveryEnabled(false)
+ .discoveryFrequency(1, TimeUnit.MINUTES)
+ .loadbalancerEnabled(false)
+ .maxConnectionSize(ClientConfiguration.LINKIS_DEFAULT_MAX_CONNECTIONS.getValue())
+ .retryEnabled(true)
+ .setRetryHandler(retryHandler)
+ .readTimeout(90000) // We think 90s is enough, if SocketTimeoutException is throw, just set a new clientConfig to modify it.
+ .setAuthenticationStrategy(new TokenAuthenticationStrategy())
+ .setAuthTokenKey(TokenAuthenticationStrategy.TOKEN_KEY())
+ .setAuthTokenValue(ClientConfiguration.LINKIS_TOKEN_VALUE.getValue())
+ .build();
+ LinkisJobClient$.MODULE$.config().setDefaultClientConfig((DWSClientConfig) clientConfig);
}
@Override
diff --git a/exchangis-job/exchangis-job-launcher/src/main/java/com/webank/wedatasphere/exchangis/job/launcher/linkis/LinkisLauncherTask.java b/exchangis-job/exchangis-job-launcher/src/main/java/com/webank/wedatasphere/exchangis/job/launcher/linkis/LinkisLauncherTask.java
index 19c0e3a5f..408fdc43b 100644
--- a/exchangis-job/exchangis-job-launcher/src/main/java/com/webank/wedatasphere/exchangis/job/launcher/linkis/LinkisLauncherTask.java
+++ b/exchangis-job/exchangis-job-launcher/src/main/java/com/webank/wedatasphere/exchangis/job/launcher/linkis/LinkisLauncherTask.java
@@ -17,6 +17,8 @@
import org.apache.linkis.computation.client.once.simple.SubmittableSimpleOnceJob;
import org.apache.linkis.computation.client.operator.impl.*;
import org.apache.linkis.computation.client.utils.LabelKeyUtils;
+import org.apache.linkis.datasourcemanager.common.exception.JsonErrorException;
+import org.apache.linkis.datasourcemanager.common.util.PatternInjectUtils;
import org.apache.linkis.protocol.engine.JobProgressInfo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -122,15 +124,22 @@ public TaskStatus getStatus() throws ExchangisTaskLaunchException {
String linkisJobStatus = this.onceJob.getStatus(this.jobInfo);
if ("success".equalsIgnoreCase(linkisJobStatus)) {
this.status = TaskStatus.Success;
- } else if ("failed".equalsIgnoreCase(linkisJobStatus)) {
+ } else if ("failed".equalsIgnoreCase(linkisJobStatus)){
this.status = TaskStatus.Failed;
+ } else if ("shuttingdown".equalsIgnoreCase(linkisJobStatus)) {
+ LOG.warn("Will retry on linkis job status: [{}]", linkisJobStatus);
+ // Retry on shutting down status
+ this.status = TaskStatus.WaitForRetry;
} else {
this.status = TaskStatus.Running;
}
+ // Init the error count
+ this.reqError.set(0);
} catch (Exception e){
try {
dealException(e);
} catch (ExchangisTaskNotExistException ne){
+ LOG.warn("Not find the launcher task in exchangis", e);
this.status = TaskStatus.Failed;
}
}
@@ -149,7 +158,10 @@ public Map getMetricsInfo() throws ExchangisTaskLaunchException
try{
// Invoke getStatus() to get real time status
if(!TaskStatus.isCompleted(getStatus())){
- return (Map)this.metricsOperator.apply();
+ Map metrics = (Map)this.metricsOperator.apply();
+ // Init the error count
+ this.reqError.set(0);
+ return metrics;
}
}catch(Exception e){
dealException(e);
@@ -182,6 +194,8 @@ public TaskProgressInfo getProgressInfo() throws ExchangisTaskLaunchException {
}
this.progressInfo.setProgress(1.0f);
}
+ // Init the error count
+ this.reqError.set(0);
} catch(Exception e){
dealException(e);
}
@@ -195,6 +209,8 @@ public void kill() throws ExchangisTaskLaunchException {
try{
this.onceJob.kill();
this.status = TaskStatus.Cancelled;
+ // Init the error count
+ this.reqError.set(0);
}catch(Exception e){
dealException(e);
}
@@ -221,6 +237,8 @@ public LogResult queryLogs(LogQuery query) throws ExchangisTaskLaunchException {
if (isEnd){
isEnd = TaskStatus.isCompleted(getStatus());
}
+ // Init the error count
+ this.reqError.set(0);
return new LogResult(logs.endLine(), isEnd, logs.logs());
} catch (Exception e){
dealException(e);
@@ -237,6 +255,10 @@ public synchronized void submit() throws ExchangisTaskLaunchException {
}
try {
((SubmittableOnceJob) this.onceJob).submit();
+ TaskStatus status = getStatus();
+ if (status == TaskStatus.Undefined || status == TaskStatus.WaitForRetry){
+ throw new ExchangisTaskLaunchException("Fail to submit to linkis server with unexpected final status: [" + status + "]", null);
+ }
// New the operators for job
prepareOperators(this.onceJob);
Map jobInfo = getJobInfo(false);
@@ -272,6 +294,12 @@ private SimpleOnceJob toSubmittableJob(LaunchableExchangisTask task){
jobBuilder.setStartupParams((Map) startupParams);
}
});
+ try {
+ jobBuilder.addStartupParam(PatternInjectUtils.inject(LAUNCHER_LINKIS_EXEC_ID,
+ new String[]{task.getEngineType().toLowerCase(Locale.ROOT)}), task.getId());
+ } catch (JsonErrorException e) {
+ //Ignore
+ }
return jobBuilder.build();
}
diff --git a/exchangis-job/exchangis-job-metrics/pom.xml b/exchangis-job/exchangis-job-metrics/pom.xml
index 5b1c569fb..9dcdd12fb 100644
--- a/exchangis-job/exchangis-job-metrics/pom.xml
+++ b/exchangis-job/exchangis-job-metrics/pom.xml
@@ -5,7 +5,7 @@
exchangis-job
com.webank.wedatasphere.exchangis
- 1.0.0
+ 1.1.2
4.0.0
diff --git a/exchangis-job/exchangis-job-server/pom.xml b/exchangis-job/exchangis-job-server/pom.xml
index 6751bc6c1..60c64165e 100644
--- a/exchangis-job/exchangis-job-server/pom.xml
+++ b/exchangis-job/exchangis-job-server/pom.xml
@@ -5,7 +5,7 @@
exchangis-job
com.webank.wedatasphere.exchangis
- 1.0.0
+ 1.1.2
4.0.0
@@ -17,22 +17,25 @@
-
com.webank.wedatasphere.exchangis
- exchangis-job-common
- 1.0.0
+ exchangis-project-provider
+ 1.1.2
+
+
+ com.webank.wedatasphere.exchangis
+ exchangis-job-launcher
+ 1.1.2
-
com.webank.wedatasphere.exchangis
exchangis-datasource-service
- 1.0.0
+ 1.1.2
com.webank.wedatasphere.exchangis
- exchangis-job-launcher
- 1.0.0
+ exchangis-engine-core
+ ${exchangis.version}
@@ -46,12 +49,6 @@
mysql-connector-java
5.1.49
-
- com.webank.wedatasphere.exchangis
- exchangis-project-server
- 1.0.0
- compile
-
diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/ExchangisJobExecuteAutoConfiguration.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/ExchangisJobExecuteAutoConfiguration.java
index 6faa97ceb..0c3391d94 100644
--- a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/ExchangisJobExecuteAutoConfiguration.java
+++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/ExchangisJobExecuteAutoConfiguration.java
@@ -1,6 +1,5 @@
package com.webank.wedatasphere.exchangis.job.server;
-import com.webank.wedatasphere.exchangis.datasource.core.service.MetadataInfoService;
import com.webank.wedatasphere.exchangis.job.builder.manager.ExchangisJobBuilderManager;
import com.webank.wedatasphere.exchangis.job.launcher.ExchangisTaskLaunchManager;
import com.webank.wedatasphere.exchangis.job.launcher.domain.LaunchableExchangisTask;
@@ -22,13 +21,14 @@
import com.webank.wedatasphere.exchangis.job.server.log.DefaultRpcJobLogger;
import com.webank.wedatasphere.exchangis.job.server.log.JobLogService;
import com.webank.wedatasphere.exchangis.job.server.log.service.LocalSimpleJobLogService;
+import com.webank.wedatasphere.exchangis.job.server.utils.SpringContextHolder;
import org.apache.linkis.scheduler.Scheduler;
import org.apache.linkis.scheduler.executer.ExecutorManager;
import org.apache.linkis.scheduler.queue.ConsumerManager;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.DependsOn;
import java.util.List;
import java.util.Objects;
@@ -38,6 +38,7 @@
* Auto configure the beans in job execution
*/
@Configuration
+@DependsOn("springContextHolder")
public class ExchangisJobExecuteAutoConfiguration {
@Bean
@@ -64,9 +65,8 @@ public ExchangisJobBuilderManager jobBuilderManager(){
@Bean
@ConditionalOnMissingBean(TaskGeneratorContext.class)
- public TaskGeneratorContext taskGeneratorContext(JobLogListener jobLogListener,
- MetadataInfoService metadataInfoService){
- return new DefaultTaskGeneratorContext(jobLogListener, metadataInfoService);
+ public TaskGeneratorContext taskGeneratorContext(JobLogListener jobLogListener){
+ return new SpringTaskGeneratorContext(jobLogListener, SpringContextHolder.getApplicationContext());
}
/**
diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/ExchangisJobRenderAutoConfiguration.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/ExchangisJobRenderAutoConfiguration.java
new file mode 100644
index 000000000..43af16c15
--- /dev/null
+++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/ExchangisJobRenderAutoConfiguration.java
@@ -0,0 +1,83 @@
+package com.webank.wedatasphere.exchangis.job.server;
+
+import com.webank.wedatasphere.exchangis.job.server.mapper.JobTransformRuleDao;
+import com.webank.wedatasphere.exchangis.job.server.render.transform.*;
+import com.webank.wedatasphere.exchangis.job.server.render.transform.def.DefaultTransformDefineRulesFusion;
+import com.webank.wedatasphere.exchangis.job.server.render.transform.field.mapping.DefaultFieldMappingRulesFusion;
+import com.webank.wedatasphere.exchangis.job.server.render.transform.field.mapping.FieldMappingRulesFusion;
+import com.webank.wedatasphere.exchangis.job.server.render.transform.field.mapping.FieldMappingTransformer;
+import com.webank.wedatasphere.exchangis.job.server.render.transform.field.mapping.match.*;
+import com.webank.wedatasphere.exchangis.job.server.render.transform.processor.ProcessorTransformer;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.DependsOn;
+
+import java.util.List;
+import java.util.Optional;
+
+@Configuration
+@DependsOn("springContextHolder")
+public class ExchangisJobRenderAutoConfiguration {
+
+ /**
+ * Field match strategy factory
+ * @return factory
+ */
+ @Bean
+ @ConditionalOnMissingBean(FieldMatchNamedStrategyFactory.class)
+ public FieldMatchStrategyFactory matchStrategyFactory(){
+ FieldMatchNamedStrategyFactory namedStrategyFactory = new FieldMatchNamedStrategyFactory();
+ namedStrategyFactory.registerStrategy(FieldAllMatchStrategy.ALL_MATCH, new FieldAllMatchStrategy());
+ namedStrategyFactory.registerStrategy(FieldAllMatchIgnoreCaseStrategy.ALL_MATCH_IGNORE_CASE, new FieldAllMatchIgnoreCaseStrategy());
+ namedStrategyFactory.registerStrategy(FieldCamelCaseMatchStrategy.CAMEL_CASE_MATCH, new FieldCamelCaseMatchStrategy());
+ return namedStrategyFactory;
+ }
+ /**
+ * Field mapping rule fusion
+ * @param strategyFactory match strategy factory
+ * @return rule fusion
+ */
+ @Bean
+ @ConditionalOnMissingBean(FieldMappingRulesFusion.class)
+ public FieldMappingRulesFusion fieldMappingRulesFusion(FieldMatchStrategyFactory strategyFactory){
+ return new DefaultFieldMappingRulesFusion(strategyFactory);
+ }
+ /**
+ * Transform definition rule fusion
+ * @return fusion
+ */
+ @Bean
+ public TransformRulesFusion defineRuleFusion(){
+ return new DefaultTransformDefineRulesFusion();
+ }
+ /**
+ * Field mapping transformer
+ * @param rulesFusion rule fusion
+ * @param transformRuleDao transform rule dao
+ * @return transformer
+ */
+ @Bean
+ public FieldMappingTransformer fieldMappingTransformer(FieldMappingRulesFusion rulesFusion, JobTransformRuleDao transformRuleDao){
+ return new FieldMappingTransformer(rulesFusion, transformRuleDao);
+ }
+ /**
+ * Processor transformer
+ * @return transformer
+ */
+ @Bean
+ public ProcessorTransformer processorTransformer(){
+ return new ProcessorTransformer();
+ }
+
+ @Bean
+ @ConditionalOnMissingBean(TransformerContainer.class)
+ public TransformerContainer transformerContainer(List transformers){
+ TransformerContainer container = new DefaultTransformContainer();
+ Optional.ofNullable(transformers).ifPresent(elements -> {
+ elements.forEach(element -> container.registerTransformer(element.name(), element));
+ });
+ return container;
+ }
+
+}
diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/builder/engine/AbstractLoggingExchangisJobBuilder.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/builder/AbstractLoggingExchangisJobBuilder.java
similarity index 53%
rename from exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/builder/engine/AbstractLoggingExchangisJobBuilder.java
rename to exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/builder/AbstractLoggingExchangisJobBuilder.java
index 26b1bc672..d2dbba1da 100644
--- a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/builder/engine/AbstractLoggingExchangisJobBuilder.java
+++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/builder/AbstractLoggingExchangisJobBuilder.java
@@ -1,29 +1,30 @@
-package com.webank.wedatasphere.exchangis.job.server.builder.engine;
+package com.webank.wedatasphere.exchangis.job.server.builder;
import com.webank.wedatasphere.exchangis.job.builder.ExchangisJobBuilderContext;
import com.webank.wedatasphere.exchangis.job.builder.api.AbstractExchangisJobBuilder;
import com.webank.wedatasphere.exchangis.job.domain.ExchangisBase;
import com.webank.wedatasphere.exchangis.job.domain.ExchangisJob;
import com.webank.wedatasphere.exchangis.job.exception.ExchangisJobException;
-import com.webank.wedatasphere.exchangis.job.server.builder.ServiceInExchangisJobBuilderContext;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* Abstract implement for engine job builder
*/
public abstract class AbstractLoggingExchangisJobBuilder extends
AbstractExchangisJobBuilder {
-
+ private static final Logger LOG = LoggerFactory.getLogger(AbstractLoggingExchangisJobBuilder.class);
/**
* Get builder context
* @return context
* @throws ExchangisJobException.Runtime exception
*/
- protected static ServiceInExchangisJobBuilderContext getServiceInBuilderContext() throws ExchangisJobException.Runtime{
+ protected static SpringExchangisJobBuilderContext getSpringBuilderContext() throws ExchangisJobException.Runtime{
ExchangisJobBuilderContext context = getCurrentBuilderContext();
- if (!(context instanceof ServiceInExchangisJobBuilderContext)) {
- throw new ExchangisJobException.Runtime(-1, "The job builder context cannot not be casted to " + ServiceInExchangisJobBuilderContext.class.getCanonicalName(), null);
+ if (!(context instanceof SpringExchangisJobBuilderContext)) {
+ throw new ExchangisJobException.Runtime(-1, "The job builder context cannot not be casted to " + SpringExchangisJobBuilderContext.class.getCanonicalName(), null);
}
- return (ServiceInExchangisJobBuilderContext)context;
+ return (SpringExchangisJobBuilderContext)context;
}
/**
@@ -31,11 +32,11 @@ protected static ServiceInExchangisJobBuilderContext getServiceInBuilderContext(
* @param message message
*/
public static void warn(String message, Object... args){
- getServiceInBuilderContext().getLogging().warn(null, message, args);
+ getSpringBuilderContext().getLogging().warn(null, message, args);
}
public static void warn(String message, Throwable t){
- getServiceInBuilderContext().getLogging().warn(null, message, t);
+ getSpringBuilderContext().getLogging().warn(null, message, t);
}
/**
@@ -43,10 +44,20 @@ public static void warn(String message, Throwable t){
* @param message message
*/
public static void info(String message, Object... args){
- getServiceInBuilderContext().getLogging().info(null, message, args);
+ getSpringBuilderContext().getLogging().info(null, message, args);
}
public static void info(String message, Throwable t){
- getServiceInBuilderContext().getLogging().info(null, message, t);
+ getSpringBuilderContext().getLogging().info(null, message, t);
+ }
+
+ /**
+ * Get bean in spring context
+ * @param beanClass bean class
+ * @param
+ * @return
+ */
+ public static T getBean(Class beanClass){
+ return getSpringBuilderContext().getBean(beanClass);
}
}
diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/builder/JobParamConstraints.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/builder/JobParamConstraints.java
index b5a65807d..dd79b28c2 100644
--- a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/builder/JobParamConstraints.java
+++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/builder/JobParamConstraints.java
@@ -5,6 +5,10 @@
*/
public class JobParamConstraints {
+ public static final String ENCODING = "encoding";
+
+ public static final String NULL_FORMAT = "nullFormat";
+
public static final String DATA_SOURCE_ID = "data_source_id";
public static final String USERNAME = "username";
@@ -21,6 +25,8 @@ public class JobParamConstraints {
public static final String PORT = "port";
+ public static final String SERVICE_NAME = "instance";
+
public static final String WHERE = "where";
public static final String WRITE_MODE = "writeMode";
diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/builder/ServiceInExchangisJobBuilderContext.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/builder/SpringExchangisJobBuilderContext.java
similarity index 77%
rename from exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/builder/ServiceInExchangisJobBuilderContext.java
rename to exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/builder/SpringExchangisJobBuilderContext.java
index 2f73f7ca0..ad5811a7b 100644
--- a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/builder/ServiceInExchangisJobBuilderContext.java
+++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/builder/SpringExchangisJobBuilderContext.java
@@ -9,18 +9,15 @@
import com.webank.wedatasphere.exchangis.job.server.log.JobServerLogging;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import org.springframework.context.ApplicationContext;
import java.util.Objects;
/**
* Service in job builder context
*/
-public class ServiceInExchangisJobBuilderContext extends ExchangisJobBuilderContext {
+public class SpringExchangisJobBuilderContext extends ExchangisJobBuilderContext {
- /**
- * Meta info service
- */
- private MetadataInfoService metadataInfoService;
/**
* Job execution id
@@ -32,9 +29,12 @@ public class ServiceInExchangisJobBuilderContext extends ExchangisJobBuilderCont
*/
private JobServerLogging> logging;
- public ServiceInExchangisJobBuilderContext(ExchangisJobInfo originalJob,
- JobLogListener jobLogListener) {
+ private ApplicationContext applicationContext;
+
+ public SpringExchangisJobBuilderContext(ExchangisJobInfo originalJob,
+ ApplicationContext applicationContext, JobLogListener jobLogListener) {
super(originalJob);
+ this.applicationContext = applicationContext;
this.logging = new JobServerLogging>() {
@Override
public Logger getLogger() {
@@ -62,12 +62,8 @@ public void setJobExecutionId(String jobExecutionId) {
this.jobExecutionId = jobExecutionId;
}
- public MetadataInfoService getMetadataInfoService() {
- return metadataInfoService;
- }
-
- public void setMetadataInfoService(MetadataInfoService metadataInfoService) {
- this.metadataInfoService = metadataInfoService;
+ public T getBean(Class requiredType) {
+ return applicationContext.getBean(requiredType);
}
public JobServerLogging> getLogging() {
diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/builder/engine/AbstractResourceEngineJobBuilder.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/builder/engine/AbstractResourceEngineJobBuilder.java
new file mode 100644
index 000000000..57edfeade
--- /dev/null
+++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/builder/engine/AbstractResourceEngineJobBuilder.java
@@ -0,0 +1,42 @@
+package com.webank.wedatasphere.exchangis.job.server.builder.engine;
+
+import com.webank.wedatasphere.exchangis.engine.domain.EngineBmlResource;
+import com.webank.wedatasphere.exchangis.engine.domain.EngineLocalPathResource;
+import com.webank.wedatasphere.exchangis.engine.domain.EngineResource;
+import com.webank.wedatasphere.exchangis.engine.manager.ExchangisEngineManager;
+import com.webank.wedatasphere.exchangis.engine.resource.EngineResourceContainer;
+import com.webank.wedatasphere.exchangis.job.domain.ExchangisEngineJob;
+import com.webank.wedatasphere.exchangis.job.domain.SubExchangisJob;
+import com.webank.wedatasphere.exchangis.job.server.builder.AbstractLoggingExchangisJobBuilder;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.linkis.common.conf.CommonVars;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Objects;
+import java.util.Optional;
+
+/**
+ * Engine job builder with engine resources
+ */
+public abstract class AbstractResourceEngineJobBuilder extends AbstractLoggingExchangisJobBuilder {
+
+ /**
+ * Get resources
+ * @return path
+ */
+ protected List getResources(String engine, String[] paths){
+ EngineResourceContainer resourceContainer =
+ getBean(ExchangisEngineManager.class).getResourceContainer(engine);
+ List resources = new ArrayList<>();
+ if (Objects.nonNull(resourceContainer)){
+ for(String path : paths){
+ if (StringUtils.isNotBlank(path)) {
+ Optional.ofNullable(resourceContainer.getRemoteResource(path))
+ .ifPresent(resources::add);
+ }
+ }
+ }
+ return resources;
+ }
+}
diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/builder/engine/DataxExchangisEngineJob.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/builder/engine/DataxExchangisEngineJob.java
index 89934dd2e..6741cc07f 100644
--- a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/builder/engine/DataxExchangisEngineJob.java
+++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/builder/engine/DataxExchangisEngineJob.java
@@ -2,19 +2,28 @@
import com.webank.wedatasphere.exchangis.job.domain.ExchangisEngineJob;
+import java.util.Objects;
+
/**
* Datax engine job
*/
public class DataxExchangisEngineJob extends ExchangisEngineJob {
- private static final String CODE_NAME = "code";
-
+ private static final String CODE_NAME = "job";
- public String getCode() {
- return String.valueOf(super.getJobContent().get(CODE_NAME));
+ public DataxExchangisEngineJob(ExchangisEngineJob engineJob){
+ super(engineJob);
+ }
+ @SuppressWarnings({"unchecked"})
+ public T getCode(Class> type) {
+ Object code = super.getJobContent().get(CODE_NAME);
+ if (Objects.nonNull(code) && type.isAssignableFrom(code.getClass())){
+ return (T)code;
+ }
+ return null;
}
- public void setCode(String code) {
+ public void setCode(Object code) {
super.getJobContent().put(CODE_NAME, code);
}
}
diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/builder/engine/DataxExchangisEngineJobBuilder.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/builder/engine/DataxExchangisEngineJobBuilder.java
index 97026d83e..9132100cf 100644
--- a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/builder/engine/DataxExchangisEngineJobBuilder.java
+++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/builder/engine/DataxExchangisEngineJobBuilder.java
@@ -2,130 +2,101 @@
import com.fasterxml.jackson.core.JsonProcessingException;
import com.webank.wedatasphere.exchangis.datasource.core.utils.Json;
+import com.webank.wedatasphere.exchangis.engine.domain.EngineBmlResource;
+import com.webank.wedatasphere.exchangis.engine.resource.loader.datax.DataxEngineResourceConf;
import com.webank.wedatasphere.exchangis.job.builder.ExchangisJobBuilderContext;
-import com.webank.wedatasphere.exchangis.job.builder.api.AbstractExchangisJobBuilder;
import com.webank.wedatasphere.exchangis.job.domain.ExchangisEngineJob;
import com.webank.wedatasphere.exchangis.job.domain.SubExchangisJob;
-import com.webank.wedatasphere.exchangis.job.domain.params.JobParam;
import com.webank.wedatasphere.exchangis.job.domain.params.JobParamDefine;
-import com.webank.wedatasphere.exchangis.job.domain.params.JobParamSet;
import com.webank.wedatasphere.exchangis.job.domain.params.JobParams;
import com.webank.wedatasphere.exchangis.job.exception.ExchangisJobException;
import com.webank.wedatasphere.exchangis.job.exception.ExchangisJobExceptionCode;
+import com.webank.wedatasphere.exchangis.job.server.builder.transform.TransformExchangisJob;
+import com.webank.wedatasphere.exchangis.job.server.render.transform.TransformTypes;
import com.webank.wedatasphere.exchangis.job.server.utils.JsonEntity;
-import org.apache.commons.lang.StringUtils;
-import org.apache.linkis.manager.label.utils.LabelUtils;
+import com.webank.wedatasphere.exchangis.job.utils.MemUtils;
+import org.apache.commons.io.IOUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import java.net.URI;
-import java.net.URISyntaxException;
import java.util.*;
-import java.util.function.BiFunction;
-import static com.webank.wedatasphere.exchangis.job.domain.SubExchangisJob.*;
-
-public class DataxExchangisEngineJobBuilder extends AbstractExchangisJobBuilder {
+/**
+ * Datax engine job builder
+ */
+public class DataxExchangisEngineJobBuilder extends AbstractResourceEngineJobBuilder {
private static final Logger LOG = LoggerFactory.getLogger(DataxExchangisEngineJob.class);
+ private static final String BYTE_SPEED_SETTING_PARAM = "setting.speed.byte";
+
+ private static final String PROCESSOR_SWITCH = "setting.useProcessor";
+
+ private static final String PROCESSOR_BASE_PATH = "core.processor.loader.plugin.sourcePath";
+
+ private static final Map PLUGIN_NAME_MAPPER = new HashMap<>();
+
+ static{
+ //hive use hdfs plugin resource
+ PLUGIN_NAME_MAPPER.put("hive", "hdfs");
+ }
+
/**
- * Mapping params
+ * Column mappings define
*/
- private static final JobParamDefine>> TRANSFORM_MAPPING = JobParams.define("mapping");
+ private static final JobParamDefine COLUMN_MAPPINGS = JobParams.define("column.mappings", job -> {
+ DataxMappingContext mappingContext = new DataxMappingContext();
+ job.getSourceColumns().forEach(columnDefine -> mappingContext.getSourceColumns().add(
+ new DataxMappingContext.Column(columnDefine.getName(), columnDefine.getType(), columnDefine.getIndex() + "")
+ ));
+ job.getSinkColumns().forEach(columnDefine -> mappingContext.getSinkColumns().add(
+ new DataxMappingContext.Column(columnDefine.getName(), columnDefine.getType(), columnDefine.getIndex() + "")
+ ));
+ job.getColumnFunctions().forEach(function -> {
+ DataxMappingContext.Transformer.Parameter parameter = new DataxMappingContext.Transformer.Parameter();
+ parameter.setColumnIndex(function.getIndex() + "");
+ parameter.setParas(function.getParams());
+ mappingContext.getTransformers()
+ .add(new DataxMappingContext.Transformer(function.getName(), parameter));
+ });
+ return mappingContext;
+ }, SubExchangisJob.class);
/**
- * Source params for column
+ * Source content
*/
- private static final JobParamDefine SOURCE_FIELD_NAME = JobParams.define("name", "source_field_name", String.class);
- private static final JobParamDefine SOURCE_FIELD_TYPE = JobParams.define("type", "source_field_type", String.class);
- private static final JobParamDefine SOURCE_FIELD_INDEX = JobParams.define("index", "source_field_index", Integer.class);
+ private static final JobParamDefine PLUGIN_SOURCE_NAME = JobParams.define("content[0].reader.name", job ->
+ getPluginName(job.getSourceType(), "reader"), SubExchangisJob.class);
+
+ private static final JobParamDefine> PLUGIN_SOURCE_PARAM = JobParams.define("content[0].reader.parameter", job ->
+ job.getParamsToMap(SubExchangisJob.REALM_JOB_CONTENT_SOURCE, false), SubExchangisJob.class);
/**
- * Sink params for column
+ * Sink content
*/
- private static final JobParamDefine SINK_FIELD_NAME = JobParams.define("name", "sink_field_name", String.class);
- private static final JobParamDefine SINK_FIELD_TYPE = JobParams.define("type", "sink_field_type", String.class);
- private static final JobParamDefine SINK_FIELD_INDEX = JobParams.define("index", "sink_field_index", Integer.class);
-
- private static final JobParamDefine>> SOURCE_COLUMN = JobParams.define("column", (BiFunction>>) (key, paramSet) -> {
+ private static final JobParamDefine PLUGIN_SINK_NAME = JobParams.define("content[0]].writer.name", job ->
+ getPluginName(job.getSinkType(), "writer"), SubExchangisJob.class);
- List> columns = new ArrayList<>();
- List> mappings = TRANSFORM_MAPPING.newParam(paramSet).getValue();
- if (Objects.nonNull(mappings)) {
- mappings.forEach(mapping -> {
- Map _mapping = new HashMap<>(mapping);
- Map column = new HashMap<>();
- columns.add(column);
- column.put(SOURCE_FIELD_NAME.getKey(), SOURCE_FIELD_NAME.newParam(_mapping).getValue());
- column.put(SOURCE_FIELD_TYPE.getKey(), SOURCE_FIELD_TYPE.newParam(_mapping).getValue());
- column.put(SOURCE_FIELD_INDEX.getKey(), SOURCE_FIELD_INDEX.newParam(_mapping).getValue());
- });
- }
- return columns;
- });
+ private static final JobParamDefine> PLUGIN_SINK_PARAM = JobParams.define("content[0].writer.parameter", job ->
+ job.getParamsToMap(SubExchangisJob.REALM_JOB_CONTENT_SINK, false), SubExchangisJob.class);
- private static final JobParamDefine>> SINK_COLUMN = JobParams.define("column", (BiFunction>>) (key, paramSet) -> {
- List> columns = new ArrayList<>();
- List> mappings = TRANSFORM_MAPPING.newParam(paramSet).getValue();
- if (Objects.nonNull(mappings)) {
- mappings.forEach(mapping -> {
- Map _mapping = new HashMap<>(mapping);
- Map column = new HashMap<>();
- columns.add(column);
- column.put(SINK_FIELD_NAME.getKey(), SINK_FIELD_NAME.newParam(_mapping).getValue());
- column.put(SINK_FIELD_TYPE.getKey(), SINK_FIELD_TYPE.newParam(_mapping).getValue());
- column.put(SINK_FIELD_INDEX.getKey(), SINK_FIELD_INDEX.newParam(_mapping).getValue());
- });
- }
- return columns;
- });
+ /**
+ * Source columns
+ */
+ private static final JobParamDefine> SOURCE_COLUMNS = JobParams.define("content[0].reader.parameter.column",
+ DataxMappingContext::getSourceColumns,DataxMappingContext.class);
- private static final JobParamDefine> TRANSFORMER = JobParams.define("column", (BiFunction>) (key, paramSet) -> {
- List transformers = new ArrayList<>();
- List> mappings = TRANSFORM_MAPPING.newParam(paramSet).getValue();
- if (Objects.nonNull(mappings)) {
- mappings.forEach(mapping -> {
- Map _mapping = new HashMap<>(mapping);
- int fieldIndex = SOURCE_FIELD_INDEX.newParam(_mapping).getValue();
- Object validator = mapping.get("validator");
- if (null != validator) {
- List params = (List) validator;
- if (params.size() > 0) {
- Transformer transformer = new Transformer();
- transformer.setName("dx_filter");
- TransformerParameter parameter = new TransformerParameter();
- parameter.setColumnIndex(fieldIndex);
- parameter.setParas(params.toArray(new String[0]));
- transformer.setParameter(parameter);
- transformers.add(transformer);
- }
- }
+ /**
+ * Sink columns
+ */
+ private static final JobParamDefine> SINK_COLUMNS = JobParams.define("content[0].writer.parameter.column",
+ DataxMappingContext::getSinkColumns,DataxMappingContext.class);
- Object transfomer = mapping.get("transformer");
- if (null != transfomer) {
- Map define = (Map) transfomer;
- if (null != define.get("name") && !StringUtils.isBlank(define.get("name").toString())) {
- Transformer transformer = new Transformer();
- transformer.setName(define.get("name").toString());
- TransformerParameter parameter = new TransformerParameter();
- parameter.setColumnIndex(fieldIndex);
- parameter.setParas(new String[0]);
- Object params = define.get("params");
- if (null != params) {
- List paramsDefine = (List) params;
- if (null != paramsDefine && paramsDefine.size() > 0) {
- parameter.setParas(paramsDefine.toArray(new String[0]));
- }
- }
- transformer.setParameter(parameter);
- transformers.add(transformer);
- }
- }
- });
- }
- return transformers;
- });
+ /**
+ * Transform list
+ */
+ private static final JobParamDefine> TRANSFORM_LIST = JobParams.define("content[0].transformer",
+ DataxMappingContext::getTransformers, DataxMappingContext.class);
@Override
public int priority() {
@@ -141,580 +112,109 @@ public boolean canBuild(SubExchangisJob inputJob) {
public DataxExchangisEngineJob buildJob(SubExchangisJob inputJob, ExchangisEngineJob expectOut, ExchangisJobBuilderContext ctx) throws ExchangisJobException {
try {
- DataxExchangisEngineJob engineJob = new DataxExchangisEngineJob();
+ DataxExchangisEngineJob engineJob = new DataxExchangisEngineJob(expectOut);
engineJob.setId(inputJob.getId());
-
- DataxCode dataxCode = buildDataxCode(inputJob, ctx);
-
- engineJob.setCode(Json.toJson(dataxCode, null));
- try {
- LOG.info("Datax-code built complete, output: " + Json.getMapper().writerWithDefaultPrettyPrinter().writeValueAsString(dataxCode));
- } catch (JsonProcessingException e) {
- //Ignore
+ Map codeMap = buildDataxCode(inputJob, ctx);
+ if (Objects.nonNull(codeMap)){
+ try {
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("Datax-code built complete, output: " + Json.getMapper().writerWithDefaultPrettyPrinter().writeValueAsString(codeMap));
+ }
+ info("Datax-code built complete, output: " + Json.getMapper().writerWithDefaultPrettyPrinter().writeValueAsString(codeMap));
+ } catch (JsonProcessingException e) {
+ //Ignore
+ }
+ engineJob.setCode(codeMap);
}
- if (Objects.nonNull(expectOut)) {
- engineJob.setName(expectOut.getName());
- engineJob.setEngineType(expectOut.getEngineType());
+ // engine resources
+ engineJob.getResources().addAll(
+ getResources(inputJob.getEngineType().toLowerCase(Locale.ROOT), getResourcesPaths(inputJob)));
+ if (inputJob instanceof TransformExchangisJob.TransformSubExchangisJob){
+ TransformExchangisJob.TransformSubExchangisJob transformJob = ((TransformExchangisJob.TransformSubExchangisJob) inputJob);
+ TransformTypes type = transformJob.getTransformType();
+ if (type == TransformTypes.PROCESSOR){
+ settingProcessorInfo(transformJob, engineJob);
+ }
}
-
- engineJob.setRuntimeParams(inputJob.getParamsToMap(SubExchangisJob.REALM_JOB_SETTINGS, false));
engineJob.setName(inputJob.getName());
- if (Objects.nonNull(expectOut)) {
- engineJob.setName(expectOut.getName());
- engineJob.setEngineType(expectOut.getEngineType());
- }
+ //Unit MB
+ Optional.ofNullable(engineJob.getRuntimeParams().get(BYTE_SPEED_SETTING_PARAM)).ifPresent(byteLimit -> {
+ long limit = Long.parseLong(String.valueOf(byteLimit));
+ // Convert to bytes
+ engineJob.getRuntimeParams().put(BYTE_SPEED_SETTING_PARAM,
+ MemUtils.convertToByte(limit, MemUtils.StoreUnit.MB.name()));
+ });
+
engineJob.setCreateUser(inputJob.getCreateUser());
+ // Lock the memory unit
+ engineJob.setMemoryUnitLock(true);
return engineJob;
} catch (Exception e) {
- throw new ExchangisJobException(ExchangisJobExceptionCode.ENGINE_JOB_ERROR.getCode(),
+ throw new ExchangisJobException(ExchangisJobExceptionCode.BUILDER_ENGINE_ERROR.getCode(),
"Fail to build datax engine job, message:[" + e.getMessage() + "]", e);
}
}
/**
- * Datax code
- *
+ * Build datax code content
* @param inputJob input job
- * @return code
+ * @param ctx ctx
+ * @return code map
*/
- private DataxCode buildDataxCode(SubExchangisJob inputJob, ExchangisJobBuilderContext ctx) {
-
- DataxCode code = new DataxCode();
- String sourceType = inputJob.getSourceType();
- String sinkType = inputJob.getSinkType();
- Content content = new Content();
- if (sourceType.equalsIgnoreCase("mysql")) {
- content.getReader().putAll(this.buildMySQLReader(inputJob, ctx));
- }
- if (sourceType.equalsIgnoreCase("hive")) {
- content.getReader().putAll(this.buildHiveReader(inputJob, ctx));
- }
- if (sinkType.equalsIgnoreCase("mysql")) {
- content.getWriter().putAll(this.buildMySQLWriter(inputJob, ctx));
- }
- if (sinkType.equalsIgnoreCase("hive")) {
- content.getWriter().putAll(this.buildHiveWriter(inputJob, ctx));
- }
-
- content.getTransformer().addAll(this.buildTransformer(inputJob, ctx));
-
- code.getContent().add(content);
- code.getSetting().putAll(this.buildSettings(inputJob, ctx));
-
- //To construct settings
-// JobParamSet paramSet = inputJob.getRealmParams(SubExchangisJob.REALM_JOB_SETTINGS);
-// if (Objects.nonNull(paramSet)) {
-// JsonConfiguration setting = JsonConfiguration.from(code.getSetting());
-// paramSet.toList().forEach(param -> setting.set(param.getStrKey(), param.getValue()));
-// code.setSetting(setting.toMap());
-// }
-
-// //To construct content
-// Content content1 = new Content();
-// JobParamSet transformJobParamSet = inputJob.getRealmParams(SubExchangisJob.REALM_JOB_COLUMN_MAPPING);
-// paramSet = inputJob.getRealmParams(SubExchangisJob.REALM_JOB_CONTENT_SOURCE);
-// JsonConfiguration reader = JsonConfiguration.from(content1.getReader());
-// if(Objects.nonNull(paramSet)){
-// if (StringUtils.isNotBlank(inputJob.getSourceType())){
-// reader.set("name", inputJob.getSourceType().toLowerCase() + "reader");
-// reader.set("parameter", buildContentParam(paramSet, transformJobParamSet, SOURCE_COLUMN));
-// content1.setReader(reader.toMap());
-// }
-// }
-// paramSet = inputJob.getRealmParams(SubExchangisJob.REALM_JOB_CONTENT_SINK);
-// JsonConfiguration writer = JsonConfiguration.from(content1.getReader());
-// if(Objects.nonNull(paramSet)){
-// if (StringUtils.isNotBlank(inputJob.getSinkType())){
-// writer.set("name", inputJob.getSinkType().toLowerCase() + "writer");
-// writer.set("parameter", buildContentParam(paramSet, transformJobParamSet, SINK_COLUMN));
-// content1.setWriter(writer.toMap());
-// }
-// }
- return code;
- }
-
- private Map buildContentParam(JobParamSet paramSet, JobParamSet transformJobParamSet,
- JobParamDefine>> columnJobParamDefine) {
- JsonEntity item = JsonEntity.from("{}");
- //Ignore temp params
- paramSet.toList(false).forEach(param -> item.set(param.getStrKey(), param.getValue()));
- if (Objects.nonNull(transformJobParamSet)) {
- item.set(columnJobParamDefine.getKey(), columnJobParamDefine.newParam(transformJobParamSet).getValue());
- }
- return item.toMap();
- }
-
- private Map buildMySQLReader(SubExchangisJob inputJob, ExchangisJobBuilderContext ctx) {
- Map reader = new HashMap<>();
- reader.put("name", "mysqlreader");
-
- JobParamSet sourceSettings = inputJob.getRealmParams(REALM_JOB_CONTENT_SOURCE);
-
- Map parameter = new HashMap<>();
- parameter.put("connParams", new HashMap());
- parameter.put("haveKerberos", false);
- parameter.put("datasource", Integer.parseInt(sourceSettings.get("datasource").getValue().toString()));
-
- parameter.put("username", ctx.getDatasourceParam(sourceSettings.get("datasource").getValue().toString()).get("username"));
- String password = ctx.getDatasourceParam(sourceSettings.get("datasource").getValue().toString()).get("password").toString();
- parameter.put("password", password);
- List> columns = SOURCE_COLUMN.newParam(inputJob.getRealmParams(REALM_JOB_COLUMN_MAPPING)).getValue();
- parameter.put("column_i", columns);
- parameter.put("alias", "[\"A\"]");
-
- List> connections = new ArrayList<>(1);
- Map connection = new HashMap<>();
- Object host = ctx.getDatasourceParam(sourceSettings.get("datasource").getValue().toString()).get("host");
- Object port = ctx.getDatasourceParam(sourceSettings.get("datasource").getValue().toString()).get("port");
- Object database = sourceSettings.get("database").getValue();
- List> jdbcUrls = new ArrayList<>();
- Map jdbcUrl = new HashMap<>();
- jdbcUrl.put("host", host);
- jdbcUrl.put("port", port);
- jdbcUrl.put("database", database);
- jdbcUrls.add(jdbcUrl);
- connection.put("jdbcUrl", jdbcUrls);
-
- parameter.put("authType", "DEFAULT");
-
- List tables = new ArrayList<>();
- tables.add(sourceSettings.get("table").getValue().toString());
- // connection.put("table", tables);
- parameter.put("table", LabelUtils.Jackson.toJson(tables, String.class));
-
- StringBuilder sql = new StringBuilder("SELECT ");
- for (Iterator> iterator = columns.iterator(); iterator.hasNext(); ) {
- Map field = iterator.next();
- sql.append("A.").append(field.get("name"));
- if (iterator.hasNext()) {
- sql.append(", ");
- } else {
- sql.append(" ");
- }
- }
-
- sql.append("FROM ").append(sourceSettings.get("table").getValue().toString()).append(" A");
-
- if (null != sourceSettings.get("exchangis.job.ds.params.datax.mysql.r.where_condition")
- && null != sourceSettings.get("exchangis.job.ds.params.datax.mysql.r.where_condition").getValue()
- && StringUtils.isNotBlank(sourceSettings.get("exchangis.job.ds.params.datax.mysql.r.where_condition").getValue().toString())) {
- sql.append(" WHERE ").append(sourceSettings.get("exchangis.job.ds.params.datax.mysql.r.where_condition").getValue().toString());
- }
-
- List querySql = new ArrayList<>();
- querySql.add(sql.toString());
- connection.put("querySql", querySql);
-
- connections.add(connection);
- parameter.put("connection", connections);
-
- reader.put("parameter", parameter);
- return reader;
- }
-
- private Map buildMySQLWriter(SubExchangisJob inputJob, ExchangisJobBuilderContext ctx) {
- Map writer = new HashMap<>();
- writer.put("name", "mysqlwriter");
- Map parameter = new HashMap<>();
- parameter.put("haveKerberos", false);
- parameter.put("connParams", new HashMap());
-
- JobParamSet sinkSettings = inputJob.getRealmParams(REALM_JOB_CONTENT_SINK);
- parameter.put("datasource", Integer.parseInt(sinkSettings.get("datasource").getValue().toString()));
- parameter.put("authType", "DEFAULT");
- parameter.put("username", ctx.getDatasourceParam(sinkSettings.get("datasource").getValue().toString()).get("username"));
- String password = ctx.getDatasourceParam(sinkSettings.get("datasource").getValue().toString()).get("password").toString();
- // parameter.put("password", Base64.getEncoder().encodeToString(password.getBytes(StandardCharsets.UTF_8)));
- parameter.put("password", password);
-
- List> columns = SINK_COLUMN.newParam(inputJob.getRealmParams(REALM_JOB_COLUMN_MAPPING)).getValue();
- parameter.put("column_i", columns);
- parameter.put("column", columns.stream().map(map -> map.get("name")).toArray());
-
- List> connections = new ArrayList<>(1);
- Map connection = new HashMap<>();
- String connectProtocol = "jdbc:mysql://";
- Object host = ctx.getDatasourceParam(sinkSettings.get("datasource").getValue().toString()).get("host");
- Object port = ctx.getDatasourceParam(sinkSettings.get("datasource").getValue().toString()).get("port");
- Object database = sinkSettings.get("database").getValue();
- Map jdbcUrl = new HashMap<>();
- jdbcUrl.put("host", host);
- jdbcUrl.put("port", port);
- jdbcUrl.put("database", database);
- connection.put("jdbcUrl", jdbcUrl);
- List tables = new ArrayList<>();
- tables.add(sinkSettings.get("table").getValue().toString());
- connection.put("table", tables);
- connections.add(connection);
- parameter.put("connection", connections);
-
- parameter.put("writeMode", sinkSettings.get("exchangis.job.ds.params.datax.mysql.w.write_type").getValue().toString().toLowerCase(Locale.ROOT));
-
- writer.put("parameter", parameter);
- return writer;
- }
-
- private Map buildHiveReader(SubExchangisJob inputJob, ExchangisJobBuilderContext ctx) {
- Map reader = new HashMap<>();
- reader.put("name", "hdfsreader");
-
- Map parameter = new HashMap<>();
- parameter.put("nullFormat", "\\\\N");
- parameter.put("haveKerberos", false);
- parameter.put("hadoopConfig", new HashMap