Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
duckula
duckula-ops
提交
17eeeeab
duckula-ops
项目概览
duckula
/
duckula-ops
通知
6
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
duckula-ops
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
17eeeeab
编写于
7月 21, 2021
作者:
偏锋书生
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
doris改进,22号联调
上级
9409926f
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
349 addition
and
245 deletion
+349
-245
src/main/java/net/wicp/tams/app/duckula/controller/bean/constant/DorisRole.java
.../tams/app/duckula/controller/bean/constant/DorisRole.java
+36
-2
src/main/java/net/wicp/tams/app/duckula/controller/bean/models/DevopsDoris.java
.../tams/app/duckula/controller/bean/models/DevopsDoris.java
+54
-54
src/main/java/net/wicp/tams/app/duckula/controller/bean/models/DevopsDorisExample.java
...pp/duckula/controller/bean/models/DevopsDorisExample.java
+126
-126
src/main/java/net/wicp/tams/app/duckula/controller/dao/DevopsDorisMapper.java
...cp/tams/app/duckula/controller/dao/DevopsDorisMapper.java
+10
-10
src/main/java/net/wicp/tams/duckula/ops/pages/devops/DorisConfig.java
...a/net/wicp/tams/duckula/ops/pages/devops/DorisConfig.java
+94
-24
src/main/resources/mybatis/primary/sqlmap/DevopsDorisMapper.xml
...in/resources/mybatis/primary/sqlmap/DevopsDorisMapper.xml
+29
-29
未找到文件。
src/main/java/net/wicp/tams/app/duckula/controller/bean/constant/DorisRole.java
浏览文件 @
17eeeeab
package
net.wicp.tams.app.duckula.controller.bean.constant
;
import
java.util.HashMap
;
import
java.util.Map
;
import
org.apache.commons.lang3.StringUtils
;
import
net.wicp.tams.common.constant.dic.intf.IEnumCombobox
;
public
enum
DorisRole
implements
IEnumCombobox
{
BE
(
"数据"
),
FE
(
"前端"
);
follower
(
"FE-Follower"
,
"FE"
,
true
),
master
(
"FE-Master"
,
"FE"
,
true
),
observer
(
"FE-Observer"
,
"FE"
,
false
),
be
(
"BE"
,
"BE"
,
true
);
private
final
String
desc
;
private
final
String
type
;
// BE/FE
private
DorisRole
(
String
desc
)
{
private
final
boolean
need
;
// 是否一个集群内必须
private
DorisRole
(
String
desc
,
String
type
,
boolean
need
)
{
this
.
desc
=
desc
;
this
.
type
=
type
;
this
.
need
=
need
;
}
@Override
...
...
@@ -34,6 +48,26 @@ public enum DorisRole implements IEnumCombobox {
return
this
.
name
();
}
public
String
getType
()
{
return
type
;
}
public
boolean
isNeed
()
{
return
need
;
}
// 一定需要存在的角色状态
public
static
Map
<
DorisRole
,
Boolean
>
isExit
()
{
Map
<
DorisRole
,
Boolean
>
retmap
=
new
HashMap
<
DorisRole
,
Boolean
>();
DorisRole
[]
values
=
DorisRole
.
values
();
for
(
DorisRole
dorisRole
:
values
)
{
if
(
dorisRole
.
isNeed
())
{
retmap
.
put
(
dorisRole
,
Boolean
.
FALSE
);
}
}
return
retmap
;
}
public
static
DorisRole
find
(
String
name
)
{
if
(
StringUtils
.
isEmpty
(
name
))
{
return
null
;
...
...
src/main/java/net/wicp/tams/app/duckula/controller/bean/models/DevopsDoris.java
浏览文件 @
17eeeeab
...
...
@@ -24,44 +24,44 @@ public class DevopsDoris {
* Database Column Remarks: 客户名 This field was generated by MyBatis Generator. This field corresponds to the database column devops_doris.name
* @mbg.generated
*/
@TamsCol
(
value
=
"租户名"
,
save
=
1
,
query
=
1
,
showWidth
=
100
)
@TamsCol
(
value
=
"租户名"
,
save
=
1
,
query
=
1
,
showWidth
=
100
,
orderby
=
1
)
private
String
name
;
/**
* Database Column Remarks: ip1地址 This field was generated by MyBatis Generator. This field corresponds to the database column devops_doris.ip
* @mbg.generated
*/
@TamsCol
(
value
=
"IP地址"
,
save
=
1
,
query
=
1
,
showWidth
=
150
)
private
String
ip
;
/**
* Database Column Remarks: 集群 This field was generated by MyBatis Generator. This field corresponds to the database column devops_doris.cluster
* @mbg.generated
*/
@TamsCol
(
value
=
"集群"
,
save
=
1
,
query
=
0
,
showWidth
=
150
)
@TamsCol
(
value
=
"集群"
,
save
=
1
,
query
=
0
,
showWidth
=
150
,
orderby
=
2
)
private
String
cluster
;
/**
* Database Column Remarks:
服务器的角色 This field was generated by MyBatis Generator. This field corresponds to the database column devops_doris.roles
* Database Column Remarks:
ip1地址 This field was generated by MyBatis Generator. This field corresponds to the database column devops_doris.ip
* @mbg.generated
*/
@TamsCol
(
value
=
"
角色"
,
save
=
1
,
query
=
-
1
,
showWidth
=
150
,
multiple
=
true
,
enumClass
=
DorisRole
.
class
)
private
String
roles
;
@TamsCol
(
value
=
"
IP地址"
,
save
=
1
,
query
=
1
,
showWidth
=
150
,
orderby
=
3
)
private
String
ip
;
/**
* Database Column Remarks:
存储磁盘 This field was generated by MyBatis Generator. This field corresponds to the database column devops_doris.f
s
* Database Column Remarks:
服务器的角色 This field was generated by MyBatis Generator. This field corresponds to the database column devops_doris.role
s
* @mbg.generated
*/
@TamsCol
(
value
=
"
存储磁盘"
,
save
=
1
,
query
=
-
1
,
showWidth
=
150
)
private
String
f
s
;
@TamsCol
(
value
=
"
角色"
,
save
=
1
,
query
=
-
1
,
showWidth
=
280
,
multiple
=
true
,
enumClass
=
DorisRole
.
class
,
orderby
=
5
)
private
String
role
s
;
/**
* Database Column Remarks: root密码 This field was generated by MyBatis Generator. This field corresponds to the database column devops_doris.root_pwd
* @mbg.generated
*/
@TamsCol
(
value
=
"root密码"
,
save
=
1
,
query
=
-
1
)
@TamsCol
(
value
=
"root密码"
,
save
=
1
,
query
=
-
1
,
orderby
=
4
)
private
String
rootPwd
;
/**
* Database Column Remarks: 是否初始化,yes:已初始化 no:未初始化 创建duckula用户,创建环境变量创建目录 This field was generated by MyBatis Generator. This field corresponds to the database column devops_doris.is_init
* @mbg.generated
*/
@TamsCol
(
value
=
"初始化"
,
save
=
1
,
query
=
0
,
enumClass
=
YesOrNo
.
class
,
showWidth
=
100
)
@TamsCol
(
value
=
"初始化"
,
save
=
-
1
,
query
=
0
,
enumClass
=
YesOrNo
.
class
,
showWidth
=
100
)
private
String
isInit
;
/**
* Database Column Remarks: 已安装 This field was generated by MyBatis Generator. This field corresponds to the database column devops_doris.is_install
* @mbg.generated
*/
@TamsCol
(
value
=
"是否安装"
,
save
=
-
1
,
query
=
0
,
enumClass
=
YesOrNo
.
class
,
showWidth
=
100
)
private
String
isInstall
;
/**
* Database Column Remarks: 创建时间 This field was generated by MyBatis Generator. This field corresponds to the database column devops_doris.create_time
* @mbg.generated
...
...
@@ -77,16 +77,16 @@ public class DevopsDoris {
* This method was generated by MyBatis Generator. This method corresponds to the database table devops_doris
* @mbg.generated
*/
public
DevopsDoris
(
Long
id
,
String
name
,
String
ip
,
String
cluster
,
String
roles
,
String
fs
,
String
rootPwd
,
String
isIn
it
,
Date
createTime
,
Date
updateTime
)
{
public
DevopsDoris
(
Long
id
,
String
name
,
String
cluster
,
String
ip
,
String
roles
,
String
rootPwd
,
String
isInit
,
String
isIn
stall
,
Date
createTime
,
Date
updateTime
)
{
this
.
id
=
id
;
this
.
name
=
name
;
this
.
ip
=
ip
;
this
.
cluster
=
cluster
;
this
.
ip
=
ip
;
this
.
roles
=
roles
;
this
.
fs
=
fs
;
this
.
rootPwd
=
rootPwd
;
this
.
isInit
=
isInit
;
this
.
isInstall
=
isInstall
;
this
.
createTime
=
createTime
;
this
.
updateTime
=
updateTime
;
}
...
...
@@ -135,24 +135,6 @@ public class DevopsDoris {
this
.
name
=
name
;
}
/**
* This method was generated by MyBatis Generator. This method returns the value of the database column devops_doris.ip
* @return the value of devops_doris.ip
* @mbg.generated
*/
public
String
getIp
()
{
return
ip
;
}
/**
* This method was generated by MyBatis Generator. This method sets the value of the database column devops_doris.ip
* @param ip the value for devops_doris.ip
* @mbg.generated
*/
public
void
setIp
(
String
ip
)
{
this
.
ip
=
ip
;
}
/**
* This method was generated by MyBatis Generator. This method returns the value of the database column devops_doris.cluster
* @return the value of devops_doris.cluster
...
...
@@ -172,39 +154,39 @@ public class DevopsDoris {
}
/**
* This method was generated by MyBatis Generator. This method returns the value of the database column devops_doris.
roles
* @return the value of devops_doris.
roles
* This method was generated by MyBatis Generator. This method returns the value of the database column devops_doris.
ip
* @return the value of devops_doris.
ip
* @mbg.generated
*/
public
String
get
Roles
()
{
return
roles
;
public
String
get
Ip
()
{
return
ip
;
}
/**
* This method was generated by MyBatis Generator. This method sets the value of the database column devops_doris.
roles
* @param
roles the value for devops_doris.roles
* This method was generated by MyBatis Generator. This method sets the value of the database column devops_doris.
ip
* @param
ip the value for devops_doris.ip
* @mbg.generated
*/
public
void
set
Roles
(
String
roles
)
{
this
.
roles
=
roles
;
public
void
set
Ip
(
String
ip
)
{
this
.
ip
=
ip
;
}
/**
* This method was generated by MyBatis Generator. This method returns the value of the database column devops_doris.
f
s
* @return the value of devops_doris.
f
s
* This method was generated by MyBatis Generator. This method returns the value of the database column devops_doris.
role
s
* @return the value of devops_doris.
role
s
* @mbg.generated
*/
public
String
get
F
s
()
{
return
f
s
;
public
String
get
Role
s
()
{
return
role
s
;
}
/**
* This method was generated by MyBatis Generator. This method sets the value of the database column devops_doris.
f
s
* @param
fs the value for devops_doris.f
s
* This method was generated by MyBatis Generator. This method sets the value of the database column devops_doris.
role
s
* @param
roles the value for devops_doris.role
s
* @mbg.generated
*/
public
void
set
Fs
(
String
f
s
)
{
this
.
fs
=
f
s
;
public
void
set
Roles
(
String
role
s
)
{
this
.
roles
=
role
s
;
}
/**
...
...
@@ -243,6 +225,24 @@ public class DevopsDoris {
this
.
isInit
=
isInit
;
}
/**
* This method was generated by MyBatis Generator. This method returns the value of the database column devops_doris.is_install
* @return the value of devops_doris.is_install
* @mbg.generated
*/
public
String
getIsInstall
()
{
return
isInstall
;
}
/**
* This method was generated by MyBatis Generator. This method sets the value of the database column devops_doris.is_install
* @param isInstall the value for devops_doris.is_install
* @mbg.generated
*/
public
void
setIsInstall
(
String
isInstall
)
{
this
.
isInstall
=
isInstall
;
}
/**
* This method was generated by MyBatis Generator. This method returns the value of the database column devops_doris.create_time
* @return the value of devops_doris.create_time
...
...
src/main/java/net/wicp/tams/app/duckula/controller/bean/models/DevopsDorisExample.java
浏览文件 @
17eeeeab
...
...
@@ -293,76 +293,6 @@ public class DevopsDorisExample {
return
(
Criteria
)
this
;
}
public
Criteria
andIpIsNull
()
{
addCriterion
(
"ip is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIpIsNotNull
()
{
addCriterion
(
"ip is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIpEqualTo
(
String
value
)
{
addCriterion
(
"ip ="
,
value
,
"ip"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIpNotEqualTo
(
String
value
)
{
addCriterion
(
"ip <>"
,
value
,
"ip"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIpGreaterThan
(
String
value
)
{
addCriterion
(
"ip >"
,
value
,
"ip"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIpGreaterThanOrEqualTo
(
String
value
)
{
addCriterion
(
"ip >="
,
value
,
"ip"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIpLessThan
(
String
value
)
{
addCriterion
(
"ip <"
,
value
,
"ip"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIpLessThanOrEqualTo
(
String
value
)
{
addCriterion
(
"ip <="
,
value
,
"ip"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIpLike
(
String
value
)
{
addCriterion
(
"ip like"
,
value
,
"ip"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIpNotLike
(
String
value
)
{
addCriterion
(
"ip not like"
,
value
,
"ip"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIpIn
(
List
<
String
>
values
)
{
addCriterion
(
"ip in"
,
values
,
"ip"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIpNotIn
(
List
<
String
>
values
)
{
addCriterion
(
"ip not in"
,
values
,
"ip"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIpBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"ip between"
,
value1
,
value2
,
"ip"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIpNotBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"ip not between"
,
value1
,
value2
,
"ip"
);
return
(
Criteria
)
this
;
}
public
Criteria
andClusterIsNull
()
{
addCriterion
(
"cluster is null"
);
return
(
Criteria
)
this
;
...
...
@@ -433,143 +363,143 @@ public class DevopsDorisExample {
return
(
Criteria
)
this
;
}
public
Criteria
and
Roles
IsNull
()
{
addCriterion
(
"
roles
is null"
);
public
Criteria
and
Ip
IsNull
()
{
addCriterion
(
"
ip
is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
and
Roles
IsNotNull
()
{
addCriterion
(
"
roles
is not null"
);
public
Criteria
and
Ip
IsNotNull
()
{
addCriterion
(
"
ip
is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
and
Roles
EqualTo
(
String
value
)
{
addCriterion
(
"
roles ="
,
value
,
"roles
"
);
public
Criteria
and
Ip
EqualTo
(
String
value
)
{
addCriterion
(
"
ip ="
,
value
,
"ip
"
);
return
(
Criteria
)
this
;
}
public
Criteria
and
Roles
NotEqualTo
(
String
value
)
{
addCriterion
(
"
roles <>"
,
value
,
"roles
"
);
public
Criteria
and
Ip
NotEqualTo
(
String
value
)
{
addCriterion
(
"
ip <>"
,
value
,
"ip
"
);
return
(
Criteria
)
this
;
}
public
Criteria
and
Roles
GreaterThan
(
String
value
)
{
addCriterion
(
"
roles >"
,
value
,
"roles
"
);
public
Criteria
and
Ip
GreaterThan
(
String
value
)
{
addCriterion
(
"
ip >"
,
value
,
"ip
"
);
return
(
Criteria
)
this
;
}
public
Criteria
and
Roles
GreaterThanOrEqualTo
(
String
value
)
{
addCriterion
(
"
roles >="
,
value
,
"roles
"
);
public
Criteria
and
Ip
GreaterThanOrEqualTo
(
String
value
)
{
addCriterion
(
"
ip >="
,
value
,
"ip
"
);
return
(
Criteria
)
this
;
}
public
Criteria
and
Roles
LessThan
(
String
value
)
{
addCriterion
(
"
roles <"
,
value
,
"roles
"
);
public
Criteria
and
Ip
LessThan
(
String
value
)
{
addCriterion
(
"
ip <"
,
value
,
"ip
"
);
return
(
Criteria
)
this
;
}
public
Criteria
and
Roles
LessThanOrEqualTo
(
String
value
)
{
addCriterion
(
"
roles <="
,
value
,
"roles
"
);
public
Criteria
and
Ip
LessThanOrEqualTo
(
String
value
)
{
addCriterion
(
"
ip <="
,
value
,
"ip
"
);
return
(
Criteria
)
this
;
}
public
Criteria
and
Roles
Like
(
String
value
)
{
addCriterion
(
"
roles like"
,
value
,
"roles
"
);
public
Criteria
and
Ip
Like
(
String
value
)
{
addCriterion
(
"
ip like"
,
value
,
"ip
"
);
return
(
Criteria
)
this
;
}
public
Criteria
and
Roles
NotLike
(
String
value
)
{
addCriterion
(
"
roles not like"
,
value
,
"roles
"
);
public
Criteria
and
Ip
NotLike
(
String
value
)
{
addCriterion
(
"
ip not like"
,
value
,
"ip
"
);
return
(
Criteria
)
this
;
}
public
Criteria
and
Roles
In
(
List
<
String
>
values
)
{
addCriterion
(
"
roles in"
,
values
,
"roles
"
);
public
Criteria
and
Ip
In
(
List
<
String
>
values
)
{
addCriterion
(
"
ip in"
,
values
,
"ip
"
);
return
(
Criteria
)
this
;
}
public
Criteria
and
Roles
NotIn
(
List
<
String
>
values
)
{
addCriterion
(
"
roles not in"
,
values
,
"roles
"
);
public
Criteria
and
Ip
NotIn
(
List
<
String
>
values
)
{
addCriterion
(
"
ip not in"
,
values
,
"ip
"
);
return
(
Criteria
)
this
;
}
public
Criteria
and
Roles
Between
(
String
value1
,
String
value2
)
{
addCriterion
(
"
roles between"
,
value1
,
value2
,
"roles
"
);
public
Criteria
and
Ip
Between
(
String
value1
,
String
value2
)
{
addCriterion
(
"
ip between"
,
value1
,
value2
,
"ip
"
);
return
(
Criteria
)
this
;
}
public
Criteria
and
Roles
NotBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"
roles not between"
,
value1
,
value2
,
"roles
"
);
public
Criteria
and
Ip
NotBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"
ip not between"
,
value1
,
value2
,
"ip
"
);
return
(
Criteria
)
this
;
}
public
Criteria
and
F
sIsNull
()
{
addCriterion
(
"
f
s is null"
);
public
Criteria
and
Role
sIsNull
()
{
addCriterion
(
"
role
s is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
and
F
sIsNotNull
()
{
addCriterion
(
"
f
s is not null"
);
public
Criteria
and
Role
sIsNotNull
()
{
addCriterion
(
"
role
s is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
and
F
sEqualTo
(
String
value
)
{
addCriterion
(
"
fs ="
,
value
,
"f
s"
);
public
Criteria
and
Role
sEqualTo
(
String
value
)
{
addCriterion
(
"
roles ="
,
value
,
"role
s"
);
return
(
Criteria
)
this
;
}
public
Criteria
and
F
sNotEqualTo
(
String
value
)
{
addCriterion
(
"
fs <>"
,
value
,
"f
s"
);
public
Criteria
and
Role
sNotEqualTo
(
String
value
)
{
addCriterion
(
"
roles <>"
,
value
,
"role
s"
);
return
(
Criteria
)
this
;
}
public
Criteria
and
F
sGreaterThan
(
String
value
)
{
addCriterion
(
"
fs >"
,
value
,
"f
s"
);
public
Criteria
and
Role
sGreaterThan
(
String
value
)
{
addCriterion
(
"
roles >"
,
value
,
"role
s"
);
return
(
Criteria
)
this
;
}
public
Criteria
and
F
sGreaterThanOrEqualTo
(
String
value
)
{
addCriterion
(
"
fs >="
,
value
,
"f
s"
);
public
Criteria
and
Role
sGreaterThanOrEqualTo
(
String
value
)
{
addCriterion
(
"
roles >="
,
value
,
"role
s"
);
return
(
Criteria
)
this
;
}
public
Criteria
and
F
sLessThan
(
String
value
)
{
addCriterion
(
"
fs <"
,
value
,
"f
s"
);
public
Criteria
and
Role
sLessThan
(
String
value
)
{
addCriterion
(
"
roles <"
,
value
,
"role
s"
);
return
(
Criteria
)
this
;
}
public
Criteria
and
F
sLessThanOrEqualTo
(
String
value
)
{
addCriterion
(
"
fs <="
,
value
,
"f
s"
);
public
Criteria
and
Role
sLessThanOrEqualTo
(
String
value
)
{
addCriterion
(
"
roles <="
,
value
,
"role
s"
);
return
(
Criteria
)
this
;
}
public
Criteria
and
F
sLike
(
String
value
)
{
addCriterion
(
"
fs like"
,
value
,
"f
s"
);
public
Criteria
and
Role
sLike
(
String
value
)
{
addCriterion
(
"
roles like"
,
value
,
"role
s"
);
return
(
Criteria
)
this
;
}
public
Criteria
and
F
sNotLike
(
String
value
)
{
addCriterion
(
"
fs not like"
,
value
,
"f
s"
);
public
Criteria
and
Role
sNotLike
(
String
value
)
{
addCriterion
(
"
roles not like"
,
value
,
"role
s"
);
return
(
Criteria
)
this
;
}
public
Criteria
and
F
sIn
(
List
<
String
>
values
)
{
addCriterion
(
"
fs in"
,
values
,
"f
s"
);
public
Criteria
and
Role
sIn
(
List
<
String
>
values
)
{
addCriterion
(
"
roles in"
,
values
,
"role
s"
);
return
(
Criteria
)
this
;
}
public
Criteria
and
F
sNotIn
(
List
<
String
>
values
)
{
addCriterion
(
"
fs not in"
,
values
,
"f
s"
);
public
Criteria
and
Role
sNotIn
(
List
<
String
>
values
)
{
addCriterion
(
"
roles not in"
,
values
,
"role
s"
);
return
(
Criteria
)
this
;
}
public
Criteria
and
F
sBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"
fs between"
,
value1
,
value2
,
"f
s"
);
public
Criteria
and
Role
sBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"
roles between"
,
value1
,
value2
,
"role
s"
);
return
(
Criteria
)
this
;
}
public
Criteria
and
F
sNotBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"
fs not between"
,
value1
,
value2
,
"f
s"
);
public
Criteria
and
Role
sNotBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"
roles not between"
,
value1
,
value2
,
"role
s"
);
return
(
Criteria
)
this
;
}
...
...
@@ -713,6 +643,76 @@ public class DevopsDorisExample {
return
(
Criteria
)
this
;
}
public
Criteria
andIsInstallIsNull
()
{
addCriterion
(
"is_install is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIsInstallIsNotNull
()
{
addCriterion
(
"is_install is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIsInstallEqualTo
(
String
value
)
{
addCriterion
(
"is_install ="
,
value
,
"isInstall"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIsInstallNotEqualTo
(
String
value
)
{
addCriterion
(
"is_install <>"
,
value
,
"isInstall"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIsInstallGreaterThan
(
String
value
)
{
addCriterion
(
"is_install >"
,
value
,
"isInstall"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIsInstallGreaterThanOrEqualTo
(
String
value
)
{
addCriterion
(
"is_install >="
,
value
,
"isInstall"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIsInstallLessThan
(
String
value
)
{
addCriterion
(
"is_install <"
,
value
,
"isInstall"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIsInstallLessThanOrEqualTo
(
String
value
)
{
addCriterion
(
"is_install <="
,
value
,
"isInstall"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIsInstallLike
(
String
value
)
{
addCriterion
(
"is_install like"
,
value
,
"isInstall"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIsInstallNotLike
(
String
value
)
{
addCriterion
(
"is_install not like"
,
value
,
"isInstall"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIsInstallIn
(
List
<
String
>
values
)
{
addCriterion
(
"is_install in"
,
values
,
"isInstall"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIsInstallNotIn
(
List
<
String
>
values
)
{
addCriterion
(
"is_install not in"
,
values
,
"isInstall"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIsInstallBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"is_install between"
,
value1
,
value2
,
"isInstall"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIsInstallNotBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"is_install not between"
,
value1
,
value2
,
"isInstall"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTimeIsNull
()
{
addCriterion
(
"create_time is null"
);
return
(
Criteria
)
this
;
...
...
src/main/java/net/wicp/tams/app/duckula/controller/dao/DevopsDorisMapper.java
浏览文件 @
17eeeeab
...
...
@@ -39,11 +39,11 @@ public interface DevopsDorisMapper extends BaseMapper<DevopsDoris> {
* This method was generated by MyBatis Generator. This method corresponds to the database table devops_doris
* @mbg.generated
*/
@Insert
({
"insert into devops_doris (id, name, "
,
"
ip, cluster, roles, "
,
"fs,
root_pwd, is_init, "
,
"
create_time,
update_time)"
,
"values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, "
,
"#{
ip,jdbcType=VARCHAR}, #{cluster
,jdbcType=VARCHAR}, #{roles,jdbcType=VARCHAR}, "
,
"#{
fs,jdbcType=VARCHAR}, #{
rootPwd,jdbcType=VARCHAR}, #{isInit,jdbcType=VARCHAR}, "
,
"#{
createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP})"
})
@Insert
({
"insert into devops_doris (id, name, "
,
"
cluster, ip, roles, "
,
"
root_pwd, is_init, "
,
"
is_install, create_time, "
,
"
update_time)"
,
"values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, "
,
"#{
cluster,jdbcType=VARCHAR}, #{ip
,jdbcType=VARCHAR}, #{roles,jdbcType=VARCHAR}, "
,
"#{rootPwd,jdbcType=VARCHAR}, #{isInit,jdbcType=VARCHAR}, "
,
"#{
isInstall,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, "
,
"
#{updateTime,jdbcType=TIMESTAMP})"
})
int
insert
(
DevopsDoris
record
);
/**
...
...
@@ -62,7 +62,7 @@ public interface DevopsDorisMapper extends BaseMapper<DevopsDoris> {
* This method was generated by MyBatis Generator. This method corresponds to the database table devops_doris
* @mbg.generated
*/
@Select
({
"select"
,
"id, name,
ip, cluster, roles, fs, root_pwd, is_init
, create_time, update_time"
,
@Select
({
"select"
,
"id, name,
cluster, ip, roles, root_pwd, is_init, is_install
, create_time, update_time"
,
"from devops_doris"
,
"where id = #{id,jdbcType=BIGINT}"
})
@ResultMap
(
"net.wicp.tams.app.duckula.controller.dao.DevopsDorisMapper.BaseResultMap"
)
DevopsDoris
selectByPrimaryKey
(
Long
id
);
...
...
@@ -89,10 +89,10 @@ public interface DevopsDorisMapper extends BaseMapper<DevopsDoris> {
* This method was generated by MyBatis Generator. This method corresponds to the database table devops_doris
* @mbg.generated
*/
@Update
({
"update devops_doris"
,
"set name = #{name,jdbcType=VARCHAR},"
,
"
ip = #{ip
,jdbcType=VARCHAR},"
,
"
cluster = #{cluster
,jdbcType=VARCHAR},"
,
"roles = #{roles,jdbcType=VARCHAR},"
,
"
fs = #{fs,jdbcType=VARCHAR},"
,
"root_pwd = #{rootPwd
,jdbcType=VARCHAR},"
,
"is_in
it = #{isInit
,jdbcType=VARCHAR},"
,
"create_time = #{createTime,jdbcType=TIMESTAMP},"
,
@Update
({
"update devops_doris"
,
"set name = #{name,jdbcType=VARCHAR},"
,
"
cluster = #{cluster
,jdbcType=VARCHAR},"
,
"
ip = #{ip
,jdbcType=VARCHAR},"
,
"roles = #{roles,jdbcType=VARCHAR},"
,
"
root_pwd = #{rootPwd,jdbcType=VARCHAR},"
,
"is_init = #{isInit
,jdbcType=VARCHAR},"
,
"is_in
stall = #{isInstall
,jdbcType=VARCHAR},"
,
"create_time = #{createTime,jdbcType=TIMESTAMP},"
,
"update_time = #{updateTime,jdbcType=TIMESTAMP}"
,
"where id = #{id,jdbcType=BIGINT}"
})
int
updateByPrimaryKey
(
DevopsDoris
record
);
}
\ No newline at end of file
src/main/java/net/wicp/tams/duckula/ops/pages/devops/DorisConfig.java
浏览文件 @
17eeeeab
package
net.wicp.tams.duckula.ops.pages.devops
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.
Set
;
import
java.util.
Map
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.tapestry5.ioc.annotations.Inject
;
import
org.apache.tapestry5.util.TextStreamResponse
;
...
...
@@ -10,18 +13,18 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
lombok.extern.slf4j.Slf4j
;
import
net.wicp.tams.app.duckula.controller.bean.constant.DorisRole
;
import
net.wicp.tams.app.duckula.controller.bean.models.DevopsDoris
;
import
net.wicp.tams.app.duckula.controller.bean.models.DevopsDorisExample
;
import
net.wicp.tams.app.duckula.controller.bean.models.DevopsDorisExample.Criteria
;
import
net.wicp.tams.app.duckula.controller.config.constant.DevOpsType
;
import
net.wicp.tams.app.duckula.controller.dao.DevopsDorisMapper
;
import
net.wicp.tams.common.Result
;
import
net.wicp.tams.common.apiext.CollectionUtil
;
import
net.wicp.tams.common.apiext.IOUtil
;
import
net.wicp.tams.common.apiext.StringUtil
;
import
net.wicp.tams.common.apiext.json.JSONUtil
;
import
net.wicp.tams.common.constant.PathType
;
import
net.wicp.tams.common.exception.ExceptAll
;
import
net.wicp.tams.common.exception.ProjectExceptionRuntime
;
import
net.wicp.tams.common.os.SSHAssit
;
import
net.wicp.tams.common.os.bean.DiskBean
;
import
net.wicp.tams.common.os.pool.SSHConnection
;
import
net.wicp.tams.component.tools.TapestryAssist
;
import
net.wicp.tams.duckula.ops.pages.ParentPageBean
;
...
...
@@ -34,19 +37,18 @@ public class DorisConfig extends ParentPageBean<DevopsDoris> {
@Override
public
void
doSave
(
DevopsDoris
t
,
boolean
isInsert
)
{
// 1、登陆
SSHConnection
conn
=
SSHAssit
.
getConn
(
t
.
getIp
(),
"root"
,
t
.
getRootPwd
());
try
{
List
<
DiskBean
>
list
=
conn
.
fdiskData
();
Set
<
String
>
paths
=
CollectionUtil
.
getColSetFromObj
(
list
,
"path"
);
if
(!
paths
.
contains
(
t
.
getFs
()))
{
throw
new
ProjectExceptionRuntime
(
ExceptAll
.
param_error
,
"存储磁盘不正确,只能填写:"
+
CollectionUtil
.
arrayJoin
(
paths
.
toArray
(
new
String
[
paths
.
size
()]),
","
));
}
}
finally
{
SSHAssit
.
close
(
conn
);
}
// 由shell命令检查磁盘,程序不写
// SSHConnection conn = SSHAssit.getConn(t.getIp(), "root", t.getRootPwd());
// try {
// List<DiskBean> list = conn.fdiskData();
// Set<String> paths = CollectionUtil.getColSetFromObj(list, "path");
// if (!paths.contains(t.getFs())) {
// throw new ProjectExceptionRuntime(ExceptAll.param_error,
// "存储磁盘不正确,只能填写:" + CollectionUtil.arrayJoin(paths.toArray(new String[paths.size()]), ","));
// }
// } finally {
// SSHAssit.close(conn);
// }
if
(
isInsert
)
{
devopsDorisMapper
.
insert
(
t
);
}
else
{
...
...
@@ -92,16 +94,46 @@ public class DorisConfig extends ParentPageBean<DevopsDoris> {
* @return
*/
public
TextStreamResponse
onCheckHost
()
{
final
DevopsDoris
DevopsDoris
=
TapestryAssist
.
getBeanFromPage
(
DevopsDoris
.
class
,
requestGlobals
);
final
DevopsDoris
devopsDoris
=
TapestryAssist
.
getBeanFromPage
(
DevopsDoris
.
class
,
requestGlobals
);
List
<
DevopsDoris
>
list
=
queryHostByCluster
(
devopsDoris
.
getCluster
());
Map
<
DorisRole
,
Boolean
>
exit
=
DorisRole
.
isExit
();
for
(
DevopsDoris
devopsDoris2
:
list
)
{
if
(
StringUtil
.
isNotNull
(
devopsDoris2
.
getRoles
()))
{
String
[]
splits
=
devopsDoris2
.
getRoles
().
split
(
","
);
for
(
String
split
:
splits
)
{
if
(
exit
.
containsKey
(
DorisRole
.
valueOf
(
split
)))
{
exit
.
put
(
DorisRole
.
valueOf
(
split
),
true
);
}
}
}
}
StringBuffer
buff
=
new
StringBuffer
();
for
(
DorisRole
dorisRole
:
exit
.
keySet
())
{
if
(!
exit
.
get
(
dorisRole
))
{
buff
.
append
(
","
+
dorisRole
.
name
());
}
}
if
(
buff
.
length
()
>
0
)
{
return
TapestryAssist
.
getTextStreamResponse
(
Result
.
getError
(
"下列角色需要配置:"
+
buff
.
substring
(
1
)));
}
// 1、OSS下载
String
localPath
=
PathType
.
getPath
(
DevOpsType
.
flink
.
getCheckurl
());
String
localPath
=
PathType
.
getPath
(
DevOpsType
.
doris
.
getCheckurl
());
// 1、登陆
SSHConnection
conn
=
SSHAssit
.
getConn
(
DevopsDoris
.
getIp
(),
"root"
,
D
evopsDoris
.
getRootPwd
());
SSHConnection
conn
=
SSHAssit
.
getConn
(
devopsDoris
.
getIp
(),
"root"
,
d
evopsDoris
.
getRootPwd
());
try
{
String
fileName
=
localPath
.
substring
(
localPath
.
lastIndexOf
(
"/"
)
+
1
);
conn
.
scp
(
localPath
,
fileName
,
"~"
,
"0744"
);
String
remoteDir
=
DevOpsType
.
doris
.
getRemoteDirCheckDir
();
conn
.
executeCommand
(
"mkdir -p "
+
remoteDir
);
conn
.
scpToDir
(
localPath
,
remoteDir
);
// conn.scp(localPath, DevOpsType.doris.getRelaPathCheck(), "~", "0744");
// echo 11441 > test 覆盖,echo 1234567 >> test追加 touch test 创建一个空文件
String
context
=
configContext
(
devopsDoris
.
getCluster
());
conn
.
executeCommand
(
"echo -e \""
+
context
+
"\" > "
+
IOUtil
.
mergeFolderAndFilePath
(
DevOpsType
.
doris
.
getRemoteDirCheckDir
(),
"DorisIP.conf"
));
// 执行
Result
result
=
conn
.
executeCommand
(
String
.
format
(
"sh ~/%s"
,
fileName
));
Result
result
=
conn
.
executeCommand
(
String
.
format
(
"sh %s"
,
IOUtil
.
mergeFolderAndFilePath
(
"~/"
,
DevOpsType
.
doris
.
getRelaPathCheck
())));
log
.
info
(
result
.
getMessage
());
return
TapestryAssist
.
getTextStreamResponse
(
Result
.
getError
(
"检查结果:"
+
result
.
getMessage
()));
}
finally
{
...
...
@@ -109,4 +141,42 @@ public class DorisConfig extends ParentPageBean<DevopsDoris> {
}
}
public
String
configContext
(
String
cluster
)
{
List
<
DevopsDoris
>
list
=
queryHostByCluster
(
cluster
);
Map
<
DorisRole
,
List
<
String
>>
retmap
=
new
HashMap
<
DorisRole
,
List
<
String
>>();
for
(
DevopsDoris
ele
:
list
)
{
String
[]
rolesStr
=
ele
.
getRoles
().
split
(
","
,
0
);
for
(
String
roleStr
:
rolesStr
)
{
DorisRole
temp
=
DorisRole
.
valueOf
(
roleStr
);
List
<
String
>
list2
=
retmap
.
get
(
temp
);
if
(
CollectionUtils
.
isEmpty
(
list2
))
{
list2
=
new
ArrayList
<
String
>();
}
list2
.
add
(
ele
.
getIp
());
retmap
.
put
(
temp
,
list2
);
}
}
// 添加不设置的角色
for
(
DorisRole
dorisRole
:
DorisRole
.
values
())
{
if
(!
retmap
.
containsKey
(
dorisRole
))
{
retmap
.
put
(
dorisRole
,
new
ArrayList
<
String
>());
}
}
StringBuffer
buff
=
new
StringBuffer
();
for
(
DorisRole
dorisRole
:
retmap
.
keySet
())
{
buff
.
append
(
String
.
format
(
"\n%s,%s"
,
dorisRole
.
name
(),
StringUtil
.
hasNull
(
CollectionUtil
.
listJoin
(
retmap
.
get
(
dorisRole
),
","
),
""
)));
}
return
buff
.
substring
(
1
);
}
// 不排序是以id顺序
private
List
<
DevopsDoris
>
queryHostByCluster
(
String
cluster
)
{
DevopsDorisExample
example
=
new
DevopsDorisExample
();
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andClusterEqualTo
(
cluster
);
List
<
DevopsDoris
>
list
=
devopsDorisMapper
.
selectByExample
(
example
);
return
list
;
}
}
src/main/resources/mybatis/primary/sqlmap/DevopsDorisMapper.xml
浏览文件 @
17eeeeab
...
...
@@ -9,12 +9,12 @@
<constructor>
<idArg
column=
"id"
javaType=
"java.lang.Long"
jdbcType=
"BIGINT"
/>
<arg
column=
"name"
javaType=
"java.lang.String"
jdbcType=
"VARCHAR"
/>
<arg
column=
"ip"
javaType=
"java.lang.String"
jdbcType=
"VARCHAR"
/>
<arg
column=
"cluster"
javaType=
"java.lang.String"
jdbcType=
"VARCHAR"
/>
<arg
column=
"ip"
javaType=
"java.lang.String"
jdbcType=
"VARCHAR"
/>
<arg
column=
"roles"
javaType=
"java.lang.String"
jdbcType=
"VARCHAR"
/>
<arg
column=
"fs"
javaType=
"java.lang.String"
jdbcType=
"VARCHAR"
/>
<arg
column=
"root_pwd"
javaType=
"java.lang.String"
jdbcType=
"VARCHAR"
/>
<arg
column=
"is_init"
javaType=
"java.lang.String"
jdbcType=
"VARCHAR"
/>
<arg
column=
"is_install"
javaType=
"java.lang.String"
jdbcType=
"VARCHAR"
/>
<arg
column=
"create_time"
javaType=
"java.util.Date"
jdbcType=
"TIMESTAMP"
/>
<arg
column=
"update_time"
javaType=
"java.util.Date"
jdbcType=
"TIMESTAMP"
/>
</constructor>
...
...
@@ -90,7 +90,7 @@
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
id, name,
ip, cluster, roles, fs, root_pwd, is_init
, create_time, update_time
id, name,
cluster, ip, roles, root_pwd, is_init, is_install
, create_time, update_time
</sql>
<select
id=
"selectByExample"
parameterType=
"net.wicp.tams.app.duckula.controller.bean.models.DevopsDorisExample"
resultMap=
"BaseResultMap"
>
<!--
...
...
@@ -133,24 +133,24 @@
<if
test=
"name != null"
>
name,
</if>
<if
test=
"ip != null"
>
ip,
</if>
<if
test=
"cluster != null"
>
cluster,
</if>
<if
test=
"ip != null"
>
ip,
</if>
<if
test=
"roles != null"
>
roles,
</if>
<if
test=
"fs != null"
>
fs,
</if>
<if
test=
"rootPwd != null"
>
root_pwd,
</if>
<if
test=
"isInit != null"
>
is_init,
</if>
<if
test=
"isInstall != null"
>
is_install,
</if>
<if
test=
"createTime != null"
>
create_time,
</if>
...
...
@@ -165,24 +165,24 @@
<if
test=
"name != null"
>
#{name,jdbcType=VARCHAR},
</if>
<if
test=
"ip != null"
>
#{ip,jdbcType=VARCHAR},
</if>
<if
test=
"cluster != null"
>
#{cluster,jdbcType=VARCHAR},
</if>
<if
test=
"ip != null"
>
#{ip,jdbcType=VARCHAR},
</if>
<if
test=
"roles != null"
>
#{roles,jdbcType=VARCHAR},
</if>
<if
test=
"fs != null"
>
#{fs,jdbcType=VARCHAR},
</if>
<if
test=
"rootPwd != null"
>
#{rootPwd,jdbcType=VARCHAR},
</if>
<if
test=
"isInit != null"
>
#{isInit,jdbcType=VARCHAR},
</if>
<if
test=
"isInstall != null"
>
#{isInstall,jdbcType=VARCHAR},
</if>
<if
test=
"createTime != null"
>
#{createTime,jdbcType=TIMESTAMP},
</if>
...
...
@@ -214,24 +214,24 @@
<if
test=
"record.name != null"
>
name = #{record.name,jdbcType=VARCHAR},
</if>
<if
test=
"record.ip != null"
>
ip = #{record.ip,jdbcType=VARCHAR},
</if>
<if
test=
"record.cluster != null"
>
cluster = #{record.cluster,jdbcType=VARCHAR},
</if>
<if
test=
"record.ip != null"
>
ip = #{record.ip,jdbcType=VARCHAR},
</if>
<if
test=
"record.roles != null"
>
roles = #{record.roles,jdbcType=VARCHAR},
</if>
<if
test=
"record.fs != null"
>
fs = #{record.fs,jdbcType=VARCHAR},
</if>
<if
test=
"record.rootPwd != null"
>
root_pwd = #{record.rootPwd,jdbcType=VARCHAR},
</if>
<if
test=
"record.isInit != null"
>
is_init = #{record.isInit,jdbcType=VARCHAR},
</if>
<if
test=
"record.isInstall != null"
>
is_install = #{record.isInstall,jdbcType=VARCHAR},
</if>
<if
test=
"record.createTime != null"
>
create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if>
...
...
@@ -251,12 +251,12 @@
update devops_doris
set id = #{record.id,jdbcType=BIGINT},
name = #{record.name,jdbcType=VARCHAR},
ip = #{record.ip,jdbcType=VARCHAR},
cluster = #{record.cluster,jdbcType=VARCHAR},
ip = #{record.ip,jdbcType=VARCHAR},
roles = #{record.roles,jdbcType=VARCHAR},
fs = #{record.fs,jdbcType=VARCHAR},
root_pwd = #{record.rootPwd,jdbcType=VARCHAR},
is_init = #{record.isInit,jdbcType=VARCHAR},
is_install = #{record.isInstall,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
update_time = #{record.updateTime,jdbcType=TIMESTAMP}
<if
test=
"_parameter != null"
>
...
...
@@ -273,24 +273,24 @@
<if
test=
"name != null"
>
name = #{name,jdbcType=VARCHAR},
</if>
<if
test=
"ip != null"
>
ip = #{ip,jdbcType=VARCHAR},
</if>
<if
test=
"cluster != null"
>
cluster = #{cluster,jdbcType=VARCHAR},
</if>
<if
test=
"ip != null"
>
ip = #{ip,jdbcType=VARCHAR},
</if>
<if
test=
"roles != null"
>
roles = #{roles,jdbcType=VARCHAR},
</if>
<if
test=
"fs != null"
>
fs = #{fs,jdbcType=VARCHAR},
</if>
<if
test=
"rootPwd != null"
>
root_pwd = #{rootPwd,jdbcType=VARCHAR},
</if>
<if
test=
"isInit != null"
>
is_init = #{isInit,jdbcType=VARCHAR},
</if>
<if
test=
"isInstall != null"
>
is_install = #{isInstall,jdbcType=VARCHAR},
</if>
<if
test=
"createTime != null"
>
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录