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
c61d1a6e
Commit
c61d1a6e
authored
Jun 30, 2021
by
wenmo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
执行持久化联调
parent
0ece94bc
Changes
14
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
61 additions
and
61 deletions
+61
-61
StudioDDLDTO.java
dlink-admin/src/main/java/com/dlink/dto/StudioDDLDTO.java
+5
-5
StudioExecuteDTO.java
...k-admin/src/main/java/com/dlink/dto/StudioExecuteDTO.java
+5
-5
History.java
dlink-admin/src/main/java/com/dlink/model/History.java
+3
-3
StudioServiceImpl.java
...c/main/java/com/dlink/service/impl/StudioServiceImpl.java
+2
-2
Job.java
dlink-core/src/main/java/com/dlink/job/Job.java
+1
-1
JobConfig.java
dlink-core/src/main/java/com/dlink/job/JobConfig.java
+12
-12
JobManager.java
dlink-core/src/main/java/com/dlink/job/JobManager.java
+4
-4
JobResult.java
dlink-core/src/main/java/com/dlink/job/JobResult.java
+3
-3
index.tsx
dlink-web/src/components/Studio/StudioConfig/index.tsx
+3
-3
index.tsx
...b/src/components/Studio/StudioConsole/StudioMsg/index.tsx
+7
-7
index.tsx
...src/components/Studio/StudioConsole/StudioTable/index.tsx
+1
-1
index.tsx
dlink-web/src/components/Studio/StudioMenu/index.tsx
+3
-3
index.tsx
dlink-web/src/components/Studio/StudioTree/index.tsx
+3
-3
model.ts
dlink-web/src/pages/FlinkSqlStudio/model.ts
+9
-9
No files found.
dlink-admin/src/main/java/com/dlink/dto/StudioDDLDTO.java
View file @
c61d1a6e
...
...
@@ -13,19 +13,19 @@ import lombok.Setter;
@Getter
@Setter
public
class
StudioDDLDTO
{
private
boolean
is
Result
;
private
boolean
is
Session
;
private
boolean
use
Result
;
private
boolean
use
Session
;
private
String
session
;
private
boolean
is
Remote
;
private
boolean
use
Remote
;
private
Integer
clusterId
;
private
String
statement
;
public
JobConfig
getJobConfig
()
{
return
new
JobConfig
(
isResult
,
isSession
,
getSession
(),
is
Remote
,
clusterId
);
return
new
JobConfig
(
useResult
,
useSession
,
getSession
(),
use
Remote
,
clusterId
);
}
public
String
getSession
()
{
if
(
is
Remote
)
{
if
(
use
Remote
)
{
return
clusterId
+
"_"
+
session
;
}
else
{
return
"0_"
+
session
;
...
...
dlink-admin/src/main/java/com/dlink/dto/StudioExecuteDTO.java
View file @
c61d1a6e
...
...
@@ -13,10 +13,10 @@ import lombok.Setter;
@Getter
@Setter
public
class
StudioExecuteDTO
{
private
boolean
is
Result
;
private
boolean
is
Session
;
private
boolean
use
Result
;
private
boolean
use
Session
;
private
String
session
;
private
boolean
is
Remote
;
private
boolean
use
Remote
;
private
Integer
clusterId
;
private
boolean
fragment
;
private
String
statement
;
...
...
@@ -28,11 +28,11 @@ public class StudioExecuteDTO {
private
String
savePointPath
;
public
JobConfig
getJobConfig
()
{
return
new
JobConfig
(
isResult
,
isSession
,
getSession
(),
is
Remote
,
clusterId
,
taskId
,
jobName
,
fragment
,
maxRowNum
,
checkPoint
,
parallelism
,
savePointPath
);
return
new
JobConfig
(
useResult
,
useSession
,
getSession
(),
use
Remote
,
clusterId
,
taskId
,
jobName
,
fragment
,
maxRowNum
,
checkPoint
,
parallelism
,
savePointPath
);
}
public
String
getSession
()
{
if
(
is
Remote
)
{
if
(
use
Remote
)
{
return
clusterId
+
"_"
+
session
;
}
else
{
return
"0_"
+
session
;
...
...
dlink-admin/src/main/java/com/dlink/model/History.java
View file @
c61d1a6e
...
...
@@ -6,7 +6,7 @@ import lombok.Data;
import
lombok.EqualsAndHashCode
;
import
java.io.Serializable
;
import
java.time.LocalDate
;
import
java.time.LocalDate
Time
;
/**
* History
...
...
@@ -32,8 +32,8 @@ public class History implements Serializable {
private
String
error
;
private
String
result
;
private
String
config
;
private
LocalDate
startTime
;
private
LocalDate
endTime
;
private
LocalDate
Time
startTime
;
private
LocalDate
Time
endTime
;
private
Integer
taskId
;
@TableField
(
exist
=
false
)
...
...
dlink-admin/src/main/java/com/dlink/service/impl/StudioServiceImpl.java
View file @
c61d1a6e
...
...
@@ -72,7 +72,7 @@ public class StudioServiceImpl implements StudioService {
@Override
public
JobResult
executeSql
(
StudioExecuteDTO
studioExecuteDTO
)
{
JobConfig
config
=
studioExecuteDTO
.
getJobConfig
();
if
(
config
.
isRemote
())
{
if
(
config
.
is
Use
Remote
())
{
config
.
setHost
(
clusterService
.
getJobManagerAddress
(
clusterService
.
getById
(
studioExecuteDTO
.
getClusterId
())
));
...
...
@@ -84,7 +84,7 @@ public class StudioServiceImpl implements StudioService {
@Override
public
IResult
executeDDL
(
StudioDDLDTO
studioDDLDTO
)
{
JobConfig
config
=
studioDDLDTO
.
getJobConfig
();
if
(
config
.
isRemote
())
{
if
(
config
.
is
Use
Remote
())
{
config
.
setHost
(
clusterService
.
getJobManagerAddress
(
clusterService
.
getById
(
studioDDLDTO
.
getClusterId
())
));
...
...
dlink-core/src/main/java/com/dlink/job/Job.java
View file @
c61d1a6e
...
...
@@ -49,6 +49,6 @@ public class Job {
}
public
JobResult
getJobResult
(){
return
new
JobResult
(
id
,
jobConfig
,
jobManagerAddress
,
status
,
statement
,
jobId
,
error
,
result
,
executorSetting
,
startTime
,
endTime
);
return
new
JobResult
(
id
,
jobConfig
,
jobManagerAddress
,
status
,
statement
,
jobId
,
error
,
result
,
startTime
,
endTime
);
}
}
dlink-core/src/main/java/com/dlink/job/JobConfig.java
View file @
c61d1a6e
...
...
@@ -15,10 +15,10 @@ import lombok.Setter;
@Setter
public
class
JobConfig
{
private
boolean
is
Result
;
private
boolean
is
Session
;
private
boolean
use
Result
;
private
boolean
use
Session
;
private
String
sessionKey
;
private
boolean
is
Remote
;
private
boolean
use
Remote
;
private
Integer
clusterId
;
private
String
host
;
private
Integer
taskId
;
...
...
@@ -29,13 +29,13 @@ public class JobConfig {
private
Integer
parallelism
;
private
String
savePointPath
;
public
JobConfig
(
boolean
isResult
,
boolean
isSession
,
String
sessionKey
,
boolean
is
Remote
,
Integer
clusterId
,
public
JobConfig
(
boolean
useResult
,
boolean
useSession
,
String
sessionKey
,
boolean
use
Remote
,
Integer
clusterId
,
Integer
taskId
,
String
jobName
,
boolean
useSqlFragment
,
Integer
maxRowNum
,
Integer
checkpoint
,
Integer
parallelism
,
String
savePointPath
)
{
this
.
isResult
=
is
Result
;
this
.
isSession
=
is
Session
;
this
.
useResult
=
use
Result
;
this
.
useSession
=
use
Session
;
this
.
sessionKey
=
sessionKey
;
this
.
isRemote
=
is
Remote
;
this
.
useRemote
=
use
Remote
;
this
.
clusterId
=
clusterId
;
this
.
taskId
=
taskId
;
this
.
jobName
=
jobName
;
...
...
@@ -46,17 +46,17 @@ public class JobConfig {
this
.
savePointPath
=
savePointPath
;
}
public
JobConfig
(
boolean
isResult
,
boolean
isSession
,
String
sessionKey
,
boolean
is
Remote
,
Integer
clusterId
)
{
this
.
isResult
=
is
Result
;
this
.
isSession
=
is
Session
;
public
JobConfig
(
boolean
useResult
,
boolean
useSession
,
String
sessionKey
,
boolean
use
Remote
,
Integer
clusterId
)
{
this
.
useResult
=
use
Result
;
this
.
useSession
=
use
Session
;
this
.
sessionKey
=
sessionKey
;
this
.
isRemote
=
is
Remote
;
this
.
useRemote
=
use
Remote
;
this
.
clusterId
=
clusterId
;
}
public
ExecutorSetting
getExecutorSetting
(){
String
type
=
Executor
.
LOCAL
;
if
(
is
Remote
){
if
(
use
Remote
){
type
=
Executor
.
REMOTE
;
}
return
new
ExecutorSetting
(
host
,
type
,
checkpoint
,
parallelism
,
useSqlFragment
,
savePointPath
,
jobName
);
...
...
dlink-core/src/main/java/com/dlink/job/JobManager.java
View file @
c61d1a6e
...
...
@@ -91,7 +91,7 @@ public class JobManager extends RunTime {
}
private
Executor
createExecutor
()
{
if
(
config
.
isRemote
())
{
if
(
config
.
is
Use
Remote
())
{
executor
=
Executor
.
build
(
new
EnvironmentSetting
(
jobManagerHost
,
jobManagerPort
),
config
.
getExecutorSetting
());
return
executor
;
}
else
{
...
...
@@ -116,7 +116,7 @@ public class JobManager extends RunTime {
}*/
private
Executor
createExecutorWithSession
()
{
if
(
config
.
isSession
())
{
if
(
config
.
is
Use
Session
())
{
ExecutorEntity
executorEntity
=
SessionPool
.
get
(
config
.
getSessionKey
());
if
(
executorEntity
!=
null
)
{
executor
=
executorEntity
.
getExecutor
();
...
...
@@ -134,7 +134,7 @@ public class JobManager extends RunTime {
public
boolean
init
()
{
handler
=
JobHandler
.
build
();
String
host
=
config
.
getHost
();
if
(
config
.
isRemote
()
&&
host
!=
null
&&
!(
""
).
equals
(
host
))
{
if
(
config
.
is
Use
Remote
()
&&
host
!=
null
&&
!(
""
).
equals
(
host
))
{
String
[]
strs
=
host
.
split
(
NetConstant
.
COLON
);
if
(
strs
.
length
>=
2
)
{
jobManagerHost
=
strs
[
0
];
...
...
@@ -295,7 +295,7 @@ public class JobManager extends RunTime {
if
(
tableResult
.
getJobClient
().
isPresent
())
{
job
.
setJobId
(
tableResult
.
getJobClient
().
get
().
getJobID
().
toHexString
());
}
if
(
config
.
isResult
())
{
if
(
config
.
is
Use
Result
())
{
IResult
result
=
ResultBuilder
.
build
(
operationType
,
maxRowNum
,
""
,
false
).
getResult
(
tableResult
);
job
.
setResult
(
result
);
}
...
...
dlink-core/src/main/java/com/dlink/job/JobResult.java
View file @
c61d1a6e
...
...
@@ -20,24 +20,24 @@ public class JobResult {
private
JobConfig
jobConfig
;
private
String
jobManagerAddress
;
private
Job
.
JobStatus
status
;
private
boolean
success
;
private
String
statement
;
private
String
jobId
;
private
String
error
;
private
IResult
result
;
private
ExecutorSetting
executorSetting
;
private
LocalDate
startTime
;
private
LocalDate
endTime
;
public
JobResult
(
Integer
id
,
JobConfig
jobConfig
,
String
jobManagerAddress
,
Job
.
JobStatus
status
,
String
statement
,
String
jobId
,
String
error
,
IResult
result
,
ExecutorSetting
executorSetting
,
LocalDate
startTime
,
LocalDate
endTime
)
{
public
JobResult
(
Integer
id
,
JobConfig
jobConfig
,
String
jobManagerAddress
,
Job
.
JobStatus
status
,
String
statement
,
String
jobId
,
String
error
,
IResult
result
,
LocalDate
startTime
,
LocalDate
endTime
)
{
this
.
id
=
id
;
this
.
jobConfig
=
jobConfig
;
this
.
jobManagerAddress
=
jobManagerAddress
;
this
.
status
=
status
;
this
.
success
=
(
status
==(
Job
.
JobStatus
.
SUCCESS
))?
true
:
false
;
this
.
statement
=
statement
;
this
.
jobId
=
jobId
;
this
.
error
=
error
;
this
.
result
=
result
;
this
.
executorSetting
=
executorSetting
;
this
.
startTime
=
startTime
;
this
.
endTime
=
endTime
;
}
...
...
dlink-web/src/components/Studio/StudioConfig/index.tsx
View file @
c61d1a6e
...
...
@@ -74,7 +74,7 @@ const StudioConfig = (props: any) => {
<
Row
>
<
Col
span=
{
12
}
>
<
Form
.
Item
label=
"预览结果"
className=
{
styles
.
form_item
}
name=
"
is
Result"
valuePropName=
"checked"
label=
"预览结果"
className=
{
styles
.
form_item
}
name=
"
use
Result"
valuePropName=
"checked"
tooltip=
{
{
title
:
'开启预览结果,将同步运行并返回数据结果'
,
icon
:
<
InfoCircleOutlined
/>
}
}
>
<
Switch
checkedChildren=
"启用"
unCheckedChildren=
"禁用"
...
...
@@ -91,7 +91,7 @@ const StudioConfig = (props: any) => {
</
Col
>
</
Row
>
<
Form
.
Item
label=
"远程执行"
className=
{
styles
.
form_item
}
name=
"
is
Remote"
valuePropName=
"checked"
label=
"远程执行"
className=
{
styles
.
form_item
}
name=
"
use
Remote"
valuePropName=
"checked"
tooltip=
{
{
title
:
'开启远程执行,将在远程集群进行任务执行'
,
icon
:
<
InfoCircleOutlined
/>
}
}
>
<
Switch
checkedChildren=
"启用"
unCheckedChildren=
"禁用"
...
...
@@ -100,7 +100,7 @@ const StudioConfig = (props: any) => {
<
Row
>
<
Col
span=
{
10
}
>
<
Form
.
Item
label=
"共享会话"
className=
{
styles
.
form_item
}
name=
"
is
Session"
valuePropName=
"checked"
label=
"共享会话"
className=
{
styles
.
form_item
}
name=
"
use
Session"
valuePropName=
"checked"
tooltip=
{
{
title
:
'开启共享会话,将进行 Flink Catalog 的共享'
,
icon
:
<
InfoCircleOutlined
/>
}
}
>
<
Switch
checkedChildren=
"启用"
unCheckedChildren=
"禁用"
...
...
dlink-web/src/components/Studio/StudioConsole/StudioMsg/index.tsx
View file @
c61d1a6e
...
...
@@ -13,18 +13,18 @@ const StudioMsg = (props:any) => {
{
current
.
console
.
result
.
map
((
item
,
index
)
=>
{
if
(
index
==
0
)
{
return
(<
Paragraph
>
<
blockquote
><
Link
href=
{
`http://${item.flinkHost}:${item.flinkPort}`
}
target=
"_blank"
>
[
{
item
.
sessionId
}
:
{
item
.
flinkHost
}
:
{
item
.
flinkPort
}
]
</
Link
>
<
Divider
type=
"vertical"
/>
{
item
.
finishDate
}
<
blockquote
><
Link
href=
{
`http://${item.jobConfig.host}`
}
target=
"_blank"
>
[
{
item
.
jobConfig
.
sessionKey
}
:
{
item
.
jobConfig
.
host
}
]
</
Link
>
<
Divider
type=
"vertical"
/>
{
item
.
startTime
}
<
Divider
type=
"vertical"
/>
{
item
.
endTime
}
<
Divider
type=
"vertical"
/>
{
!
item
.
success
?
<><
Badge
status=
"error"
/><
Text
type=
"danger"
>
Error
</
Text
></>
:
{
!
(
item
.
status
==
'SUCCESS'
)
?
<><
Badge
status=
"error"
/><
Text
type=
"danger"
>
Error
</
Text
></>
:
<><
Badge
status=
"success"
/><
Text
type=
"success"
>
Success
</
Text
></>
}
<
Divider
type=
"vertical"
/>
{
item
.
job
Name
&&
<
Text
code
>
{
item
.
jobName
}
</
Text
>
}
{
item
.
job
Config
.
jobName
&&
<
Text
code
>
{
item
.
jobConfig
.
jobName
}
</
Text
>
}
{
item
.
jobId
&&
<
Text
code
>
{
item
.
jobId
}
</
Text
>
}
<
Text
keyboard
>
{
item
.
time
}
ms
</
Text
><
/
blockquote
>
</
blockquote
>
{
item
.
statement
&&
(<
pre
style=
{
{
height
:
'100px'
}
}
>
{
item
.
statement
}
</
pre
>)
}
{
item
.
msg
?
item
.
msg
:
''
}
{
item
.
error
&&
(<
pre
style=
{
{
height
:
'100px'
}
}
>
{
item
.
error
}
</
pre
>)
}
</
Paragraph
>)
}
else
{
...
...
dlink-web/src/components/Studio/StudioConsole/StudioTable/index.tsx
View file @
c61d1a6e
...
...
@@ -109,7 +109,7 @@ const StudioTable = (props:any) => {
onChange=
{
onChange
}
>
{
current
.
console
.
result
.
map
((
item
,
index
)
=>
{
if
(
item
.
s
uccess
)
{
if
(
item
.
s
tatus
==
'SUCCESS'
)
{
let
tag
=
(<>
<
Tooltip
placement=
"topLeft"
title=
{
item
.
statement
}
><
Tag
color=
"processing"
>
{
item
.
finishDate
}
</
Tag
>
<
Text
underline
>
[
{
item
.
sessionId
}
:
{
item
.
flinkHost
}
:
{
item
.
flinkPort
}
]
</
Text
>
{
item
.
jobName
&&
<
Text
code
>
{
item
.
jobName
}
</
Text
>
}
...
...
dlink-web/src/components/Studio/StudioMenu/index.tsx
View file @
c61d1a6e
...
...
@@ -44,9 +44,9 @@ const StudioMenu = (props: any) => {
fragment
:
current
.
task
.
fragment
,
savePointPath
:
current
.
task
.
savePointPath
,
jobName
:
current
.
task
.
jobName
,
isResult
:
current
.
task
.
is
Result
,
isSession
:
current
.
task
.
is
Session
,
remote
:
current
.
task
.
is
Remote
,
useResult
:
current
.
task
.
use
Result
,
useSession
:
current
.
task
.
use
Session
,
useRemote
:
current
.
task
.
use
Remote
,
};
const
key
=
current
.
key
;
const
taskKey
=
(
Math
.
random
()
*
1000
)
+
''
;
...
...
dlink-web/src/components/Studio/StudioTree/index.tsx
View file @
c61d1a6e
...
...
@@ -139,9 +139,9 @@ const StudioTree: React.FC<StudioTreeProps> = (props) => {
session
:
''
,
maxRowNum
:
100
,
jobName
:
node
.
name
,
is
Result
:
false
,
is
Session
:
false
,
is
Remote
:
true
,
use
Result
:
false
,
use
Session
:
false
,
use
Remote
:
true
,
...
result
.
datas
},
console
:{
...
...
dlink-web/src/pages/FlinkSqlStudio/model.ts
View file @
c61d1a6e
...
...
@@ -41,9 +41,9 @@ export type TaskType = {
session
:
string
;
maxRowNum
:
number
;
jobName
:
string
;
is
Result
:
boolean
;
is
Session
:
boolean
;
is
Remote
:
boolean
;
use
Result
:
boolean
;
use
Session
:
boolean
;
use
Remote
:
boolean
;
};
export
type
ConsoleType
=
{
...
...
@@ -151,9 +151,9 @@ const Model: ModelType = {
maxRowNum
:
100
,
session
:
''
,
alias
:
'草稿'
,
is
Result
:
true
,
is
Session
:
false
,
is
Remote
:
false
,
use
Result
:
true
,
use
Session
:
false
,
use
Remote
:
false
,
},
console
:
{
result
:
[],
...
...
@@ -182,9 +182,9 @@ const Model: ModelType = {
session
:
''
,
maxRowNum
:
100
,
alias
:
'草稿'
,
is
Result
:
true
,
is
Session
:
false
,
is
Remote
:
false
,
use
Result
:
true
,
use
Session
:
false
,
use
Remote
:
false
,
},
console
:
{
result
:
[],
...
...
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