Skip to content

Commit

Permalink
added input logging
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Jan 16, 2025
1 parent a775041 commit bde8b15
Showing 1 changed file with 16 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -241,42 +241,47 @@ private static String parseNumeric(String str) {

public static List<String> migrateLegacyConfigurationToStandardYaml(
String[] args, String cmdLineSyntax) throws FlinkParseException {

// Log the input arguments
LOG.info("Input arguments (args): {}", Arrays.toString(args));
LOG.info("Command line syntax (cmdLineSyntax): {}", cmdLineSyntax);

final CommandLineParser<ClusterConfiguration> commandLineParser =
new CommandLineParser<>(new ClusterConfigurationParserFactory());

final ClusterConfiguration clusterConfiguration;

try {
clusterConfiguration = commandLineParser.parse(args);
} catch (FlinkParseException e) {
LOG.error("Could not parse the command line options.", e);
commandLineParser.printHelp(cmdLineSyntax);
throw e;
}

checkState(
new File(
clusterConfiguration.getConfigDir(),
GlobalConfiguration.LEGACY_FLINK_CONF_FILENAME)
.exists());
Configuration configuration =
GlobalConfiguration.loadConfiguration(clusterConfiguration.getConfigDir(), null);

Configuration standardYamlConfig = new Configuration(true);
standardYamlConfig.addAll(configuration);
LOG.info("before feeding into ConfigurationUtils : ", standardYamlConfig);
LOG.debug("before feeding into ConfigurationUtils DEBUG : ", standardYamlConfig);

LOG.info("before feeding into ConfigurationUtils : {}", standardYamlConfig);
LOG.debug("before feeding into ConfigurationUtils DEBUG : {}", standardYamlConfig);
// Convert configuration to writable lines
List<String> writableLines =
ConfigurationUtils.convertConfigToWritableLines(standardYamlConfig, false);

// Log the output
LOG.info("Converted configuration to writable lines: {}", writableLines);
LOG.debug("Converted configuration to writable lines (DEBUG): {}", writableLines);

return writableLines;

// return ConfigurationUtils.convertConfigToWritableLines(standardYamlConfig, false);
}


}

0 comments on commit bde8b15

Please sign in to comment.