stayrascal commented on a change in pull request #4920:
URL: https://github.com/apache/hudi/pull/4920#discussion_r815621307
##########
File path:
hudi-common/src/main/java/org/apache/hudi/common/config/TypedProperties.java
##########
@@ -63,11 +64,22 @@ public Enumeration propertyNames() {
public Set<String> stringPropertyNames() {
Set<String> set = new LinkedHashSet<>();
for (Object key : this.keys) {
- set.add((String) key);
+ if (key instanceof String) {
+ set.add((String) key);
+ }
}
return set;
}
+ public synchronized void putAll(Properties t) {
+ for (Map.Entry<?, ?> e : t.entrySet()) {
+ if (!containsKey(String.valueOf(e.getKey()))) {
+ keys.add(e.getKey());
+ }
+ super.put(e.getKey(), e.getValue());
Review comment:
What I'm thinking there about using `super.put` is that we have already
add the keys into current keys(`LinkedHashset`), if we still call `this.put`,
it will remove the key again and add the key later in the `LinkedHashset`, it
seems that we don't need to update the key position in the `LinkedHashset`.
--
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]