Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
JingsongLi committed Aug 1, 2024
1 parent 3bf7d5e commit 926c4ee
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.function.BiFunction;

import static org.apache.paimon.utils.ObjectsFile.readFromIterator;

Expand All @@ -47,14 +46,14 @@ public class ObjectsCache<K, V> {
private final ObjectSerializer<V> projectedSerializer;
private final ThreadLocal<InternalRowSerializer> formatSerializer;
private final FunctionWithIOException<K, Long> fileSizeFunction;
private final BiFunction<K, Long, CloseableIterator<InternalRow>> reader;
private final BiFunctionWithIOE<K, Long, CloseableIterator<InternalRow>> reader;

public ObjectsCache(
SegmentsCache<K> cache,
ObjectSerializer<V> projectedSerializer,
RowType formatSchema,
FunctionWithIOException<K, Long> fileSizeFunction,
BiFunction<K, Long, CloseableIterator<InternalRow>> reader) {
BiFunctionWithIOE<K, Long, CloseableIterator<InternalRow>> reader) {
this.cache = cache;
this.projectedSerializer = projectedSerializer;
this.formatSerializer =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,13 +165,10 @@ public String writeWithoutRolling(Iterator<T> records) {
}
}

private CloseableIterator<InternalRow> createIterator(Path file, @Nullable Long fileSize) {
try {
return FileUtils.createFormatReader(fileIO, readerFactory, file, fileSize)
.toCloseableIterator();
} catch (IOException e) {
throw new RuntimeException(e);
}
private CloseableIterator<InternalRow> createIterator(Path file, @Nullable Long fileSize)
throws IOException {
return FileUtils.createFormatReader(fileIO, readerFactory, file, fileSize)
.toCloseableIterator();
}

private long fileSize(Path file) throws IOException {
Expand Down

0 comments on commit 926c4ee

Please sign in to comment.