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
c610afb4
Unverified
Commit
c610afb4
authored
Aug 23, 2023
by
Licho
Committed by
GitHub
Aug 23, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: configJson problem (#2260)
* fix: configJson problem * Spotless Apply --------- Co-authored-by:
leechor
<
leechor@users.noreply.github.com
>
parent
009fb6a5
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
30 additions
and
27 deletions
+30
-27
StudioExecuteDTO.java
...in/src/main/java/org/dinky/data/dto/StudioExecuteDTO.java
+2
-2
TaskServiceImpl.java
...src/main/java/org/dinky/service/impl/TaskServiceImpl.java
+2
-2
JobConfig.java
dinky-core/src/main/java/org/dinky/job/JobConfig.java
+15
-15
JobManager.java
dinky-core/src/main/java/org/dinky/job/JobManager.java
+4
-4
JobConfigTest.java
dinky-core/src/test/java/org/dinky/job/JobConfigTest.java
+1
-1
service.tsx
dinky-web/src/pages/DataStudio/HeaderContainer/service.tsx
+2
-0
index.tsx
...b/src/pages/DataStudio/RightContainer/JobConfig/index.tsx
+3
-2
index.tsx
...web/src/pages/DataStudio/RightContainer/JobInfo/index.tsx
+1
-1
No files found.
dinky-admin/src/main/java/org/dinky/data/dto/StudioExecuteDTO.java
View file @
c610afb4
...
@@ -62,7 +62,7 @@ public class StudioExecuteDTO extends AbstractStatementDTO {
...
@@ -62,7 +62,7 @@ public class StudioExecuteDTO extends AbstractStatementDTO {
private
Integer
parallelism
;
private
Integer
parallelism
;
private
Integer
savePointStrategy
;
private
Integer
savePointStrategy
;
private
String
savePointPath
;
private
String
savePointPath
;
private
Map
<
String
,
String
>
config
=
new
HashMap
<>();
private
Map
<
String
,
String
>
config
Json
=
new
HashMap
<>();
private
static
final
ObjectMapper
mapper
=
new
ObjectMapper
();
private
static
final
ObjectMapper
mapper
=
new
ObjectMapper
();
public
JobConfig
getJobConfig
()
{
public
JobConfig
getJobConfig
()
{
...
@@ -87,7 +87,7 @@ public class StudioExecuteDTO extends AbstractStatementDTO {
...
@@ -87,7 +87,7 @@ public class StudioExecuteDTO extends AbstractStatementDTO {
savePointStrategy
,
savePointStrategy
,
savePointPath
,
savePointPath
,
getVariables
(),
getVariables
(),
config
);
config
Json
);
}
}
public
Integer
getTaskId
()
{
public
Integer
getTaskId
()
{
...
...
dinky-admin/src/main/java/org/dinky/service/impl/TaskServiceImpl.java
View file @
c610afb4
...
@@ -942,7 +942,7 @@ public class TaskServiceImpl extends SuperServiceImpl<TaskMapper, Task> implemen
...
@@ -942,7 +942,7 @@ public class TaskServiceImpl extends SuperServiceImpl<TaskMapper, Task> implemen
Savepoints
savepoints
=
buildSavepoint
(
config
);
Savepoints
savepoints
=
buildSavepoint
(
config
);
if
(
Asserts
.
isNotNull
(
savepoints
))
{
if
(
Asserts
.
isNotNull
(
savepoints
))
{
config
.
setSavePointPath
(
savepoints
.
getPath
());
config
.
setSavePointPath
(
savepoints
.
getPath
());
config
.
getConfig
().
put
(
"execution.savepoint.path"
,
savepoints
.
getPath
());
config
.
getConfig
Json
().
put
(
"execution.savepoint.path"
,
savepoints
.
getPath
());
}
}
if
(!
GatewayType
.
get
(
task
.
getType
()).
isDeployCluster
())
{
if
(!
GatewayType
.
get
(
task
.
getType
()).
isDeployCluster
())
{
...
@@ -977,7 +977,7 @@ public class TaskServiceImpl extends SuperServiceImpl<TaskMapper, Task> implemen
...
@@ -977,7 +977,7 @@ public class TaskServiceImpl extends SuperServiceImpl<TaskMapper, Task> implemen
private
FlinkClusterConfig
buildGatewayCfgObj
(
JobConfig
config
)
{
private
FlinkClusterConfig
buildGatewayCfgObj
(
JobConfig
config
)
{
FlinkClusterConfig
flinkClusterCfg
=
clusterCfgService
.
getFlinkClusterCfg
(
config
.
getClusterConfigurationId
());
FlinkClusterConfig
flinkClusterCfg
=
clusterCfgService
.
getFlinkClusterCfg
(
config
.
getClusterConfigurationId
());
flinkClusterCfg
.
getAppConfig
().
setUserJarParas
(
buildParas
(
config
.
getTaskId
()));
flinkClusterCfg
.
getAppConfig
().
setUserJarParas
(
buildParas
(
config
.
getTaskId
()));
flinkClusterCfg
.
getFlinkConfig
().
getConfiguration
().
putAll
(
config
.
getConfig
());
flinkClusterCfg
.
getFlinkConfig
().
getConfiguration
().
putAll
(
config
.
getConfig
Json
());
// if (config.isJarTask()) {
// if (config.isJarTask()) {
// JSONObject clusterObj = new JSONObject(flinkClusterCfg);
// JSONObject clusterObj = new JSONObject(flinkClusterCfg);
...
...
dinky-core/src/main/java/org/dinky/job/JobConfig.java
View file @
c610afb4
...
@@ -74,21 +74,21 @@ public class JobConfig {
...
@@ -74,21 +74,21 @@ public class JobConfig {
private
String
savePointPath
;
private
String
savePointPath
;
private
GatewayConfig
gatewayConfig
;
private
GatewayConfig
gatewayConfig
;
private
Map
<
String
,
String
>
variables
;
private
Map
<
String
,
String
>
variables
;
private
Map
<
String
,
String
>
config
;
private
Map
<
String
,
String
>
config
Json
;
public
JobConfig
()
{
public
JobConfig
()
{
this
.
config
=
new
HashMap
<
String
,
String
>();
this
.
config
Json
=
new
HashMap
<
String
,
String
>();
}
}
public
void
setAddress
(
String
address
)
{
public
void
setAddress
(
String
address
)
{
if
(
GatewayType
.
LOCAL
.
equalsValue
(
type
)
if
(
GatewayType
.
LOCAL
.
equalsValue
(
type
)
&&
Asserts
.
isNotNull
(
config
)
&&
Asserts
.
isNotNull
(
config
Json
)
&&
config
.
containsKey
(
RestOptions
.
PORT
.
key
()))
{
&&
config
Json
.
containsKey
(
RestOptions
.
PORT
.
key
()))
{
int
colonIndex
=
address
.
indexOf
(
':'
);
int
colonIndex
=
address
.
indexOf
(
':'
);
if
(
colonIndex
==
-
1
)
{
if
(
colonIndex
==
-
1
)
{
this
.
address
=
address
+
NetConstant
.
COLON
+
config
.
get
(
RestOptions
.
PORT
.
key
());
this
.
address
=
address
+
NetConstant
.
COLON
+
config
Json
.
get
(
RestOptions
.
PORT
.
key
());
}
else
{
}
else
{
this
.
address
=
address
.
replaceAll
(
"(?<=:)\\d{0,6}$"
,
config
.
get
(
RestOptions
.
PORT
.
key
()));
this
.
address
=
address
.
replaceAll
(
"(?<=:)\\d{0,6}$"
,
config
Json
.
get
(
RestOptions
.
PORT
.
key
()));
}
}
}
else
{
}
else
{
this
.
address
=
address
;
this
.
address
=
address
;
...
@@ -102,14 +102,14 @@ public class JobConfig {
...
@@ -102,14 +102,14 @@ public class JobConfig {
boolean
useSqlFragment
,
boolean
useSqlFragment
,
boolean
useStatementSet
,
boolean
useStatementSet
,
Integer
parallelism
,
Integer
parallelism
,
Map
<
String
,
String
>
config
)
{
Map
<
String
,
String
>
config
Json
)
{
this
.
type
=
type
;
this
.
type
=
type
;
this
.
useSession
=
useSession
;
this
.
useSession
=
useSession
;
this
.
useRemote
=
useRemote
;
this
.
useRemote
=
useRemote
;
this
.
useSqlFragment
=
useSqlFragment
;
this
.
useSqlFragment
=
useSqlFragment
;
this
.
useStatementSet
=
useStatementSet
;
this
.
useStatementSet
=
useStatementSet
;
this
.
parallelism
=
parallelism
;
this
.
parallelism
=
parallelism
;
this
.
config
=
config
;
this
.
config
Json
=
configJson
;
}
}
public
JobConfig
(
public
JobConfig
(
...
@@ -133,7 +133,7 @@ public class JobConfig {
...
@@ -133,7 +133,7 @@ public class JobConfig {
Integer
savePointStrategyValue
,
Integer
savePointStrategyValue
,
String
savePointPath
,
String
savePointPath
,
Map
<
String
,
String
>
variables
,
Map
<
String
,
String
>
variables
,
Map
<
String
,
String
>
config
)
{
Map
<
String
,
String
>
config
Json
)
{
this
.
type
=
type
;
this
.
type
=
type
;
this
.
useResult
=
useResult
;
this
.
useResult
=
useResult
;
this
.
useChangeLog
=
useChangeLog
;
this
.
useChangeLog
=
useChangeLog
;
...
@@ -155,7 +155,7 @@ public class JobConfig {
...
@@ -155,7 +155,7 @@ public class JobConfig {
this
.
savePointStrategy
=
SavePointStrategy
.
get
(
savePointStrategyValue
);
this
.
savePointStrategy
=
SavePointStrategy
.
get
(
savePointStrategyValue
);
this
.
savePointPath
=
savePointPath
;
this
.
savePointPath
=
savePointPath
;
this
.
variables
=
variables
;
this
.
variables
=
variables
;
this
.
config
=
config
;
this
.
config
Json
=
configJson
;
}
}
public
JobConfig
(
public
JobConfig
(
...
@@ -175,7 +175,7 @@ public class JobConfig {
...
@@ -175,7 +175,7 @@ public class JobConfig {
Integer
parallelism
,
Integer
parallelism
,
Integer
savePointStrategyValue
,
Integer
savePointStrategyValue
,
String
savePointPath
,
String
savePointPath
,
Map
<
String
,
String
>
config
,
Map
<
String
,
String
>
config
Json
,
GatewayConfig
gatewayConfig
)
{
GatewayConfig
gatewayConfig
)
{
this
.
type
=
type
;
this
.
type
=
type
;
this
.
useResult
=
useResult
;
this
.
useResult
=
useResult
;
...
@@ -192,7 +192,7 @@ public class JobConfig {
...
@@ -192,7 +192,7 @@ public class JobConfig {
this
.
parallelism
=
parallelism
;
this
.
parallelism
=
parallelism
;
this
.
savePointStrategy
=
SavePointStrategy
.
get
(
savePointStrategyValue
);
this
.
savePointStrategy
=
SavePointStrategy
.
get
(
savePointStrategyValue
);
this
.
savePointPath
=
savePointPath
;
this
.
savePointPath
=
savePointPath
;
this
.
config
=
config
;
this
.
config
Json
=
configJson
;
this
.
gatewayConfig
=
gatewayConfig
;
this
.
gatewayConfig
=
gatewayConfig
;
setAddress
(
address
);
setAddress
(
address
);
}
}
...
@@ -232,7 +232,7 @@ public class JobConfig {
...
@@ -232,7 +232,7 @@ public class JobConfig {
Integer
parallelism
,
Integer
parallelism
,
Integer
savePointStrategyValue
,
Integer
savePointStrategyValue
,
String
savePointPath
,
String
savePointPath
,
Map
<
String
,
String
>
config
,
Map
<
String
,
String
>
config
Json
,
boolean
isJarTask
)
{
boolean
isJarTask
)
{
this
.
type
=
type
;
this
.
type
=
type
;
this
.
step
=
step
;
this
.
step
=
step
;
...
@@ -251,7 +251,7 @@ public class JobConfig {
...
@@ -251,7 +251,7 @@ public class JobConfig {
this
.
parallelism
=
parallelism
;
this
.
parallelism
=
parallelism
;
this
.
savePointStrategy
=
SavePointStrategy
.
get
(
savePointStrategyValue
);
this
.
savePointStrategy
=
SavePointStrategy
.
get
(
savePointStrategyValue
);
this
.
savePointPath
=
savePointPath
;
this
.
savePointPath
=
savePointPath
;
this
.
config
=
config
;
this
.
config
Json
=
configJson
;
this
.
isJarTask
=
isJarTask
;
this
.
isJarTask
=
isJarTask
;
}
}
...
@@ -264,7 +264,7 @@ public class JobConfig {
...
@@ -264,7 +264,7 @@ public class JobConfig {
useBatchModel
,
useBatchModel
,
savePointPath
,
savePointPath
,
jobName
,
jobName
,
config
);
config
Json
);
}
}
public
void
buildGatewayConfig
(
FlinkClusterConfig
config
)
{
public
void
buildGatewayConfig
(
FlinkClusterConfig
config
)
{
...
...
dinky-core/src/main/java/org/dinky/job/JobManager.java
View file @
c610afb4
...
@@ -352,9 +352,9 @@ public class JobManager {
...
@@ -352,9 +352,9 @@ public class JobManager {
}
}
public
void
initClassLoader
(
JobConfig
config
)
{
public
void
initClassLoader
(
JobConfig
config
)
{
if
(
CollUtil
.
isNotEmpty
(
config
.
getConfig
()))
{
if
(
CollUtil
.
isNotEmpty
(
config
.
getConfig
Json
()))
{
String
pipelineJars
=
config
.
getConfig
().
get
(
PipelineOptions
.
JARS
.
key
());
String
pipelineJars
=
config
.
getConfig
Json
().
get
(
PipelineOptions
.
JARS
.
key
());
String
classpaths
=
config
.
getConfig
().
get
(
PipelineOptions
.
CLASSPATHS
.
key
());
String
classpaths
=
config
.
getConfig
Json
().
get
(
PipelineOptions
.
CLASSPATHS
.
key
());
// add custom jar path
// add custom jar path
if
(
StrUtil
.
isNotBlank
(
pipelineJars
))
{
if
(
StrUtil
.
isNotBlank
(
pipelineJars
))
{
String
[]
paths
=
pipelineJars
.
split
(
","
);
String
[]
paths
=
pipelineJars
.
split
(
","
);
...
@@ -721,7 +721,7 @@ public class JobManager {
...
@@ -721,7 +721,7 @@ public class JobManager {
.
setFlinkConfig
(
FlinkConfig
.
build
(
jobId
,
ActionType
.
SAVEPOINT
.
getValue
(),
savePointType
,
null
));
.
setFlinkConfig
(
FlinkConfig
.
build
(
jobId
,
ActionType
.
SAVEPOINT
.
getValue
(),
savePointType
,
null
));
return
Gateway
.
build
(
config
.
getGatewayConfig
()).
savepointJob
(
savePoint
);
return
Gateway
.
build
(
config
.
getGatewayConfig
()).
savepointJob
(
savePoint
);
}
else
{
}
else
{
return
FlinkAPI
.
build
(
config
.
getAddress
()).
savepoints
(
jobId
,
savePointType
,
config
.
getConfig
());
return
FlinkAPI
.
build
(
config
.
getAddress
()).
savepoints
(
jobId
,
savePointType
,
config
.
getConfig
Json
());
}
}
}
}
...
...
dinky-core/src/test/java/org/dinky/job/JobConfigTest.java
View file @
c610afb4
...
@@ -40,7 +40,7 @@ class JobConfigTest {
...
@@ -40,7 +40,7 @@ class JobConfigTest {
Map
<
String
,
String
>
config
=
new
HashMap
<>();
Map
<
String
,
String
>
config
=
new
HashMap
<>();
config
.
put
(
RestOptions
.
PORT
.
key
(),
"9999"
);
config
.
put
(
RestOptions
.
PORT
.
key
(),
"9999"
);
jobConfig
.
setConfig
(
config
);
jobConfig
.
setConfig
Json
(
config
);
jobConfig
.
setAddress
(
"127.0.0.1:7777"
);
jobConfig
.
setAddress
(
"127.0.0.1:7777"
);
assertEquals
(
"127.0.0.1:9999"
,
jobConfig
.
getAddress
());
assertEquals
(
"127.0.0.1:9999"
,
jobConfig
.
getAddress
());
...
...
dinky-web/src/pages/DataStudio/HeaderContainer/service.tsx
View file @
c610afb4
...
@@ -10,6 +10,8 @@ export async function getJobPlan(title: string, params: any) {
...
@@ -10,6 +10,8 @@ export async function getJobPlan(title: string, params: any) {
return
handleOption
(
'/api/studio/getJobPlan'
,
title
,
params
);
return
handleOption
(
'/api/studio/getJobPlan'
,
title
,
params
);
}
}
export
async
function
executeSql
(
title
:
string
,
params
:
TaskDataType
)
{
export
async
function
executeSql
(
title
:
string
,
params
:
TaskDataType
)
{
// TODO: temp process
params
.
configJson
=
params
.
configJson
[
0
];
return
handleOption
(
'/api/studio/executeSql'
,
title
,
params
);
return
handleOption
(
'/api/studio/executeSql'
,
title
,
params
);
}
}
export
function
offLineTask
(
title
:
string
,
id
:
number
,
type
:
string
)
{
export
function
offLineTask
(
title
:
string
,
id
:
number
,
type
:
string
)
{
...
...
dinky-web/src/pages/DataStudio/RightContainer/JobConfig/index.tsx
View file @
c610afb4
...
@@ -46,6 +46,7 @@ import {
...
@@ -46,6 +46,7 @@ import {
}
from
'@ant-design/pro-components'
;
}
from
'@ant-design/pro-components'
;
import
{
Badge
,
Space
,
Typography
}
from
'antd'
;
import
{
Badge
,
Space
,
Typography
}
from
'antd'
;
import
{
useForm
}
from
'antd/es/form/Form'
;
import
{
useForm
}
from
'antd/es/form/Form'
;
import
{
debounce
}
from
'lodash'
;
import
{
connect
}
from
'umi'
;
import
{
connect
}
from
'umi'
;
const
{
Text
}
=
Typography
;
const
{
Text
}
=
Typography
;
...
@@ -81,7 +82,7 @@ const JobConfig = (props: any) => {
...
@@ -81,7 +82,7 @@ const JobConfig = (props: any) => {
}
}
Object
.
keys
(
change
).
forEach
((
key
)
=>
{
Object
.
keys
(
change
).
forEach
((
key
)
=>
{
pane
.
params
.
taskData
[
key
]
=
change
[
key
];
pane
.
params
.
taskData
[
key
]
=
all
[
key
];
});
});
dispatch
({
dispatch
({
...
@@ -111,7 +112,7 @@ const JobConfig = (props: any) => {
...
@@ -111,7 +112,7 @@ const JobConfig = (props: any) => {
form=
{
form
}
form=
{
form
}
submitter=
{
false
}
submitter=
{
false
}
layout=
'vertical'
layout=
'vertical'
onValuesChange=
{
onValuesChange
}
onValuesChange=
{
debounce
(
onValuesChange
,
500
)
}
>
>
<
ProFormSelect
<
ProFormSelect
name=
'type'
name=
'type'
...
...
dinky-web/src/pages/DataStudio/RightContainer/JobInfo/index.tsx
View file @
c610afb4
...
@@ -46,7 +46,7 @@ const JobInfo = (props: any) => {
...
@@ -46,7 +46,7 @@ const JobInfo = (props: any) => {
}
}
Object
.
keys
(
change
).
forEach
((
key
)
=>
{
Object
.
keys
(
change
).
forEach
((
key
)
=>
{
pane
.
params
.
taskData
[
key
]
=
change
[
key
];
pane
.
params
.
taskData
[
key
]
=
all
[
key
];
});
});
dispatch
({
dispatch
({
...
...
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