You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@iceberg.apache.org by GitBox <gi...@apache.org> on 2018/11/27 19:27:05 UTC

[GitHub] mccheah commented on a change in pull request #14: Pluggable file I/O submodule in TableOperations

mccheah commented on a change in pull request #14: Pluggable file I/O submodule in TableOperations
URL: https://github.com/apache/incubator-iceberg/pull/14#discussion_r236812021
 
 

 ##########
 File path: core/src/main/java/com/netflix/iceberg/hadoop/HadoopFileIO.java
 ##########
 @@ -0,0 +1,55 @@
+package com.netflix.iceberg.hadoop;
+
+import com.netflix.iceberg.FileIO;
+import com.netflix.iceberg.exceptions.RuntimeIOException;
+import com.netflix.iceberg.io.InputFile;
+import com.netflix.iceberg.io.OutputFile;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.Path;
+
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+
+public class HadoopFileIO implements FileIO {
+  private static final long serialVersionUID = 1L;
+
+  private transient Configuration hadoopConf;
+
+  public HadoopFileIO(Configuration hadoopConf) {
+    this.hadoopConf = hadoopConf;
+  }
+
+  private void writeObject(ObjectOutputStream out) throws IOException {
+    out.defaultWriteObject();
+    hadoopConf.write(out);
 
 Review comment:
   This is more or less what Spark's `SerializableConfiguration` does, except of course we don't have Spark here, so we have to do it ourselves.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services