Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
njgzx
dataease
Commits
e5f5ab90
提交
e5f5ab90
authored
4月 26, 2022
作者:
taojinlong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: 同时创建多个定时同步的数据集,会出现部分数据集更新信息显示成功但是预览数据为空
上级
657265cc
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
35 行增加
和
8 行删除
+35
-8
ExtractDataService.java
.../java/io/dataease/service/dataset/ExtractDataService.java
+31
-7
form.vue
frontend/src/views/system/datasource/form.vue
+4
-1
没有找到文件。
backend/src/main/java/io/dataease/service/dataset/ExtractDataService.java
浏览文件 @
e5f5ab90
...
@@ -120,6 +120,19 @@ public class ExtractDataService {
...
@@ -120,6 +120,19 @@ public class ExtractDataService {
" exit 1\n"
+
" exit 1\n"
+
"fi\n"
;
"fi\n"
;
private
static
final
String
shellScriptForDeleteFile
=
"result=`curl --location-trusted -u %s:%s -H \"label:%s\" -H \"column_separator:%s\" -H \"columns:%s\" -H \"merge_type: %s\" -T %s -XPUT http://%s:%s/api/%s/%s/_stream_load`\n"
+
"rm -rf %s \n"
+
"if [ $? -eq 0 ] ; then\n"
+
" failstatus=$(echo $result | grep '\"Status\": \"Fail\"')\n"
+
" if [ \"x${failstatus}\" != \"x\" ];then"
+
" echo $result\n"
+
" exit 1\n"
+
" fi\n"
+
"else\n"
+
" echo $result\n"
+
" exit 1\n"
+
"fi\n"
;
public
synchronized
boolean
existSyncTask
(
DatasetTable
datasetTable
,
DatasetTableTask
datasetTableTask
,
Long
startTime
)
{
public
synchronized
boolean
existSyncTask
(
DatasetTable
datasetTable
,
DatasetTableTask
datasetTableTask
,
Long
startTime
)
{
datasetTable
.
setSyncStatus
(
JobStatus
.
Underway
.
name
());
datasetTable
.
setSyncStatus
(
JobStatus
.
Underway
.
name
());
DatasetTableExample
example
=
new
DatasetTableExample
();
DatasetTableExample
example
=
new
DatasetTableExample
();
...
@@ -445,14 +458,20 @@ public class ExtractDataService {
...
@@ -445,14 +458,20 @@ public class ExtractDataService {
String
dataFile
=
null
;
String
dataFile
=
null
;
String
script
=
null
;
String
script
=
null
;
String
streamLoadScript
=
""
;
if
(
kettleFilesKeep
){
streamLoadScript
=
shellScript
;
}
else
{
streamLoadScript
=
shellScriptForDeleteFile
;
}
switch
(
extractType
)
{
switch
(
extractType
)
{
case
"all_scope"
:
case
"all_scope"
:
dataFile
=
root_path
+
TableUtils
.
tmpName
(
TableUtils
.
tableName
(
datasetTable
.
getId
()))
+
"."
+
extention
;
dataFile
=
root_path
+
TableUtils
.
tmpName
(
TableUtils
.
tableName
(
datasetTable
.
getId
()))
+
"."
+
extention
;
script
=
String
.
format
(
s
hell
Script
,
dorisConfiguration
.
getUsername
(),
dorisConfiguration
.
getPassword
(),
System
.
currentTimeMillis
(),
separator
,
columns
,
"APPEND"
,
dataFile
,
dorisConfiguration
.
getHost
(),
dorisConfiguration
.
getHttpPort
(),
dorisConfiguration
.
getDataBase
(),
TableUtils
.
tmpName
(
TableUtils
.
tableName
(
datasetTable
.
getId
())));
script
=
String
.
format
(
s
treamLoad
Script
,
dorisConfiguration
.
getUsername
(),
dorisConfiguration
.
getPassword
(),
System
.
currentTimeMillis
(),
separator
,
columns
,
"APPEND"
,
dataFile
,
dorisConfiguration
.
getHost
(),
dorisConfiguration
.
getHttpPort
(),
dorisConfiguration
.
getDataBase
(),
TableUtils
.
tmpName
(
TableUtils
.
tableName
(
datasetTable
.
getId
())));
break
;
break
;
default
:
default
:
dataFile
=
root_path
+
TableUtils
.
addName
(
TableUtils
.
tableName
(
datasetTable
.
getId
()))
+
"."
+
extention
;
dataFile
=
root_path
+
TableUtils
.
addName
(
TableUtils
.
tableName
(
datasetTable
.
getId
()))
+
"."
+
extention
;
script
=
String
.
format
(
s
hell
Script
,
dorisConfiguration
.
getUsername
(),
dorisConfiguration
.
getPassword
(),
System
.
currentTimeMillis
(),
separator
,
columns
,
"APPEND"
,
dataFile
,
dorisConfiguration
.
getHost
(),
dorisConfiguration
.
getHttpPort
(),
dorisConfiguration
.
getDataBase
(),
TableUtils
.
tableName
(
datasetTable
.
getId
()));
script
=
String
.
format
(
s
treamLoad
Script
,
dorisConfiguration
.
getUsername
(),
dorisConfiguration
.
getPassword
(),
System
.
currentTimeMillis
(),
separator
,
columns
,
"APPEND"
,
dataFile
,
dorisConfiguration
.
getHost
(),
dorisConfiguration
.
getHttpPort
(),
dorisConfiguration
.
getDataBase
(),
TableUtils
.
tableName
(
datasetTable
.
getId
()));
break
;
break
;
}
}
...
@@ -744,7 +763,6 @@ public class ExtractDataService {
...
@@ -744,7 +763,6 @@ public class ExtractDataService {
DataEaseException
.
throwException
(
transStatus
.
getLoggingString
());
DataEaseException
.
throwException
(
transStatus
.
getLoggingString
());
return
;
return
;
}
}
executing
=
true
;
executing
=
true
;
String
lastCarteObjectId
=
Job
.
sendToSlaveServer
(
jobMeta
,
jobExecutionConfiguration
,
repository
,
null
);
String
lastCarteObjectId
=
Job
.
sendToSlaveServer
(
jobMeta
,
jobExecutionConfiguration
,
repository
,
null
);
SlaveServerJobStatus
jobStatus
=
null
;
SlaveServerJobStatus
jobStatus
=
null
;
...
@@ -759,7 +777,7 @@ public class ExtractDataService {
...
@@ -759,7 +777,7 @@ public class ExtractDataService {
if
(
jobStatus
.
getStatusDescription
().
equals
(
"Finished"
))
{
if
(
jobStatus
.
getStatusDescription
().
equals
(
"Finished"
))
{
return
;
return
;
}
else
{
}
else
{
DataEaseException
.
throwException
(
(
jobStatus
.
getLoggingString
()
));
DataEaseException
.
throwException
(
jobStatus
.
getLoggingString
(
));
}
}
}
}
...
@@ -773,20 +791,26 @@ public class ExtractDataService {
...
@@ -773,20 +791,26 @@ public class ExtractDataService {
Datasource
dorisDatasource
=
engineService
.
getDeEngine
();
Datasource
dorisDatasource
=
engineService
.
getDeEngine
();
DorisConfiguration
dorisConfiguration
=
new
Gson
().
fromJson
(
dorisDatasource
.
getConfiguration
(),
DorisConfiguration
.
class
);
DorisConfiguration
dorisConfiguration
=
new
Gson
().
fromJson
(
dorisDatasource
.
getConfiguration
(),
DorisConfiguration
.
class
);
String
columns
=
columnFields
+
",dataease_uuid"
;
String
columns
=
columnFields
+
",dataease_uuid"
;
String
streamLoadScript
=
""
;
if
(
kettleFilesKeep
){
streamLoadScript
=
shellScript
;
}
else
{
streamLoadScript
=
shellScriptForDeleteFile
;
}
switch
(
extractType
)
{
switch
(
extractType
)
{
case
"all_scope"
:
case
"all_scope"
:
outFile
=
TableUtils
.
tmpName
(
TableUtils
.
tableName
(
datasetTable
.
getId
()));
outFile
=
TableUtils
.
tmpName
(
TableUtils
.
tableName
(
datasetTable
.
getId
()));
jobName
=
"job_"
+
TableUtils
.
tableName
(
datasetTable
.
getId
());
jobName
=
"job_"
+
TableUtils
.
tableName
(
datasetTable
.
getId
());
script
=
String
.
format
(
s
hellScript
,
dorisConfiguration
.
getUsername
(),
dorisConfiguration
.
getPassword
(),
System
.
currentTimeMillis
(),
separator
,
columns
,
"APPEND"
,
root_path
+
outFile
+
"."
+
extention
,
dorisConfiguration
.
getHost
(),
dorisConfiguration
.
getHttpPort
(),
dorisConfiguration
.
getDataBase
(),
TableUtils
.
tmpName
(
TableUtils
.
tableName
(
datasetTable
.
getId
())),
root_path
+
outFile
+
"."
+
extention
);
script
=
String
.
format
(
s
treamLoadScript
,
dorisConfiguration
.
getUsername
(),
dorisConfiguration
.
getPassword
(),
datasetTable
.
getId
()
+
System
.
currentTimeMillis
(),
separator
,
columns
,
"APPEND"
,
root_path
+
outFile
+
"."
+
extention
,
dorisConfiguration
.
getHost
(),
dorisConfiguration
.
getHttpPort
(),
dorisConfiguration
.
getDataBase
(),
TableUtils
.
tmpName
(
TableUtils
.
tableName
(
datasetTable
.
getId
())),
root_path
+
outFile
+
"."
+
extention
);
break
;
break
;
case
"incremental_add"
:
case
"incremental_add"
:
outFile
=
TableUtils
.
addName
(
datasetTable
.
getId
());
outFile
=
TableUtils
.
addName
(
datasetTable
.
getId
());
jobName
=
"job_add_"
+
TableUtils
.
tableName
(
datasetTable
.
getId
());
jobName
=
"job_add_"
+
TableUtils
.
tableName
(
datasetTable
.
getId
());
script
=
String
.
format
(
s
hellScript
,
dorisConfiguration
.
getUsername
(),
dorisConfiguration
.
getPassword
(),
System
.
currentTimeMillis
(),
separator
,
columns
,
"APPEND"
,
root_path
+
outFile
+
"."
+
extention
,
dorisConfiguration
.
getHost
(),
dorisConfiguration
.
getHttpPort
(),
dorisConfiguration
.
getDataBase
(),
TableUtils
.
tableName
(
datasetTable
.
getId
()),
root_path
+
outFile
+
"."
+
extention
);
script
=
String
.
format
(
s
treamLoadScript
,
dorisConfiguration
.
getUsername
(),
dorisConfiguration
.
getPassword
(),
datasetTable
.
getId
()
+
System
.
currentTimeMillis
(),
separator
,
columns
,
"APPEND"
,
root_path
+
outFile
+
"."
+
extention
,
dorisConfiguration
.
getHost
(),
dorisConfiguration
.
getHttpPort
(),
dorisConfiguration
.
getDataBase
(),
TableUtils
.
tableName
(
datasetTable
.
getId
()),
root_path
+
outFile
+
"."
+
extention
);
break
;
break
;
case
"incremental_delete"
:
case
"incremental_delete"
:
outFile
=
TableUtils
.
deleteName
(
TableUtils
.
tableName
(
datasetTable
.
getId
()));
outFile
=
TableUtils
.
deleteName
(
TableUtils
.
tableName
(
datasetTable
.
getId
()));
script
=
String
.
format
(
s
hellScript
,
dorisConfiguration
.
getUsername
(),
dorisConfiguration
.
getPassword
(),
System
.
currentTimeMillis
(),
separator
,
columns
,
"DELETE"
,
root_path
+
outFile
+
"."
+
extention
,
dorisConfiguration
.
getHost
(),
dorisConfiguration
.
getHttpPort
(),
dorisConfiguration
.
getDataBase
(),
TableUtils
.
tableName
(
datasetTable
.
getId
()),
root_path
+
outFile
+
"."
+
extention
);
script
=
String
.
format
(
s
treamLoadScript
,
dorisConfiguration
.
getUsername
(),
dorisConfiguration
.
getPassword
(),
datasetTable
.
getId
()
+
System
.
currentTimeMillis
(),
separator
,
columns
,
"DELETE"
,
root_path
+
outFile
+
"."
+
extention
,
dorisConfiguration
.
getHost
(),
dorisConfiguration
.
getHttpPort
(),
dorisConfiguration
.
getDataBase
(),
TableUtils
.
tableName
(
datasetTable
.
getId
()),
root_path
+
outFile
+
"."
+
extention
);
jobName
=
"job_delete_"
+
TableUtils
.
tableName
(
datasetTable
.
getId
());
jobName
=
"job_delete_"
+
TableUtils
.
tableName
(
datasetTable
.
getId
());
break
;
break
;
default
:
default
:
...
...
frontend/src/views/system/datasource/form.vue
浏览文件 @
e5f5ab90
...
@@ -277,6 +277,7 @@ export default {
...
@@ -277,6 +277,7 @@ export default {
this
.
form
=
JSON
.
parse
(
JSON
.
stringify
(
row
))
this
.
form
=
JSON
.
parse
(
JSON
.
stringify
(
row
))
this
.
originConfiguration
=
this
.
form
.
configuration
this
.
originConfiguration
=
this
.
form
.
configuration
if
(
row
.
type
===
'api'
)
{
if
(
row
.
type
===
'api'
)
{
}
else
{
}
else
{
this
.
form
.
configuration
=
JSON
.
parse
(
this
.
form
.
configuration
)
this
.
form
.
configuration
=
JSON
.
parse
(
this
.
form
.
configuration
)
}
}
...
@@ -494,7 +495,9 @@ export default {
...
@@ -494,7 +495,9 @@ export default {
changeType
()
{
changeType
()
{
for
(
let
i
=
0
;
i
<
this
.
dsTypes
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
this
.
dsTypes
.
length
;
i
++
)
{
if
(
this
.
dsTypes
[
i
].
type
===
this
.
form
.
type
)
{
if
(
this
.
dsTypes
[
i
].
type
===
this
.
form
.
type
)
{
this
.
form
.
configuration
.
extraParams
=
this
.
dsTypes
[
i
].
extraParams
if
(
row
.
type
!==
'api'
){
this
.
form
.
configuration
.
extraParams
=
this
.
dsTypes
[
i
].
extraParams
}
this
.
datasourceType
=
this
.
dsTypes
[
i
]
this
.
datasourceType
=
this
.
dsTypes
[
i
]
}
}
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论