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
45b04942
Unverified
Commit
45b04942
authored
Dec 15, 2023
by
aiwenmo
Committed by
GitHub
Dec 15, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Optimization-2651][core] Remove statement set (#2652)
Co-authored-by:
wenmo
<
32723967+wenmo@users.noreply.github.com
>
parent
fb69c991
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
46 additions
and
18 deletions
+46
-18
TaskDTO.java
dinky-admin/src/main/java/org/dinky/data/dto/TaskDTO.java
+1
-1
TaskServiceImpl.java
...src/main/java/org/dinky/service/impl/TaskServiceImpl.java
+40
-12
FlinkSqlTask.java
...in/src/main/java/org/dinky/service/task/FlinkSqlTask.java
+1
-1
pages.ts
dinky-web/src/locales/en-US/pages.ts
+1
-1
pages.ts
dinky-web/src/locales/zh-CN/pages.ts
+1
-1
index.tsx
...b/src/pages/DataStudio/RightContainer/JobConfig/index.tsx
+2
-2
No files found.
dinky-admin/src/main/java/org/dinky/data/dto/TaskDTO.java
View file @
45b04942
...
...
@@ -90,7 +90,7 @@ public class TaskDTO extends AbstractStatementDTO {
dataType
=
"boolean"
,
example
=
"false"
,
notes
=
"Flag indicating whether to use a statement set"
)
private
boolean
statementSet
;
private
boolean
statementSet
=
true
;
@ApiModelProperty
(
value
=
"Batch Model"
,
...
...
dinky-admin/src/main/java/org/dinky/service/impl/TaskServiceImpl.java
View file @
45b04942
...
...
@@ -202,7 +202,7 @@ public class TaskServiceImpl extends SuperServiceImpl<TaskMapper, Task> implemen
}
@ProcessStep
(
type
=
ProcessStepType
.
SUBMIT_BUILD_CONFIG
)
public
JobConfig
buildJobConfig
(
TaskDTO
task
)
{
public
JobConfig
buildJob
Submit
Config
(
TaskDTO
task
)
{
task
.
setStatement
(
buildEnvSql
(
task
)
+
task
.
getStatement
());
JobConfig
config
=
task
.
getJobConfig
();
Savepoints
savepoints
=
savepointsService
.
getSavePointWithStrategy
(
task
);
...
...
@@ -218,20 +218,44 @@ public class TaskServiceImpl extends SuperServiceImpl<TaskMapper, Task> implemen
flinkClusterCfg
.
getAppConfig
().
setUserJarParas
(
buildParams
(
config
.
getTaskId
()));
flinkClusterCfg
.
getAppConfig
().
setUserJarMainAppClass
(
CommonConstant
.
DINKY_APP_MAIN_CLASS
);
config
.
buildGatewayConfig
(
flinkClusterCfg
);
if
(
task
.
getJobInstanceId
()
==
null
)
{
config
.
setClusterId
(
null
);
}
else
{
JobInstance
jobInstance
=
jobInstanceService
.
getById
(
task
.
getJobInstanceId
());
config
.
setClusterId
(
jobInstance
.
getClusterId
());
config
.
setClusterId
(
null
);
}
else
if
(
GatewayType
.
LOCAL
.
equalsValue
(
task
.
getType
()))
{
config
.
setClusterId
(
null
);
config
.
setClusterConfigurationId
(
null
);
}
else
{
Optional
.
ofNullable
(
task
.
getClusterId
()).
ifPresent
(
config:
:
setClusterId
);
}
log
.
info
(
"Init remote cluster"
);
try
{
config
.
setAddress
(
clusterInstanceService
.
buildEnvironmentAddress
(
config
));
}
catch
(
Exception
e
)
{
log
.
error
(
"Init remote cluster error:{}"
,
e
.
getMessage
());
}
return
config
;
}
@ProcessStep
(
type
=
ProcessStepType
.
SUBMIT_BUILD_CONFIG
)
public
JobConfig
buildJobConfig
(
TaskDTO
task
)
{
JobConfig
config
=
task
.
getJobConfig
();
if
(
GatewayType
.
get
(
task
.
getType
()).
isDeployCluster
())
{
log
.
info
(
"Init gateway config, type:{}"
,
task
.
getType
());
FlinkClusterConfig
flinkClusterCfg
=
clusterCfgService
.
getFlinkClusterCfg
(
config
.
getClusterConfigurationId
());
flinkClusterCfg
.
getAppConfig
().
setUserJarParas
(
buildParams
(
config
.
getTaskId
()));
flinkClusterCfg
.
getAppConfig
().
setUserJarMainAppClass
(
CommonConstant
.
DINKY_APP_MAIN_CLASS
);
config
.
buildGatewayConfig
(
flinkClusterCfg
);
JobInstance
jobInstance
=
jobInstanceService
.
getById
(
task
.
getJobInstanceId
());
if
(
Asserts
.
isNull
(
jobInstance
))
{
log
.
error
(
"Get job instance error: The job instance does not exist."
);
}
config
.
setClusterId
(
jobInstance
.
getClusterId
());
}
else
if
(
GatewayType
.
LOCAL
.
equalsValue
(
task
.
getType
()))
{
JobInstance
jobInstance
=
jobInstanceService
.
getById
(
task
.
getJobInstanceId
());
if
(
task
.
getJobInstanceId
()
==
null
)
{
config
.
setClusterId
(
null
);
}
else
{
config
.
setClusterId
(
jobInstance
.
getClusterId
());
config
.
setUseRemote
(
true
);
if
(
Asserts
.
isNull
(
jobInstance
))
{
log
.
error
(
"Get job instance error: The job instance does not exist."
);
}
config
.
setClusterId
(
jobInstance
.
getClusterId
());
config
.
setUseRemote
(
true
);
config
.
setClusterConfigurationId
(
null
);
}
else
{
Optional
.
ofNullable
(
task
.
getClusterId
()).
ifPresent
(
config:
:
setClusterId
);
...
...
@@ -278,6 +302,8 @@ public class TaskServiceImpl extends SuperServiceImpl<TaskMapper, Task> implemen
// 注解自调用会失效,这里通过获取对象方法绕过此限制
TaskServiceImpl
taskServiceBean
=
applicationContext
.
getBean
(
TaskServiceImpl
.
class
);
TaskDTO
taskDTO
=
taskServiceBean
.
prepareTask
(
submitDto
);
// The statement set is enabled by default when submitting assignments
taskDTO
.
setStatementSet
(
true
);
JobResult
jobResult
=
taskServiceBean
.
executeJob
(
taskDTO
);
log
.
info
(
"Job Submit success"
);
Task
task
=
new
Task
(
submitDto
.
getId
(),
jobResult
.
getJobInstanceId
());
...
...
@@ -298,6 +324,8 @@ public class TaskServiceImpl extends SuperServiceImpl<TaskMapper, Task> implemen
taskDTO
.
setUseChangeLog
(
debugDTO
.
isUseChangeLog
());
taskDTO
.
setUseAutoCancel
(
debugDTO
.
isUseAutoCancel
());
taskDTO
.
setMaxRowNum
(
debugDTO
.
getMaxRowNum
());
// Debug mode need execute
taskDTO
.
setStatementSet
(
false
);
// 注解自调用会失效,这里通过获取对象方法绕过此限制
TaskServiceImpl
taskServiceBean
=
applicationContext
.
getBean
(
TaskServiceImpl
.
class
);
JobResult
jobResult
=
taskServiceBean
.
executeJob
(
taskDTO
);
...
...
@@ -393,7 +421,7 @@ public class TaskServiceImpl extends SuperServiceImpl<TaskMapper, Task> implemen
return
task
.
getStatement
();
}
JobConfig
config
=
buildJobConfig
(
task
);
JobConfig
config
=
buildJob
Submit
Config
(
task
);
// 加密敏感信息
if
(
config
.
getVariables
()
!=
null
)
{
...
...
dinky-admin/src/main/java/org/dinky/service/task/FlinkSqlTask.java
View file @
45b04942
...
...
@@ -63,7 +63,7 @@ public class FlinkSqlTask extends BaseTask {
protected
JobManager
getJobManager
()
{
TaskServiceImpl
taskService
=
SpringUtil
.
getBean
(
TaskServiceImpl
.
class
);
return
JobManager
.
build
(
taskService
.
buildJobConfig
(
task
));
return
JobManager
.
build
(
taskService
.
buildJob
Submit
Config
(
task
));
}
@Override
...
...
dinky-web/src/locales/en-US/pages.ts
View file @
45b04942
...
...
@@ -310,7 +310,7 @@ export default {
* */
'pages.datastudio.editor.check'
:
'Check'
,
'pages.datastudio.editor.debug'
:
'
Debug
'
,
'pages.datastudio.editor.debug'
:
'
Preview
'
,
'pages.datastudio.editor.exec'
:
'Execute'
,
'pages.datastudio.editor.exec.error'
:
'Task [{jobName}] execution failed'
,
'pages.datastudio.editor.debug.error'
:
'Task [{jobName}] debug failed'
,
...
...
dinky-web/src/locales/zh-CN/pages.ts
View file @
45b04942
...
...
@@ -303,7 +303,7 @@ export default {
* */
'pages.datastudio.editor.check'
:
'检查'
,
'pages.datastudio.editor.debug'
:
'
调试
'
,
'pages.datastudio.editor.debug'
:
'
预览
'
,
'pages.datastudio.editor.exec'
:
'运行'
,
'pages.datastudio.editor.exec.error'
:
'任务【{jobName}】执行失败'
,
'pages.datastudio.editor.debug.error'
:
'任务【{jobName}】调试失败'
,
...
...
dinky-web/src/pages/DataStudio/RightContainer/JobConfig/index.tsx
View file @
45b04942
...
...
@@ -233,7 +233,7 @@ const JobConfig = (props: any) => {
max=
{
9999
}
min=
{
1
}
/>
{
current
?.
dialect
?.
toLowerCase
()
===
DIALECT
.
FLINK_SQL
&&
(
{
/*{
current?.dialect?.toLowerCase() === DIALECT.FLINK_SQL && (
<ProFormSwitch
label={l('pages.datastudio.label.jobConfig.insert')}
name='statementSet'
...
...
@@ -244,7 +244,7 @@ const JobConfig = (props: any) => {
}}
{...SWITCH_OPTIONS()}
/>
)
}
)}
*/
}
<
ProFormSwitch
label=
{
l
(
'pages.datastudio.label.jobConfig.fragment'
)
}
...
...
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