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
caaa087c
Commit
caaa087c
authored
Feb 03, 2022
by
wenmo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
去除 远程执行配置
parent
745cfd8e
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
32 additions
and
56 deletions
+32
-56
StudioExecuteDTO.java
...k-admin/src/main/java/com/dlink/dto/StudioExecuteDTO.java
+1
-3
StudioServiceImpl.java
...c/main/java/com/dlink/service/impl/StudioServiceImpl.java
+17
-30
TaskServiceImpl.java
...src/main/java/com/dlink/service/impl/TaskServiceImpl.java
+0
-3
JobConfig.java
dlink-core/src/main/java/com/dlink/job/JobConfig.java
+11
-2
JobManagerTest.java
dlink-core/src/test/java/com/dlink/core/JobManagerTest.java
+1
-1
index.tsx
.../components/Studio/StudioRightTool/StudioConfig/index.tsx
+2
-15
model.ts
dlink-web/src/pages/FlinkSqlStudio/model.ts
+0
-2
No files found.
dlink-admin/src/main/java/com/dlink/dto/StudioExecuteDTO.java
View file @
caaa087c
...
...
@@ -29,13 +29,11 @@ public class StudioExecuteDTO extends AbstractStatementDTO{
private
boolean
statementSet
;
private
boolean
useSession
;
private
String
session
;
private
boolean
useRemote
;
private
Integer
clusterId
;
private
Integer
clusterConfigurationId
;
private
Integer
databaseId
;
private
Integer
jarId
;
private
boolean
fragment
;
// private String statement;
private
String
jobName
;
private
Integer
taskId
;
private
Integer
maxRowNum
;
...
...
@@ -61,7 +59,7 @@ public class StudioExecuteDTO extends AbstractStatementDTO{
);
}
return
new
JobConfig
(
type
,
useResult
,
useChangeLog
,
useAutoCancel
,
useSession
,
session
,
useRemote
,
clusterId
,
type
,
useResult
,
useChangeLog
,
useAutoCancel
,
useSession
,
session
,
clusterId
,
clusterConfigurationId
,
jarId
,
taskId
,
jobName
,
fragment
,
statementSet
,
maxRowNum
,
checkPoint
,
parallelism
,
savePointStrategy
,
savePointPath
,
config
);
}
...
...
dlink-admin/src/main/java/com/dlink/service/impl/StudioServiceImpl.java
View file @
caaa087c
...
...
@@ -70,6 +70,13 @@ public class StudioServiceImpl implements StudioService {
}
}
private
void
buildSession
(
JobConfig
config
){
// If you are using a shared session, configure the current jobmanager address
if
(!
config
.
isUseSession
())
{
config
.
setAddress
(
clusterService
.
buildEnvironmentAddress
(
config
.
isUseRemote
(),
config
.
getClusterId
()));
}
}
@Override
public
JobResult
executeSql
(
StudioExecuteDTO
studioExecuteDTO
)
{
if
(
Dialect
.
isSql
(
studioExecuteDTO
.
getDialect
())){
...
...
@@ -83,13 +90,7 @@ public class StudioServiceImpl implements StudioService {
private
JobResult
executeFlinkSql
(
StudioExecuteDTO
studioExecuteDTO
)
{
addFlinkSQLEnv
(
studioExecuteDTO
);
JobConfig
config
=
studioExecuteDTO
.
getJobConfig
();
// If you are using a shared session, configure the current jobmanager address
if
(!
config
.
isUseSession
())
{
if
(
GatewayType
.
LOCAL
.
equalsValue
(
config
.
getType
())){
config
.
setUseRemote
(
false
);
}
config
.
setAddress
(
clusterService
.
buildEnvironmentAddress
(
config
.
isUseRemote
(),
studioExecuteDTO
.
getClusterId
()));
}
buildSession
(
config
);
// To initialize java udf, but it has a bug in the product environment now.
// initUDF(config,studioExecuteDTO.getStatement());
JobManager
jobManager
=
JobManager
.
build
(
config
);
...
...
@@ -134,9 +135,6 @@ public class StudioServiceImpl implements StudioService {
public
IResult
executeDDL
(
StudioDDLDTO
studioDDLDTO
)
{
JobConfig
config
=
studioDDLDTO
.
getJobConfig
();
if
(!
config
.
isUseSession
())
{
if
(
GatewayType
.
LOCAL
.
equalsValue
(
config
.
getType
())){
config
.
setUseRemote
(
false
);
}
config
.
setAddress
(
clusterService
.
buildEnvironmentAddress
(
config
.
isUseRemote
(),
studioDDLDTO
.
getClusterId
()));
}
JobManager
jobManager
=
JobManager
.
build
(
config
);
...
...
@@ -155,12 +153,9 @@ public class StudioServiceImpl implements StudioService {
private
List
<
SqlExplainResult
>
explainFlinkSql
(
StudioExecuteDTO
studioExecuteDTO
)
{
addFlinkSQLEnv
(
studioExecuteDTO
);
JobConfig
config
=
studioExecuteDTO
.
getJobConfig
();
if
(!
config
.
isUseSession
())
{
if
(
GatewayType
.
LOCAL
.
equalsValue
(
config
.
getType
())){
config
.
setUseRemote
(
false
);
}
config
.
setAddress
(
clusterService
.
buildEnvironmentAddress
(
config
.
isUseRemote
(),
studioExecuteDTO
.
getClusterId
()));
}
// If you are using explainSql | getStreamGraph | getJobPlan, make the dialect change to local.
config
.
buildLocal
();
buildSession
(
config
);
// To initialize java udf, but it has a bug in the product environment now.
// initUDF(config,studioExecuteDTO.getStatement());
JobManager
jobManager
=
JobManager
.
buildPlanMode
(
config
);
...
...
@@ -190,13 +185,9 @@ public class StudioServiceImpl implements StudioService {
public
ObjectNode
getStreamGraph
(
StudioExecuteDTO
studioExecuteDTO
)
{
addFlinkSQLEnv
(
studioExecuteDTO
);
JobConfig
config
=
studioExecuteDTO
.
getJobConfig
();
config
.
setType
(
GatewayType
.
LOCAL
.
getLongValue
());
if
(!
config
.
isUseSession
())
{
if
(
GatewayType
.
LOCAL
.
equalsValue
(
config
.
getType
())){
config
.
setUseRemote
(
false
);
}
config
.
setAddress
(
clusterService
.
buildEnvironmentAddress
(
config
.
isUseRemote
(),
studioExecuteDTO
.
getClusterId
()));
}
// If you are using explainSql | getStreamGraph | getJobPlan, make the dialect change to local.
config
.
buildLocal
();
buildSession
(
config
);
JobManager
jobManager
=
JobManager
.
buildPlanMode
(
config
);
return
jobManager
.
getStreamGraph
(
studioExecuteDTO
.
getStatement
());
}
...
...
@@ -205,13 +196,9 @@ public class StudioServiceImpl implements StudioService {
public
ObjectNode
getJobPlan
(
StudioExecuteDTO
studioExecuteDTO
)
{
addFlinkSQLEnv
(
studioExecuteDTO
);
JobConfig
config
=
studioExecuteDTO
.
getJobConfig
();
config
.
setType
(
GatewayType
.
LOCAL
.
getLongValue
());
if
(!
config
.
isUseSession
())
{
if
(
GatewayType
.
LOCAL
.
equalsValue
(
config
.
getType
())){
config
.
setUseRemote
(
false
);
}
config
.
setAddress
(
clusterService
.
buildEnvironmentAddress
(
config
.
isUseRemote
(),
studioExecuteDTO
.
getClusterId
()));
}
// If you are using explainSql | getStreamGraph | getJobPlan, make the dialect change to local.
config
.
buildLocal
();
buildSession
(
config
);
JobManager
jobManager
=
JobManager
.
buildPlanMode
(
config
);
String
planJson
=
jobManager
.
getJobPlanJson
(
studioExecuteDTO
.
getStatement
());
ObjectMapper
mapper
=
new
ObjectMapper
();
...
...
dlink-admin/src/main/java/com/dlink/service/impl/TaskServiceImpl.java
View file @
caaa087c
...
...
@@ -285,9 +285,6 @@ public class TaskServiceImpl extends SuperServiceImpl<TaskMapper, Task> implemen
JobConfig
config
=
task
.
buildSubmitConfig
();
config
.
setJarTask
(
isJarTask
);
if
(!
JobManager
.
useGateway
(
config
.
getType
()))
{
if
(
GatewayType
.
LOCAL
.
equalsValue
(
config
.
getType
()))
{
config
.
setUseRemote
(
false
);
}
config
.
setAddress
(
clusterService
.
buildEnvironmentAddress
(
config
.
isUseRemote
(),
task
.
getClusterId
()));
}
else
{
Map
<
String
,
Object
>
gatewayConfig
=
clusterConfigurationService
.
getGatewayConfig
(
task
.
getClusterConfigurationId
());
...
...
dlink-core/src/main/java/com/dlink/job/JobConfig.java
View file @
caaa087c
...
...
@@ -2,6 +2,7 @@ package com.dlink.job;
import
com.dlink.assertion.Asserts
;
import
com.dlink.executor.ExecutorSetting
;
import
com.dlink.gateway.GatewayType
;
import
com.dlink.gateway.config.AppConfig
;
import
com.dlink.gateway.config.ClusterConfig
;
import
com.dlink.gateway.config.FlinkConfig
;
...
...
@@ -63,7 +64,7 @@ public class JobConfig {
this
.
config
=
config
;
}
public
JobConfig
(
String
type
,
boolean
useResult
,
boolean
useChangeLog
,
boolean
useAutoCancel
,
boolean
useSession
,
String
session
,
boolean
useRemote
,
Integer
clusterId
,
public
JobConfig
(
String
type
,
boolean
useResult
,
boolean
useChangeLog
,
boolean
useAutoCancel
,
boolean
useSession
,
String
session
,
Integer
clusterId
,
Integer
clusterConfigurationId
,
Integer
jarId
,
Integer
taskId
,
String
jobName
,
boolean
useSqlFragment
,
boolean
useStatementSet
,
Integer
maxRowNum
,
Integer
checkpoint
,
Integer
parallelism
,
Integer
savePointStrategyValue
,
String
savePointPath
,
Map
<
String
,
String
>
config
)
{
...
...
@@ -73,7 +74,7 @@ public class JobConfig {
this
.
useAutoCancel
=
useAutoCancel
;
this
.
useSession
=
useSession
;
this
.
session
=
session
;
this
.
useRemote
=
useRemot
e
;
this
.
useRemote
=
tru
e
;
this
.
clusterId
=
clusterId
;
this
.
clusterConfigurationId
=
clusterConfigurationId
;
this
.
jarId
=
jarId
;
...
...
@@ -213,4 +214,12 @@ public class JobConfig {
gatewayConfig
.
getFlinkConfig
().
getConfiguration
().
put
(
entry
.
getKey
(),
(
String
)
entry
.
getValue
());
}
}
public
boolean
isUseRemote
()
{
return
!
GatewayType
.
LOCAL
.
equalsValue
(
type
);
}
public
void
buildLocal
(){
type
=
GatewayType
.
LOCAL
.
getLongValue
();
}
}
dlink-core/src/test/java/com/dlink/core/JobManagerTest.java
View file @
caaa087c
...
...
@@ -26,7 +26,7 @@ public class JobManagerTest {
@Test
public
void
cancelJobSelect
(){
JobConfig
config
=
new
JobConfig
(
"session-yarn"
,
true
,
true
,
true
,
true
,
"s1"
,
true
,
2
,
JobConfig
config
=
new
JobConfig
(
"session-yarn"
,
true
,
true
,
true
,
true
,
"s1"
,
2
,
null
,
null
,
null
,
"测试"
,
false
,
false
,
100
,
0
,
1
,
0
,
null
,
new
HashMap
<>());
if
(
config
.
isUseRemote
())
{
...
...
dlink-web/src/components/Studio/StudioRightTool/StudioConfig/index.tsx
View file @
caaa087c
import
{
connect
}
from
"umi"
;
import
{
StateType
}
from
"@/pages/FlinkSqlStudio/model"
;
import
{
Form
,
InputNumber
,
Switch
,
Row
,
Col
,
Tooltip
,
Button
,
Badge
,
Typography
Form
,
InputNumber
,
Switch
,
Row
,
Col
,
Tooltip
,
Button
,
}
from
"antd"
;
import
{
InfoCircleOutlined
,
MinusSquareOutlined
}
from
"@ant-design/icons"
;
import
styles
from
"./index.less"
;
import
{
Scrollbars
}
from
'react-custom-scrollbars'
;
const
{
Text
}
=
Typography
;
const
StudioConfig
=
(
props
:
any
)
=>
{
const
{
current
,
form
,
dispatch
,
tabs
,
currentSession
,
toolHeight
}
=
props
;
const
{
current
,
form
,
dispatch
,
tabs
,
toolHeight
}
=
props
;
form
.
setFieldsValue
(
current
.
task
);
...
...
@@ -94,16 +91,6 @@ const StudioConfig = (props: any) => {
</
Form
.
Item
>
</
Col
>
</
Row
>
<
Form
.
Item
label=
"远程执行"
className=
{
styles
.
form_item
}
name=
"useRemote"
valuePropName=
"checked"
tooltip=
{
{
title
:
'开启远程执行,将在远程集群进行任务执行'
,
icon
:
<
InfoCircleOutlined
/>
}
}
>
{
currentSession
.
session
?
(
currentSession
.
sessionConfig
&&
currentSession
.
sessionConfig
.
useRemote
?(<><
Badge
status=
"success"
/><
Text
type=
"success"
>
已启用
</
Text
></>):(<><
Badge
status=
"error"
/><
Text
type=
"danger"
>
已禁用
</
Text
></>)
):(<
Switch
checkedChildren=
"启用"
unCheckedChildren=
"禁用"
/>)
}
</
Form
.
Item
>
</
Form
>
</
Scrollbars
>
</>
...
...
dlink-web/src/pages/FlinkSqlStudio/model.ts
View file @
caaa087c
...
...
@@ -91,7 +91,6 @@ export type TaskType = {
useChangeLog
:
boolean
;
useAutoCancel
:
boolean
;
useSession
:
boolean
;
useRemote
:
boolean
;
};
export
type
ConsoleType
=
{
...
...
@@ -125,7 +124,6 @@ export type SessionType = {
session
?:
string
;
sessionConfig
?:
{
type
?:
string
;
useRemote
?:
boolean
;
clusterId
?:
number
;
clusterName
?:
string
;
address
?:
string
;
...
...
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