kinolaev commented on code in PR #15713:
URL: https://github.com/apache/iceberg/pull/15713#discussion_r3783255054
##########
core/src/test/java/org/apache/iceberg/TestDeleteFiles.java:
##########
@@ -738,7 +744,120 @@ public void
removingDataFilesWhenTruncatingAlsoRemovesDVs() {
statuses(Status.DELETED, Status.DELETED));
}
+ @TestTemplate
+ public void testFilterManifestsWithLimitedIOPool() {
+ TrackingFileIO io = new TrackingFileIO(FILE_IO);
+ TestTables.TestTableOperations ops =
+ new TestTables.TestTableOperations("limited-test", tableDir, io);
+ Table testTable =
+ TestTables.create(
+ tableDir, "limited-test", SCHEMA, SPEC, SortOrder.unsorted(),
formatVersion, ops);
+ commit(testTable, testTable.newFastAppend().appendFile(FILE_A), branch);
+ Snapshot deleteSnap = commit(testTable,
testTable.newDelete().deleteFile(FILE_A), branch);
+
assertThat(deleteSnap.summary()).containsEntry(SnapshotSummary.DELETED_FILES_PROP,
"1");
+ assertThat(io.peakCount()).isEqualTo(1);
+ }
+
private static ByteBuffer longToBuffer(long value) {
return ByteBuffer.allocate(8).order(ByteOrder.LITTLE_ENDIAN).putLong(0,
value);
}
+
+ /** A {@link FileIO} that tracks input streams. */
+ private static class TrackingFileIO implements FileIO {
Review Comment:
I think this is how I should have implemented it in the first place! I
checked, the updated test catches the problem. Thank you!
--
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]