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
779c4857
Unverified
Commit
779c4857
authored
Jun 26, 2024
by
luoshangjie
Committed by
GitHub
Jun 26, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Fix] Fix configuration priority issue (#3612)
Co-authored-by:
luoshangjie
<
luoshangjie@yfpharmacy.com
>
Co-authored-by:
18216499322
<
18216499322@users.noreply.github.com
>
parent
c80bb5b2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
6 deletions
+9
-6
JobConfig.java
dinky-core/src/main/java/org/dinky/job/JobConfig.java
+9
-0
GatewayConfig.java
...src/main/java/org/dinky/gateway/config/GatewayConfig.java
+0
-6
No files found.
dinky-core/src/main/java/org/dinky/job/JobConfig.java
View file @
779c4857
...
...
@@ -26,6 +26,7 @@ import org.dinky.executor.ExecutorConfig;
import
org.dinky.gateway.config.FlinkConfig
;
import
org.dinky.gateway.config.GatewayConfig
;
import
org.dinky.gateway.enums.SavePointStrategy
;
import
org.dinky.gateway.model.CustomConfig
;
import
org.dinky.gateway.model.FlinkClusterConfig
;
import
org.apache.flink.configuration.Configuration
;
...
...
@@ -35,6 +36,7 @@ import org.apache.flink.configuration.RestOptions;
import
java.util.HashMap
;
import
java.util.Map
;
import
cn.hutool.core.lang.Assert
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
...
...
@@ -227,6 +229,13 @@ public class JobConfig {
public
void
buildGatewayConfig
(
FlinkClusterConfig
config
)
{
FlinkConfig
flinkConfig
=
config
.
getFlinkConfig
();
// Prioritize loading custom Flink configuration content in the cluster configuration
for
(
CustomConfig
customConfig
:
flinkConfig
.
getFlinkConfigList
())
{
Assert
.
notNull
(
customConfig
.
getName
(),
"Custom flink config has null key"
);
Assert
.
notNull
(
customConfig
.
getValue
(),
"Custom flink config has null value"
);
flinkConfig
.
getConfiguration
().
put
(
customConfig
.
getName
(),
customConfig
.
getValue
());
}
// Load job configuration content afterwards
flinkConfig
.
getConfiguration
().
putAll
(
getConfigJson
());
flinkConfig
.
getConfiguration
().
put
(
CoreOptions
.
DEFAULT_PARALLELISM
.
key
(),
String
.
valueOf
(
parallelism
));
flinkConfig
.
setJobName
(
getJobName
());
...
...
dinky-gateway/src/main/java/org/dinky/gateway/config/GatewayConfig.java
View file @
779c4857
...
...
@@ -20,7 +20,6 @@
package
org
.
dinky
.
gateway
.
config
;
import
org.dinky.data.enums.GatewayType
;
import
org.dinky.gateway.model.CustomConfig
;
import
org.dinky.gateway.model.FlinkClusterConfig
;
import
cn.hutool.core.bean.BeanUtil
;
...
...
@@ -93,11 +92,6 @@ public class GatewayConfig {
Assert
.
notNull
(
config
);
GatewayConfig
gatewayConfig
=
new
GatewayConfig
();
BeanUtil
.
copyProperties
(
config
,
gatewayConfig
);
for
(
CustomConfig
customConfig
:
config
.
getFlinkConfig
().
getFlinkConfigList
())
{
Assert
.
notNull
(
customConfig
.
getName
(),
"Custom flink config has null key"
);
Assert
.
notNull
(
customConfig
.
getValue
(),
"Custom flink config has null value"
);
gatewayConfig
.
getFlinkConfig
().
getConfiguration
().
put
(
customConfig
.
getName
(),
customConfig
.
getValue
());
}
return
gatewayConfig
;
}
}
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