diff --git a/flink-cdc-cli/src/main/java/org/apache/flink/cdc/cli/utils/FlinkEnvironmentUtils.java b/flink-cdc-cli/src/main/java/org/apache/flink/cdc/cli/utils/FlinkEnvironmentUtils.java index 7c4a7acea..198a80c19 100644 --- a/flink-cdc-cli/src/main/java/org/apache/flink/cdc/cli/utils/FlinkEnvironmentUtils.java +++ b/flink-cdc-cli/src/main/java/org/apache/flink/cdc/cli/utils/FlinkEnvironmentUtils.java @@ -24,7 +24,6 @@ import org.apache.flink.runtime.jobgraph.SavepointRestoreSettings; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.io.FileNotFoundException; import java.nio.file.Path; import java.util.List; @@ -38,13 +37,9 @@ public class FlinkEnvironmentUtils { public static Configuration loadFlinkConfiguration(Path flinkHome) throws Exception { Path flinkConfPath = flinkHome.resolve(FLINK_CONF_DIR).resolve(FLINK_CONF_FILENAME); - try { + if (flinkConfPath.toFile().exists()) { return ConfigurationUtils.loadConfigFile(flinkConfPath); - } catch (FileNotFoundException e) { - LOG.warn( - "Failed to load the configuration file from {}. Trying to use legacy YAML parser to load flink configuration file from {}.", - FLINK_CONF_FILENAME, - LEGACY_FLINK_CONF_FILENAME); + } else { return ConfigurationUtils.loadConfigFile( flinkHome.resolve(FLINK_CONF_DIR).resolve(LEGACY_FLINK_CONF_FILENAME), true); }