nastra commented on code in PR #15583:
URL: https://github.com/apache/iceberg/pull/15583#discussion_r2922568481


##########
core/src/main/java/org/apache/iceberg/hadoop/SerializableConfiguration.java:
##########
@@ -18,33 +18,34 @@
  */
 package org.apache.iceberg.hadoop;
 
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
 import java.io.Serializable;
 import org.apache.hadoop.conf.Configuration;
+import org.apache.iceberg.relocated.com.google.common.collect.Maps;
+import org.apache.iceberg.util.SerializableMap;
+import org.apache.iceberg.util.SerializableSupplier;
 
 /** Wraps a {@link Configuration} object in a {@link Serializable} layer. */
-public class SerializableConfiguration implements Serializable {
-
-  private transient Configuration hadoopConf;
+public class SerializableConfiguration implements 
SerializableSupplier<Configuration> {
+  private final SerializableMap<String, String> confAsMap;
+  private transient volatile Configuration hadoopConf = null;
 
   public SerializableConfiguration(Configuration hadoopConf) {
-    this.hadoopConf = hadoopConf;
-  }
-
-  private void writeObject(ObjectOutputStream out) throws IOException {
-    out.defaultWriteObject();
-    hadoopConf.write(out);
-  }
-
-  private void readObject(ObjectInputStream in) throws ClassNotFoundException, 
IOException {
-    in.defaultReadObject();
-    hadoopConf = new Configuration(false);
-    hadoopConf.readFields(in);
+    this.confAsMap = 
SerializableMap.copyOf(Maps.newHashMapWithExpectedSize(hadoopConf.size()));

Review Comment:
   removed this and added an explicit test with java+kryo serde



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to