nastra commented on code in PR #15713:
URL: https://github.com/apache/iceberg/pull/15713#discussion_r3527609057
##########
core/src/test/java/org/apache/iceberg/TestTables.java:
##########
@@ -408,4 +411,106 @@ public void deleteFiles(Iterable<String> pathsToDelete)
throws BulkDeletionFailu
throw new RuntimeException("Expected to mock this function");
}
}
+
+ /** A {@link FileIO} that enforces a limit on concurrent open input streams.
*/
+ public static class TrackingFileIO implements FileIO {
+
+ private final FileIO delegate;
+ private final AtomicInteger count = new AtomicInteger(0);
+ private final AtomicInteger peakCount = new AtomicInteger(0);
+
+ TrackingFileIO(FileIO delegate) {
+ this.delegate = delegate;
+ }
+
+ @Override
+ public InputFile newInputFile(String path) {
+ return new TrackingInputFile(delegate.newInputFile(path), count,
peakCount);
+ }
+
+ @Override
+ public OutputFile newOutputFile(String path) {
+ return delegate.newOutputFile(path);
+ }
+
+ @Override
+ public void deleteFile(String path) {
+ delegate.deleteFile(path);
+ }
+
+ public int getPeakCount() {
Review Comment:
```suggestion
public int peakCount() {
```
--
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]