codope commented on a change in pull request #4920:
URL: https://github.com/apache/hudi/pull/4920#discussion_r816010301



##########
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:
       Sorry, i get your point now. The key position in the set itself need not 
be updated.

##########
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:
       Actually we do need to update the key position. The reason 
`LinkedHashSet` was added to `TypedProperties` is so that the order of keys is 
maintained.




-- 
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]


Reply via email to