wolfboys commented on code in PR #3629:
URL:
https://github.com/apache/incubator-streampark/pull/3629#discussion_r1538561259
##########
streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/FlinkEnv.java:
##########
@@ -74,6 +74,7 @@ public class FlinkEnv implements Serializable {
public void doSetFlinkConf() throws ApiDetailException {
Review Comment:
If users want to use the legacy configuration file flink-conf.yaml, they
need to copy this file into the conf/ directory. Once the legacy configuration
file flink-conf.yaml is detected, Flink will prioritize using it as the
configuration file. In the upcoming Flink 2.0, the flink-conf.yaml
configuration file will no longer work,
For different Flink versions, there should be corresponding configuration
file reading strategies, rather than a simple "either flink-conf.yml or
config.yml" approach.
```
public void doSetFlinkConf() throws ApiDetailException {
File yaml;
float ver =
Float.parseFloat(getVersionOfFirst().concat(".").concat(getVersionOfMiddle()));
if (ver < 1.19f) {
yaml = new File(this.flinkHome.concat("/conf/flink-conf.yaml"));
if (!yaml.exists()) {
throw new ApiAlertException("cannot find flink-conf.yaml in
flink/conf ");
}
} else if (ver == 1.19f) {
yaml = new File(this.flinkHome.concat("/conf/flink-conf.yaml"));
if (!yaml.exists()) {
yaml = new File(this.flinkHome.concat("/conf/config.yaml"));
}
if (!yaml.exists()) {
throw new ApiAlertException("cannot find config.yaml|flink-conf.yaml
in flink/conf ");
}
} else {
yaml = new File(this.flinkHome.concat("/conf/config.yaml"));
if (!yaml.exists()) {
throw new ApiAlertException("cannot find config.yaml in flink/conf
");
}
}
try {
String flinkConf = FileUtils.readFileToString(yaml);
this.flinkConf = DeflaterUtils.zipString(flinkConf);
} catch (Exception e) {
throw new ApiDetailException(e);
}
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]