RussellSpitzer commented on code in PR #17284:
URL: https://github.com/apache/iceberg/pull/17284#discussion_r3844993282


##########
core/src/main/java/org/apache/iceberg/io/EagerInputFile.java:
##########
@@ -29,23 +33,35 @@
 public class EagerInputFile implements InputFile {
 
   private final InputFile delegate;
-  private final long fileSize;
+  private final long length;
 
-  public EagerInputFile(InputFile delegate, long fileSize) {
+  private EagerInputFile(InputFile delegate, long length) {
     Preconditions.checkNotNull(delegate, "delegate is null");
-    Preconditions.checkArgument(fileSize >= 0, "fileSize is negative: %s", 
fileSize);
+    Preconditions.checkArgument(length >= 0, "length is negative: %s", length);
     Preconditions.checkArgument(
-        fileSize <= Integer.MAX_VALUE,
-        "Cannot eagerly load file because fileSize exceeds eager loading 
capacity, consider reducing eager fetch threshold below %s bytes: %s",
+        length <= Integer.MAX_VALUE,
+        "Cannot eagerly load file because length exceeds eager loading 
capacity, consider reducing eager fetch threshold below %s bytes: %s",
         Integer.MAX_VALUE,
-        fileSize);
+        length);
     this.delegate = delegate;
-    this.fileSize = fileSize;
+    this.length = length;
+  }
+
+  /**
+   * Returns an {@link EagerInputFile}, preserving Hadoop config if {@code 
delegate} is {@link
+   * HadoopConfigurable}.
+   */
+  public static InputFile of(InputFile delegate, long length) {
+    if (delegate instanceof HadoopConfigurable) {
+      return new EagerInputFileConfigurable(
+          delegate, length, ((HadoopConfigurable) delegate).getConf());

Review Comment:
   Probably better that we just pass through the delegate and call getConf on 
it directly.



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