danielcweeks commented on code in PR #15581:
URL: https://github.com/apache/iceberg/pull/15581#discussion_r3075891778
##########
api/src/main/java/org/apache/iceberg/io/FileRange.java:
##########
@@ -18,19 +18,25 @@
*/
package org.apache.iceberg.io;
-import java.io.EOFException;
import java.nio.ByteBuffer;
import java.util.concurrent.CompletableFuture;
import org.apache.iceberg.relocated.com.google.common.base.Preconditions;
-public class FileRange {
- private final CompletableFuture<ByteBuffer> byteBuffer;
+public class FileRange implements Comparable<FileRange> {
+ private CompletableFuture<ByteBuffer> byteBuffer;
private final long offset;
private final int length;
- public FileRange(CompletableFuture<ByteBuffer> byteBuffer, long offset, int
length)
- throws EOFException {
- Preconditions.checkNotNull(byteBuffer, "byteBuffer can't be null");
+ public FileRange(long offset, int length) {
Review Comment:
I'm trying to understand why this is necessary. ~~If we're coalescing
ranges, we should probably be using something like Netty's CompositeByteBuf to
wrap the file ranges and skipped ranges into a larger write buffer. This would
allow us to read the composite ranges together but still populate the buffers
directly.~~
Looking at how we're handling the ranges, the CompositeByteBuf approach
probably doesn't make sense, but I have an alternate suggestion.
--
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]