Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dlink
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhaowei
dlink
Commits
476f31f6
Commit
476f31f6
authored
Dec 02, 2021
by
wenmo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
回收过期集群
parent
45fedaef
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
56 additions
and
285 deletions
+56
-285
.gitignore
.gitignore
+1
-2
ClusterController.java
...src/main/java/com/dlink/controller/ClusterController.java
+8
-0
ClusterService.java
...admin/src/main/java/com/dlink/service/ClusterService.java
+4
-0
ClusterServiceImpl.java
.../main/java/com/dlink/service/impl/ClusterServiceImpl.java
+20
-1
dependency-reduced-pom.xml
dlink-client/dlink-client-1.11/dependency-reduced-pom.xml
+0
-70
dependency-reduced-pom.xml
dlink-client/dlink-client-1.12/dependency-reduced-pom.xml
+0
-70
dependency-reduced-pom.xml
dlink-client/dlink-client-1.13/dependency-reduced-pom.xml
+0
-70
dependency-reduced-pom.xml
dlink-client/dlink-client-1.14/dependency-reduced-pom.xml
+0
-70
index.tsx
dlink-web/src/pages/Cluster/index.tsx
+20
-2
Welcome.tsx
dlink-web/src/pages/Welcome.tsx
+3
-0
No files found.
.gitignore
View file @
476f31f6
...
...
@@ -29,7 +29,6 @@ target/*
*/target/*
*/*/target/*
dlink-web/node_modules/*
d
atalink-web/node_modules
/*
d
link-web/node
/*
dlink-web/dist/*
datalink-web/dist/*
dlink-admin/src/main/resources/static/*
dlink-admin/src/main/java/com/dlink/controller/ClusterController.java
View file @
476f31f6
...
...
@@ -109,4 +109,12 @@ public class ClusterController {
return
Result
.
succeed
(
"状态刷新完成"
);
}
/**
* 回收过期集群
*/
@GetMapping
(
"/clear"
)
public
Result
clear
()
{
return
Result
.
succeed
(
clusterService
.
clearCluster
(),
"回收完成"
);
}
}
dlink-admin/src/main/java/com/dlink/service/ClusterService.java
View file @
476f31f6
...
...
@@ -28,5 +28,9 @@ public interface ClusterService extends ISuperService<Cluster> {
List
<
Cluster
>
listSessionEnable
();
List
<
Cluster
>
listAutoEnable
();
Cluster
registersCluster
(
Cluster
cluster
);
int
clearCluster
();
}
dlink-admin/src/main/java/com/dlink/service/impl/ClusterServiceImpl.java
View file @
476f31f6
...
...
@@ -83,6 +83,11 @@ public class ClusterServiceImpl extends SuperServiceImpl<ClusterMapper, Cluster>
return
baseMapper
.
listSessionEnable
();
}
@Override
public
List
<
Cluster
>
listAutoEnable
()
{
return
list
(
new
QueryWrapper
<
Cluster
>().
eq
(
"enabled"
,
1
).
eq
(
"auto_registers"
,
1
));
}
@Override
public
Cluster
registersCluster
(
Cluster
cluster
)
{
checkHealth
(
cluster
);
...
...
@@ -90,15 +95,29 @@ public class ClusterServiceImpl extends SuperServiceImpl<ClusterMapper, Cluster>
return
cluster
;
}
private
void
checkHealth
(
Cluster
cluster
){
@Override
public
int
clearCluster
()
{
List
<
Cluster
>
clusters
=
listAutoEnable
();
int
count
=
0
;
for
(
Cluster
item
:
clusters
){
if
((!
checkHealth
(
item
))&&
removeById
(
item
)){
count
++;
}
}
return
count
;
}
private
boolean
checkHealth
(
Cluster
cluster
){
FlinkClusterInfo
info
=
checkHeartBeat
(
cluster
.
getHosts
(),
cluster
.
getJobManagerHost
());
if
(!
info
.
isEffective
()){
cluster
.
setJobManagerHost
(
""
);
cluster
.
setStatus
(
0
);
return
false
;
}
else
{
cluster
.
setJobManagerHost
(
info
.
getJobManagerAddress
());
cluster
.
setStatus
(
1
);
cluster
.
setVersion
(
info
.
getVersion
());
return
true
;
}
}
}
dlink-client/dlink-client-1.11/dependency-reduced-pom.xml
deleted
100644 → 0
View file @
45fedaef
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
>
<parent>
<artifactId>
dlink-client
</artifactId>
<groupId>
com.dlink
</groupId>
<version>
0.4.0-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
dlink-client-1.11
</artifactId>
<build>
<plugins>
<plugin>
<artifactId>
maven-compiler-plugin
</artifactId>
<version>
3.8.0
</version>
<configuration>
<source>
1.8
</source>
<target>
1.8
</target>
</configuration>
</plugin>
<plugin>
<artifactId>
maven-assembly-plugin
</artifactId>
<configuration>
<descriptorRefs>
<descriptorRef>
jar-with-dependencies
</descriptorRef>
</descriptorRefs>
</configuration>
</plugin>
<plugin>
<artifactId>
maven-shade-plugin
</artifactId>
<version>
3.2.1
</version>
<executions>
<execution>
<phase>
package
</phase>
<goals>
<goal>
shade
</goal>
</goals>
<configuration>
<transformers>
<transformer>
<resource>
reference.conf
</resource>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
<configuration>
<filters>
<filter>
<artifact>
*:*
</artifact>
<excludes>
<exclude>
META-INF/*.SF
</exclude>
<exclude>
META-INF/*.DSA
</exclude>
<exclude>
META-INF/*.RSA
</exclude>
</excludes>
</filter>
</filters>
</configuration>
</plugin>
</plugins>
</build>
<properties>
<java.version>
1.8
</java.version>
<scala.binary.version>
2.11
</scala.binary.version>
<flink.version>
1.11.4
</flink.version>
<maven.compiler.source>
1.8
</maven.compiler.source>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<maven.compiler.target>
1.8
</maven.compiler.target>
<junit.version>
4.12
</junit.version>
</properties>
</project>
dlink-client/dlink-client-1.12/dependency-reduced-pom.xml
deleted
100644 → 0
View file @
45fedaef
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
>
<parent>
<artifactId>
dlink-client
</artifactId>
<groupId>
com.dlink
</groupId>
<version>
0.4.0-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
dlink-client-1.12
</artifactId>
<build>
<plugins>
<plugin>
<artifactId>
maven-compiler-plugin
</artifactId>
<version>
3.8.0
</version>
<configuration>
<source>
1.8
</source>
<target>
1.8
</target>
</configuration>
</plugin>
<plugin>
<artifactId>
maven-assembly-plugin
</artifactId>
<configuration>
<descriptorRefs>
<descriptorRef>
jar-with-dependencies
</descriptorRef>
</descriptorRefs>
</configuration>
</plugin>
<plugin>
<artifactId>
maven-shade-plugin
</artifactId>
<version>
3.2.1
</version>
<executions>
<execution>
<phase>
package
</phase>
<goals>
<goal>
shade
</goal>
</goals>
<configuration>
<transformers>
<transformer>
<resource>
reference.conf
</resource>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
<configuration>
<filters>
<filter>
<artifact>
*:*
</artifact>
<excludes>
<exclude>
META-INF/*.SF
</exclude>
<exclude>
META-INF/*.DSA
</exclude>
<exclude>
META-INF/*.RSA
</exclude>
</excludes>
</filter>
</filters>
</configuration>
</plugin>
</plugins>
</build>
<properties>
<java.version>
1.8
</java.version>
<scala.binary.version>
2.11
</scala.binary.version>
<flink.version>
1.12.5
</flink.version>
<maven.compiler.source>
1.8
</maven.compiler.source>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<maven.compiler.target>
1.8
</maven.compiler.target>
<junit.version>
4.12
</junit.version>
</properties>
</project>
dlink-client/dlink-client-1.13/dependency-reduced-pom.xml
deleted
100644 → 0
View file @
45fedaef
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
>
<parent>
<artifactId>
dlink-client
</artifactId>
<groupId>
com.dlink
</groupId>
<version>
0.4.0-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
dlink-client-1.13
</artifactId>
<build>
<plugins>
<plugin>
<artifactId>
maven-compiler-plugin
</artifactId>
<version>
3.8.0
</version>
<configuration>
<source>
1.8
</source>
<target>
1.8
</target>
</configuration>
</plugin>
<plugin>
<artifactId>
maven-assembly-plugin
</artifactId>
<configuration>
<descriptorRefs>
<descriptorRef>
jar-with-dependencies
</descriptorRef>
</descriptorRefs>
</configuration>
</plugin>
<plugin>
<artifactId>
maven-shade-plugin
</artifactId>
<version>
3.2.1
</version>
<executions>
<execution>
<phase>
package
</phase>
<goals>
<goal>
shade
</goal>
</goals>
<configuration>
<transformers>
<transformer>
<resource>
reference.conf
</resource>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
<configuration>
<filters>
<filter>
<artifact>
*:*
</artifact>
<excludes>
<exclude>
META-INF/*.SF
</exclude>
<exclude>
META-INF/*.DSA
</exclude>
<exclude>
META-INF/*.RSA
</exclude>
</excludes>
</filter>
</filters>
</configuration>
</plugin>
</plugins>
</build>
<properties>
<java.version>
1.8
</java.version>
<scala.binary.version>
2.11
</scala.binary.version>
<flink.version>
1.13.3
</flink.version>
<maven.compiler.source>
1.8
</maven.compiler.source>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<maven.compiler.target>
1.8
</maven.compiler.target>
<junit.version>
4.12
</junit.version>
</properties>
</project>
dlink-client/dlink-client-1.14/dependency-reduced-pom.xml
deleted
100644 → 0
View file @
45fedaef
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
>
<parent>
<artifactId>
dlink-client
</artifactId>
<groupId>
com.dlink
</groupId>
<version>
0.4.0-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
dlink-client-1.14
</artifactId>
<build>
<plugins>
<plugin>
<artifactId>
maven-compiler-plugin
</artifactId>
<version>
3.8.0
</version>
<configuration>
<source>
1.8
</source>
<target>
1.8
</target>
</configuration>
</plugin>
<plugin>
<artifactId>
maven-assembly-plugin
</artifactId>
<configuration>
<descriptorRefs>
<descriptorRef>
jar-with-dependencies
</descriptorRef>
</descriptorRefs>
</configuration>
</plugin>
<plugin>
<artifactId>
maven-shade-plugin
</artifactId>
<version>
3.2.1
</version>
<executions>
<execution>
<phase>
package
</phase>
<goals>
<goal>
shade
</goal>
</goals>
<configuration>
<transformers>
<transformer>
<resource>
reference.conf
</resource>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
<configuration>
<filters>
<filter>
<artifact>
*:*
</artifact>
<excludes>
<exclude>
META-INF/*.SF
</exclude>
<exclude>
META-INF/*.DSA
</exclude>
<exclude>
META-INF/*.RSA
</exclude>
</excludes>
</filter>
</filters>
</configuration>
</plugin>
</plugins>
</build>
<properties>
<java.version>
1.8
</java.version>
<scala.binary.version>
2.11
</scala.binary.version>
<flink.version>
1.14.0
</flink.version>
<maven.compiler.source>
1.8
</maven.compiler.source>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<maven.compiler.target>
1.8
</maven.compiler.target>
<junit.version>
4.12
</junit.version>
</properties>
</project>
dlink-web/src/pages/Cluster/index.tsx
View file @
476f31f6
import
{
DownOutlined
,
HeartOutlined
,
PlusOutlined
,
UserOutlined
}
from
'@ant-design/icons'
;
import
{
DownOutlined
,
HeartOutlined
,
PlusOutlined
,
UserOutlined
,
ClearOutlined
}
from
'@ant-design/icons'
;
import
{
Button
,
message
,
Input
,
Drawer
,
Modal
}
from
'antd'
;
import
React
,
{
useState
,
useRef
}
from
'react'
;
import
{
PageContainer
,
FooterToolbar
}
from
'@ant-design/pro-layout'
;
...
...
@@ -15,7 +15,7 @@ import Dropdown from "antd/es/dropdown/dropdown";
import
Menu
from
"antd/es/menu"
;
import
{
handleAddOrUpdate
,
handleOption
,
handleRemove
,
queryData
,
updateEnabled
updateEnabled
,
getData
}
from
"@/components/Common/crud"
;
import
{
showCluster
,
showSessionCluster
}
from
"@/components/Studio/StudioEvent/DDL"
;
...
...
@@ -54,6 +54,21 @@ const ClusterTableList: React.FC<{}> = (props: any) => {
actionRef
.
current
?.
reloadAndRest
?.();
};
const
clearCluster
=
async
()
=>
{
Modal
.
confirm
({
title
:
'回收集群'
,
content
:
'确定回收所有自动创建且过期的集群吗?'
,
okText
:
'确认'
,
cancelText
:
'取消'
,
onOk
:
async
()
=>
{
const
{
datas
}
=
await
getData
(
url
+
'/clear'
,
'回收集群'
,
null
);
message
.
success
(
`成功回收
${
datas
}
个集群`
);
actionRef
.
current
?.
reloadAndRest
?.();
}
});
};
const
MoreBtn
:
React
.
FC
<
{
item
:
ClusterTableListItem
;
}
>
=
({
item
})
=>
(
...
...
@@ -306,6 +321,9 @@ const ClusterTableList: React.FC<{}> = (props: any) => {
<
Button
type=
"primary"
onClick=
{
()
=>
checkHeartBeats
()
}
>
<
HeartOutlined
/>
心跳
</
Button
>,
<
Button
type=
"primary"
onClick=
{
()
=>
clearCluster
()
}
>
<
ClearOutlined
/>
回收
</
Button
>,
]
}
request=
{
(
params
,
sorter
,
filter
)
=>
queryData
(
url
,
{...
params
,
sorter
,
filter
})
}
columns=
{
columns
}
...
...
dlink-web/src/pages/Welcome.tsx
View file @
476f31f6
...
...
@@ -429,6 +429,9 @@ export default (): React.ReactNode => {
<
li
>
<
Link
>
新增作业配置的其他配置低优先级加载实现
</
Link
>
</
li
>
<
li
>
<
Link
>
新增一键回收过期集群
</
Link
>
</
li
>
</
ul
>
</
Paragraph
>
</
Timeline
.
Item
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment