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
67d9e72b
Commit
67d9e72b
authored
Mar 06, 2022
by
wenmo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
重新上线
parent
24edc060
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
59 additions
and
3 deletions
+59
-3
TaskServiceImpl.java
...src/main/java/com/dlink/service/impl/TaskServiceImpl.java
+1
-1
dubbo-demo-consumer.xml
...nt-base/src/main/resources/spring/dubbo-demo-consumer.xml
+32
-0
DDL.ts
dlink-web/src/components/Studio/StudioEvent/DDL.ts
+4
-0
index.tsx
dlink-web/src/pages/DevOps/JobInfo/index.tsx
+22
-2
No files found.
dlink-admin/src/main/java/com/dlink/service/impl/TaskServiceImpl.java
View file @
67d9e72b
...
...
@@ -101,7 +101,7 @@ public class TaskServiceImpl extends SuperServiceImpl<TaskMapper, Task> implemen
public
JobResult
restartByTaskId
(
Integer
id
)
{
Task
task
=
this
.
getTaskInfoById
(
id
);
Asserts
.
checkNull
(
task
,
Tips
.
TASK_NOT_EXIST
);
if
(
Asserts
.
isNotNull
(
task
.
getJobInstanceId
())
||
task
.
getJobInstanceId
()!=
0
){
if
(
Asserts
.
isNotNull
(
task
.
getJobInstanceId
())
&&
task
.
getJobInstanceId
()!=
0
){
savepointTask
(
task
,
SavePointType
.
CANCEL
.
getValue
());
}
if
(
Dialect
.
isSql
(
task
.
getDialect
()))
{
...
...
dlink-client/dlink-client-base/src/main/resources/spring/dubbo-demo-consumer.xml
0 → 100644
View file @
67d9e72b
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You 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.
-->
<beans
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xmlns:dubbo=
"http://dubbo.apache.org/schema/dubbo"
xmlns=
"http://www.springframework.org/schema/beans"
xmlns:context=
"http://www.springframework.org/schema/context"
xsi:schemaLocation=
"http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://dubbo.apache.org/schema/dubbo http://dubbo.apache.org/schema/dubbo/dubbo.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd"
>
<context:property-placeholder/>
<dubbo:application
name=
"demo-consumer"
/>
<dubbo:registry
address=
"zookeeper://${zookeeper.address:127.0.0.1}:2181"
/>
<!-- <dubbo:reference id="demoService" check="true" interface="com.dlink.service.DemoService" version="1.0.0"/>-->
</beans>
dlink-web/src/components/Studio/StudioEvent/DDL.ts
View file @
67d9e72b
...
...
@@ -196,6 +196,10 @@ export function showFlinkJobs(clusterId:number) {
export
function
cancelJob
(
clusterId
:
number
,
jobId
:
string
)
{
return
getData
(
'api/studio/cancel'
,{
clusterId
:
clusterId
,
jobId
:
jobId
});
}
/*--- 重启 Flink Jobs ---*/
export
function
restartJob
(
id
:
number
)
{
return
getData
(
'api/task/restartTask'
,{
id
});
}
/*--- 停止 SavePoint Jobs ---*/
export
function
savepointJob
(
clusterId
:
number
,
jobId
:
string
,
savePointType
:
string
,
name
:
string
,
taskId
:
number
)
{
return
getData
(
'api/studio/savepoint'
,{
clusterId
,
jobId
,
savePointType
,
name
,
taskId
});
...
...
dlink-web/src/pages/DevOps/JobInfo/index.tsx
View file @
67d9e72b
...
...
@@ -13,7 +13,7 @@ import moment from "moment";
import
BaseInfo
from
"@/pages/DevOps/JobInfo/BaseInfo"
;
import
Config
from
"@/pages/DevOps/JobInfo/Config"
;
import
JobStatus
,
{
isStatusDone
}
from
"@/components/Common/JobStatus"
;
import
{
cancelJob
,
savepointJob
}
from
"@/components/Studio/StudioEvent/DDL"
;
import
{
cancelJob
,
restartJob
,
savepointJob
}
from
"@/components/Studio/StudioEvent/DDL"
;
const
{
Link
}
=
Typography
;
...
...
@@ -96,6 +96,26 @@ const JobInfo = (props: any) => {
});
};
const
handleRestart
=
()
=>
{
Modal
.
confirm
({
title
:
'重新上线任务'
,
content
:
`确定重新上线该作业吗?`
,
okText
:
'确认'
,
cancelText
:
'取消'
,
onOk
:
async
()
=>
{
if
(
!
job
?.
cluster
?.
id
)
return
;
const
res
=
restartJob
(
job
?.
instance
?.
taskId
);
res
.
then
((
result
)
=>
{
if
(
result
.
datas
.
success
==
true
)
{
message
.
success
(
"重新上线成功"
);
}
else
{
message
.
error
(
"重新上线失败"
);
}
});
}
});
};
const
getButtons
=
()
=>
{
let
buttons
=
[
<
Button
key=
"back"
type=
"dashed"
onClick=
{
handleBack
}
>
返回
</
Button
>,
...
...
@@ -107,7 +127,7 @@ const JobInfo = (props: any) => {
FlinkWebUI
</
Link
></
Button
>);
}
buttons
.
push
(<
Button
key=
"autorestart"
type=
"primary"
>
重新上线
</
Button
>);
buttons
.
push
(<
Button
key=
"autorestart"
type=
"primary"
onClick=
{
handleRestart
}
>
重新上线
</
Button
>);
if
(
!
isStatusDone
(
job
?.
instance
?.
status
as
string
)){
buttons
.
push
(<
Button
key=
"autostop"
type=
"primary"
danger
onClick=
{
()
=>
{
handleSavepoint
(
'cancel'
)}
}
>
下线
</
Button
>);
buttons
.
push
(<
Dropdown
...
...
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