Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import org.apache.streampark.console.base.exception.ApiAlertException;
import org.apache.streampark.console.base.exception.ApiDetailException;

import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.StringUtils;

import com.baomidou.mybatisplus.annotation.IdType;
Expand All @@ -34,6 +35,7 @@

import java.io.File;
import java.io.Serializable;
import java.nio.charset.StandardCharsets;
import java.util.Date;
import java.util.Map;

Expand Down Expand Up @@ -74,7 +76,14 @@
public void doSetFlinkConf() throws ApiDetailException {
Float version = getVersionNumber();
File configFile = resolveConfigFile(version);
this.flinkConf = configFile.getAbsolutePath();

try {
String flinkConf = FileUtils.readFileToString(configFile, StandardCharsets.UTF_8);

Check warning on line 81 in streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/FlinkEnv.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename "flinkConf" which hides the field declared at line 54.

See more on https://sonarcloud.io/project/issues?id=apache_incubator-streampark&issues=AZ79_TBjtAWirTqm_9qH&open=AZ79_TBjtAWirTqm_9qH&pullRequest=4375
this.flinkConf = DeflaterUtils.zipString(flinkConf);
} catch (Exception e) {
throw new ApiDetailException(
"Failed to read Flink configuration file: " + configFile.getAbsolutePath(), e);
}
}

private File resolveConfigFile(Float version) throws ApiAlertException {
Expand Down
Loading