AHeise commented on a change in pull request #11725: [FLINK-15670][API] Provide
a Kafka Source/Sink pair as KafkaShuffle
URL: https://github.com/apache/flink/pull/11725#discussion_r410295578
##########
File path: flink-core/src/main/java/org/apache/flink/util/PropertiesUtil.java
##########
@@ -108,6 +109,27 @@ public static boolean getBoolean(Properties config,
String key, boolean defaultV
}
}
+ /**
+ * Flatten a recursive {@link Properties} to a first level property map.
+ * In some cases, {KafkaProducer#propsToMap} for example, Properties is
used purely as a HashMap
+ * without considering its default properties.
+ *
+ * @param config Properties to be flatten
+ * @return Properties without defaults; all properties are put in the
first-level
+ */
+ public static Properties flatten(Properties config) {
Review comment:
Although Properties can be used recursively, it's in a different way than
most collections, so I found the name `flatten` very confusing at first. How
about `resolveDefaults`?
Then I'd also adjust the javadoc: `Flatten the default values of a
Properties...`?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services