Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dinky
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
wangpeng
dinky
Commits
c861202b
Unverified
Commit
c861202b
authored
Dec 26, 2023
by
Zzm0809
Committed by
GitHub
Dec 26, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix push ds locations bug (#2807)
* fix-push-ds-locations-bug * Spotless Apply --------- Co-authored-by:
Zzm0809
<
Zzm0809@users.noreply.github.com
>
parent
ccfc44ec
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
38 additions
and
41 deletions
+38
-41
SchedulerServiceImpl.java
...ain/java/org/dinky/service/impl/SchedulerServiceImpl.java
+17
-28
ProcessClient.java
...c/main/java/org/dinky/scheduler/client/ProcessClient.java
+2
-1
DagNodeLocation.java
.../main/java/org/dinky/scheduler/model/DagNodeLocation.java
+6
-0
ProcessDefinition.java
...ain/java/org/dinky/scheduler/model/ProcessDefinition.java
+1
-2
DagPlanNode.tsx
...b/src/components/Flink/FlinkDag/component/DagPlanNode.tsx
+7
-6
constants.ts
...gCenter/AlertRule/AlertRuleList/RuleEditForm/constants.ts
+2
-2
function.tsx
...gCenter/AlertRule/AlertRuleList/RuleEditForm/function.tsx
+3
-2
No files found.
dinky-admin/src/main/java/org/dinky/service/impl/SchedulerServiceImpl.java
View file @
c861202b
...
@@ -117,8 +117,8 @@ public class SchedulerServiceImpl implements SchedulerService {
...
@@ -117,8 +117,8 @@ public class SchedulerServiceImpl implements SchedulerService {
DagNodeLocation
dagNodeLocation
=
new
DagNodeLocation
();
DagNodeLocation
dagNodeLocation
=
new
DagNodeLocation
();
dagNodeLocation
.
setTaskCode
(
taskCode
);
dagNodeLocation
.
setTaskCode
(
taskCode
);
dagNodeLocation
.
setX
(
RandomUtil
.
randomLong
(
200
,
5
00
));
dagNodeLocation
.
setX
(
RandomUtil
.
randomLong
(
200
,
8
00
));
dagNodeLocation
.
setY
(
RandomUtil
.
randomLong
(
100
,
4
00
));
dagNodeLocation
.
setY
(
RandomUtil
.
randomLong
(
100
,
6
00
));
log
.
info
(
"DagNodeLocation Info: {}"
,
dagNodeLocation
);
log
.
info
(
"DagNodeLocation Info: {}"
,
dagNodeLocation
);
ProcessTaskRelation
processTaskRelation
=
ProcessTaskRelation
.
generateProcessTaskRelation
(
taskCode
);
ProcessTaskRelation
processTaskRelation
=
ProcessTaskRelation
.
generateProcessTaskRelation
(
taskCode
);
...
@@ -176,43 +176,32 @@ public class SchedulerServiceImpl implements SchedulerService {
...
@@ -176,43 +176,32 @@ public class SchedulerServiceImpl implements SchedulerService {
}
}
List
<
ProcessTaskRelation
>
processTaskRelationList
=
dagData
.
getProcessTaskRelationList
();
List
<
ProcessTaskRelation
>
processTaskRelationList
=
dagData
.
getProcessTaskRelationList
();
List
<
TaskDefinition
>
taskDefinitionList
=
dagData
.
getTaskDefinitionList
();
List
<
TaskDefinition
>
taskDefinitionList
=
dagData
.
getTaskDefinitionList
();
List
<
DagNodeLocation
>
locations
=
process
.
getLocations
(
);
List
<
DagNodeLocation
>
locations
=
JSONUtil
.
toList
(
process
.
getLocations
(),
DagNodeLocation
.
class
);
if
(
CollUtil
.
isNotEmpty
(
process
.
getLocations
()))
{
if
(
CollUtil
.
isNotEmpty
(
locations
))
{
boolean
matched
=
process
.
getLocations
().
stream
().
anyMatch
(
location
->
location
.
getTaskCode
()
==
taskCode
);
boolean
matched
=
locations
.
stream
().
anyMatch
(
location
->
location
.
getTaskCode
()
==
taskCode
);
// if not matched, add a new location
if
(!
matched
)
{
// 获取最大的 x y 坐标
// 获取最大的 x y 坐标
long
xMax
=
process
.
getLocations
().
stream
()
long
xMax
=
.
mapToLong
(
DagNodeLocation:
:
getX
)
locations
.
stream
().
mapToLong
(
DagNodeLocation:
:
getX
).
max
().
getAsLong
();
.
max
()
.
getAsLong
();
long
yMax
=
long
xMin
=
process
.
getLocations
().
stream
()
locations
.
stream
().
mapToLong
(
DagNodeLocation:
:
getY
).
max
().
getAsLong
();
.
mapToLong
(
DagNodeLocation:
:
getX
)
.
min
()
// if not matched, add a new location
.
getAsLong
();
if
(
matched
)
{
long
yMax
=
process
.
getLocations
().
stream
()
.
mapToLong
(
DagNodeLocation:
:
getY
)
.
max
()
.
getAsLong
();
long
yMin
=
process
.
getLocations
().
stream
()
.
mapToLong
(
DagNodeLocation:
:
getY
)
.
min
()
.
getAsLong
();
// 随机出一个 x y 坐标
// 随机出一个 x y 坐标
DagNodeLocation
dagNodeLocation
=
new
DagNodeLocation
();
DagNodeLocation
dagNodeLocation
=
new
DagNodeLocation
();
dagNodeLocation
.
setTaskCode
(
taskCode
);
dagNodeLocation
.
setTaskCode
(
taskCode
);
dagNodeLocation
.
setX
(
RandomUtil
.
randomLong
(
xMin
==
xMax
?
0
:
xMin
,
xMax
));
dagNodeLocation
.
setX
(
RandomUtil
.
randomLong
(
xMax
-
200
,
xMax
));
dagNodeLocation
.
setY
(
RandomUtil
.
randomLong
(
yMin
==
yMax
?
0
:
yMin
,
yMax
));
dagNodeLocation
.
setY
(
RandomUtil
.
randomLong
(
yMax
-
150
,
yMax
));
locations
=
process
.
getLocations
();
locations
.
add
(
dagNodeLocation
);
locations
.
add
(
dagNodeLocation
);
}
}
}
else
{
}
else
{
// 随机出一个 x y 坐标
// 随机出一个 x y 坐标
DagNodeLocation
dagNodeLocation
=
new
DagNodeLocation
();
DagNodeLocation
dagNodeLocation
=
new
DagNodeLocation
();
dagNodeLocation
.
setTaskCode
(
taskCode
);
dagNodeLocation
.
setTaskCode
(
taskCode
);
dagNodeLocation
.
setX
(
RandomUtil
.
randomLong
(
200
,
5
00
));
dagNodeLocation
.
setX
(
RandomUtil
.
randomLong
(
200
,
8
00
));
dagNodeLocation
.
setY
(
RandomUtil
.
randomLong
(
100
,
4
00
));
dagNodeLocation
.
setY
(
RandomUtil
.
randomLong
(
100
,
6
00
));
locations
.
add
(
dagNodeLocation
);
locations
.
add
(
dagNodeLocation
);
}
}
...
...
dinky-scheduler/src/main/java/org/dinky/scheduler/client/ProcessClient.java
View file @
c861202b
...
@@ -46,6 +46,7 @@ import cn.hutool.core.util.StrUtil;
...
@@ -46,6 +46,7 @@ import cn.hutool.core.util.StrUtil;
import
cn.hutool.http.HttpRequest
;
import
cn.hutool.http.HttpRequest
;
import
cn.hutool.http.HttpResponse
;
import
cn.hutool.http.HttpResponse
;
import
cn.hutool.json.JSONObject
;
import
cn.hutool.json.JSONObject
;
import
cn.hutool.json.JSONUtil
;
/**
/**
* 工作流定义
* 工作流定义
...
@@ -88,7 +89,7 @@ public class ProcessClient {
...
@@ -88,7 +89,7 @@ public class ProcessClient {
ProcessDefinition
processDefinition
=
MyJSONUtil
.
toBean
(
jsonObject
,
ProcessDefinition
.
class
);
ProcessDefinition
processDefinition
=
MyJSONUtil
.
toBean
(
jsonObject
,
ProcessDefinition
.
class
);
// The locations of processDefinition is json string
// The locations of processDefinition is json string
List
<
DagNodeLocation
>
locations
=
jsonObject
.
getBeanList
(
"locations"
,
DagNodeLocation
.
class
);
List
<
DagNodeLocation
>
locations
=
jsonObject
.
getBeanList
(
"locations"
,
DagNodeLocation
.
class
);
processDefinition
.
setLocations
(
locations
);
processDefinition
.
setLocations
(
JSONUtil
.
toJsonStr
(
locations
)
);
lists
.
add
(
processDefinition
);
lists
.
add
(
processDefinition
);
}
}
return
lists
;
return
lists
;
...
...
dinky-scheduler/src/main/java/org/dinky/scheduler/model/DagNodeLocation.java
View file @
c861202b
...
@@ -21,9 +21,15 @@ package org.dinky.scheduler.model;
...
@@ -21,9 +21,15 @@ package org.dinky.scheduler.model;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
com.fasterxml.jackson.annotation.JsonCreator
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
@Data
@Data
@AllArgsConstructor
(
onConstructor
=
@__
(
@JsonCreator
))
@NoArgsConstructor
public
class
DagNodeLocation
implements
Serializable
{
public
class
DagNodeLocation
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
5243356147439794746L
;
private
static
final
long
serialVersionUID
=
-
5243356147439794746L
;
...
...
dinky-scheduler/src/main/java/org/dinky/scheduler/model/ProcessDefinition.java
View file @
c861202b
...
@@ -23,7 +23,6 @@ import org.dinky.scheduler.enums.Flag;
...
@@ -23,7 +23,6 @@ import org.dinky.scheduler.enums.Flag;
import
org.dinky.scheduler.enums.ProcessExecutionTypeEnum
;
import
org.dinky.scheduler.enums.ProcessExecutionTypeEnum
;
import
org.dinky.scheduler.enums.ReleaseState
;
import
org.dinky.scheduler.enums.ReleaseState
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -88,7 +87,7 @@ public class ProcessDefinition {
...
@@ -88,7 +87,7 @@ public class ProcessDefinition {
private
String
projectName
;
private
String
projectName
;
@ApiModelProperty
(
value
=
"位置"
)
@ApiModelProperty
(
value
=
"位置"
)
private
List
<
DagNodeLocation
>
locations
=
new
ArrayList
<>()
;
private
String
locations
;
@ApiModelProperty
(
value
=
"计划发布状态 online/offline"
)
@ApiModelProperty
(
value
=
"计划发布状态 online/offline"
)
private
ReleaseState
scheduleReleaseState
;
private
ReleaseState
scheduleReleaseState
;
...
...
dinky-web/src/components/Flink/FlinkDag/component/DagPlanNode.tsx
View file @
c861202b
...
@@ -17,17 +17,17 @@
...
@@ -17,17 +17,17 @@
*
*
*/
*/
import
{
Card
,
Typography
}
from
'antd'
;
import
{
Card
,
Typography
}
from
'antd'
;
const
{
Text
,
Paragraph
}
=
Typography
;
const
{
Text
,
Paragraph
}
=
Typography
;
const
DagPlanNode
=
(
props
:
any
)
=>
{
const
DagPlanNode
=
(
props
:
any
)
=>
{
const
{
node
}
=
props
;
const
{
node
}
=
props
;
const
data
:
any
=
node
?.
getData
();
const
data
:
any
=
node
?.
getData
();
return
(
return
(
<
Card
<
Card
style=
{
{
width
:
270
,
padding
:
0
,
margin
:
0
,
height
:
140
}
}
style=
{
{
width
:
270
,
padding
:
0
,
margin
:
0
,
height
:
140
}
}
bordered=
{
false
}
bordered=
{
false
}
size=
{
'small'
}
size=
{
'small'
}
type=
{
'inner'
}
type=
{
'inner'
}
...
@@ -37,9 +37,10 @@ const DagPlanNode = (props: any) => {
...
@@ -37,9 +37,10 @@ const DagPlanNode = (props: any) => {
>
>
<
Paragraph
<
Paragraph
ellipsis=
{
{
ellipsis=
{
{
tooltip
:
{
title
:
data
.
description
,
zIndex
:
2000
},
tooltip
:
{
title
:
data
.
description
,
zIndex
:
2000
},
rows
:
3
rows
:
3
}
}
>
}
}
>
<
blockquote
>
<
blockquote
>
<
Text
>
{
data
.
description
}
</
Text
>
<
Text
>
{
data
.
description
}
</
Text
>
</
blockquote
>
</
blockquote
>
...
...
dinky-web/src/pages/SettingCenter/AlertRule/AlertRuleList/RuleEditForm/constants.ts
View file @
c861202b
...
@@ -58,7 +58,7 @@ export const BOOLEAN_VALUE_ENUM: DefaultOptionType[] = [
...
@@ -58,7 +58,7 @@ export const BOOLEAN_VALUE_ENUM: DefaultOptionType[] = [
export
const
AlertRules
:
any
=
{
export
const
AlertRules
:
any
=
{
jobName
:
{
jobName
:
{
label
:
l
(
'sys.alert.rule.label.taskId'
),
label
:
l
(
'sys.alert.rule.label.taskId'
),
valueType
:
OperatorType
.
NUMBER_VALUE
,
valueType
:
OperatorType
.
NUMBER_VALUE
},
},
duration
:
{
duration
:
{
label
:
l
(
'sys.alert.rule.label.duration'
),
label
:
l
(
'sys.alert.rule.label.duration'
),
...
@@ -81,7 +81,7 @@ export const AlertRules: any = {
...
@@ -81,7 +81,7 @@ export const AlertRules: any = {
},
},
checkpointCostTime
:
{
checkpointCostTime
:
{
label
:
l
(
'sys.alert.rule.label.checkpointTime'
),
label
:
l
(
'sys.alert.rule.label.checkpointTime'
),
valueType
:
OperatorType
.
NUMBER_VALUE
,
valueType
:
OperatorType
.
NUMBER_VALUE
},
},
isCheckpointFailed
:
{
isCheckpointFailed
:
{
label
:
l
(
'sys.alert.rule.label.checkpointFailed'
),
label
:
l
(
'sys.alert.rule.label.checkpointFailed'
),
...
...
dinky-web/src/pages/SettingCenter/AlertRule/AlertRuleList/RuleEditForm/function.tsx
View file @
c861202b
...
@@ -66,13 +66,14 @@ export const buildValueItem = (key: string, isSystem: boolean) => {
...
@@ -66,13 +66,14 @@ export const buildValueItem = (key: string, isSystem: boolean) => {
/>
/>
);
);
case
OperatorType
.
STR_VALUE
:
case
OperatorType
.
STR_VALUE
:
return
<
ProFormText
width=
{
'sm'
}
disabled=
{
isSystem
}
name=
{
'ruleValue'
}
placeholder=
{
plh
}
/>;
return
(
<
ProFormText
width=
{
'sm'
}
disabled=
{
isSystem
}
name=
{
'ruleValue'
}
placeholder=
{
plh
}
/>
);
case
OperatorType
.
OPTIONS_SEL
:
case
OperatorType
.
OPTIONS_SEL
:
return
(
return
(
<
ProFormSelect
<
ProFormSelect
width=
{
'sm'
}
width=
{
'sm'
}
disabled=
{
isSystem
}
disabled=
{
isSystem
}
width=
{
'sm'
}
name=
'ruleValue'
name=
'ruleValue'
mode=
{
'single'
}
mode=
{
'single'
}
placeholder=
{
plh
}
placeholder=
{
plh
}
...
...
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