Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions api/src/main/java/org/apache/iceberg/io/FileRange.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
*/
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;
Expand All @@ -28,8 +27,7 @@ public class FileRange {
private final long offset;
private final int length;

public FileRange(CompletableFuture<ByteBuffer> byteBuffer, long offset, int length)
throws EOFException {
public FileRange(CompletableFuture<ByteBuffer> byteBuffer, long offset, int length) {
Comment thread
mukund-thakur marked this conversation as resolved.
Preconditions.checkNotNull(byteBuffer, "byteBuffer can't be null");
Preconditions.checkArgument(
length() >= 0, "Invalid length: %s in range (must be >= 0)", length);
Comment thread
mukund-thakur marked this conversation as resolved.
Expand Down
17 changes: 4 additions & 13 deletions parquet/src/main/java/org/apache/iceberg/parquet/ParquetIO.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
*/
package org.apache.iceberg.parquet;

import java.io.EOFException;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
Expand Down Expand Up @@ -187,18 +186,10 @@ private static List<FileRange> convertRanges(List<ParquetFileRange> ranges) {
parquetFileRange -> {
CompletableFuture<ByteBuffer> future = new CompletableFuture<>();
parquetFileRange.setDataReadFuture(future);
try {
return new FileRange(
parquetFileRange.getDataReadFuture(),
parquetFileRange.getOffset(),
parquetFileRange.getLength());
} catch (EOFException e) {
throw new RuntimeIOException(
e,
"Failed to create range file for offset: %s and length: %s",
parquetFileRange.getOffset(),
parquetFileRange.getLength());
}
return new FileRange(
parquetFileRange.getDataReadFuture(),
Comment thread
mukund-thakur marked this conversation as resolved.
parquetFileRange.getOffset(),
parquetFileRange.getLength());
})
.collect(Collectors.toList());
}
Expand Down