RussellSpitzer commented on code in PR #4588:
URL: https://github.com/apache/iceberg/pull/4588#discussion_r888047897
##########
core/src/main/java/org/apache/iceberg/deletes/Deletes.java:
##########
@@ -84,27 +89,46 @@ public static StructLikeSet
toEqualitySet(CloseableIterable<StructLike> eqDelete
}
public static <T extends StructLike> PositionDeleteIndex
toPositionIndex(CharSequence dataLocation,
-
List<CloseableIterable<T>> deleteFiles) {
+
List<CloseableIterable<T>> deleteFiles,
+
DeleteCounter counter) {
DataFileFilter<T> locationFilter = new DataFileFilter<>(dataLocation);
List<CloseableIterable<Long>> positions = Lists.transform(deleteFiles,
deletes ->
CloseableIterable.transform(locationFilter.filter(deletes), row ->
(Long) POSITION_ACCESSOR.get(row)));
- return toPositionIndex(CloseableIterable.concat(positions));
+ return toPositionIndex(CloseableIterable.concat(positions), counter);
}
- public static PositionDeleteIndex toPositionIndex(CloseableIterable<Long>
posDeletes) {
+ public static PositionDeleteIndex toPositionIndex(CloseableIterable<Long>
posDeletes, DeleteCounter counter) {
try (CloseableIterable<Long> deletes = posDeletes) {
PositionDeleteIndex positionDeleteIndex = new
BitmapPositionDeleteIndex();
deletes.forEach(positionDeleteIndex::delete);
+ counter.increment(((BitmapPositionDeleteIndex)
positionDeleteIndex).numberOfPositionsDeleted());
return positionDeleteIndex;
} catch (IOException e) {
throw new UncheckedIOException("Failed to close position delete source",
e);
}
}
+ public static <T extends StructLike> PositionDeleteIndex
toPositionIndex(CharSequence dataLocation,
Review Comment:
Dow we need these polymorphisms? Or is this just to keep apis?
--
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]