Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
zhu
dataease
Commits
c613c927
提交
c613c927
authored
4月 15, 2022
作者:
taojinlong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: 缓存引擎信息
上级
b731e599
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
8 行增加
和
13 行删除
+8
-13
EngineService.java
...c/main/java/io/dataease/service/engine/EngineService.java
+8
-13
没有找到文件。
backend/src/main/java/io/dataease/service/engine/EngineService.java
浏览文件 @
c613c927
...
@@ -13,15 +13,14 @@ import io.dataease.commons.utils.HttpClientConfig;
...
@@ -13,15 +13,14 @@ import io.dataease.commons.utils.HttpClientConfig;
import
io.dataease.commons.utils.HttpClientUtil
;
import
io.dataease.commons.utils.HttpClientUtil
;
import
io.dataease.controller.ResultHolder
;
import
io.dataease.controller.ResultHolder
;
import
io.dataease.controller.request.datasource.DatasourceRequest
;
import
io.dataease.controller.request.datasource.DatasourceRequest
;
import
io.dataease.dto.DatasourceDTO
;
import
io.dataease.dto.datasource.DorisConfiguration
;
import
io.dataease.dto.datasource.DorisConfiguration
;
import
io.dataease.dto.datasource.MysqlConfiguration
;
import
io.dataease.listener.util.CacheUtils
;
import
io.dataease.listener.util.CacheUtils
;
import
io.dataease.provider.ProviderFactory
;
import
io.dataease.provider.ProviderFactory
;
import
io.dataease.provider.datasource.DatasourceProvider
;
import
io.dataease.provider.datasource.DatasourceProvider
;
import
io.dataease.service.datasource.DatasourceService
;
import
io.dataease.service.datasource.DatasourceService
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.cache.annotation.Cacheable
;
import
org.springframework.core.env.Environment
;
import
org.springframework.core.env.Environment
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
...
@@ -152,16 +151,12 @@ public class EngineService {
...
@@ -152,16 +151,12 @@ public class EngineService {
}
}
private
void
setDs
(
DeEngine
engine
)
{
private
void
setDs
(
DeEngine
engine
)
{
Datasource
datasource
=
new
Datasource
();
CacheUtils
.
remove
(
"ENGINE"
,
"SimpleKey []"
);
BeanUtils
.
copyBean
(
datasource
,
engine
);
CacheUtils
.
put
(
"ENGINE"
,
"engine"
,
datasource
,
null
,
null
);
}
}
@Cacheable
(
value
=
"ENGINE"
)
public
Datasource
getDeEngine
()
throws
Exception
{
public
Datasource
getDeEngine
()
throws
Exception
{
Object
catcheEngine
=
CacheUtils
.
get
(
"ENGINE"
,
"engine"
);
Datasource
datasource
=
new
Datasource
();
if
(
catcheEngine
!=
null
)
{
return
(
Datasource
)
catcheEngine
;
}
if
(
isLocalMode
())
{
if
(
isLocalMode
())
{
JSONObject
jsonObject
=
new
JSONObject
();
JSONObject
jsonObject
=
new
JSONObject
();
...
@@ -179,7 +174,7 @@ public class EngineService {
...
@@ -179,7 +174,7 @@ public class EngineService {
engine
.
setDesc
(
"doris"
);
engine
.
setDesc
(
"doris"
);
engine
.
setType
(
"engine_doris"
);
engine
.
setType
(
"engine_doris"
);
engine
.
setConfiguration
(
jsonObject
.
toJSONString
());
engine
.
setConfiguration
(
jsonObject
.
toJSONString
());
setDs
(
engine
);
BeanUtils
.
copyBean
(
datasource
,
engine
);
}
}
if
(
isClusterMode
())
{
if
(
isClusterMode
())
{
DeEngineExample
engineExample
=
new
DeEngineExample
();
DeEngineExample
engineExample
=
new
DeEngineExample
();
...
@@ -188,7 +183,7 @@ public class EngineService {
...
@@ -188,7 +183,7 @@ public class EngineService {
if
(
CollectionUtils
.
isEmpty
(
deEngines
))
{
if
(
CollectionUtils
.
isEmpty
(
deEngines
))
{
throw
new
Exception
(
"未设置数据引擎"
);
throw
new
Exception
(
"未设置数据引擎"
);
}
}
setDs
(
deEngines
.
get
(
0
));
BeanUtils
.
copyBean
(
datasource
,
deEngines
.
get
(
0
));
}
}
if
(
isSimpleMode
())
{
if
(
isSimpleMode
())
{
DeEngineExample
engineExample
=
new
DeEngineExample
();
DeEngineExample
engineExample
=
new
DeEngineExample
();
...
@@ -197,9 +192,9 @@ public class EngineService {
...
@@ -197,9 +192,9 @@ public class EngineService {
if
(
CollectionUtils
.
isEmpty
(
deEngines
))
{
if
(
CollectionUtils
.
isEmpty
(
deEngines
))
{
throw
new
Exception
(
"未设置数据引擎"
);
throw
new
Exception
(
"未设置数据引擎"
);
}
}
setDs
(
deEngines
.
get
(
0
));
BeanUtils
.
copyBean
(
datasource
,
deEngines
.
get
(
0
));
}
}
return
getDeEngine
()
;
return
datasource
;
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论