pvary commented on code in PR #18027:
URL: https://github.com/apache/iceberg/pull/18027#discussion_r4003098110
##########
core/src/main/java/org/apache/iceberg/deletes/RoaringPositionBitmap.java:
##########
@@ -192,6 +193,38 @@ public void forEach(LongConsumer consumer) {
}
}
+ /**
+ * Iterates over the positions set within the given range, in ascending
order.
+ *
+ * <p>The range is resolved to at most two underlying 32-bit bitmaps, each
of which is traversed
+ * once. This avoids the per-position key extraction, bounds check and
container lookup that
+ * {@link #contains(long)} performs on every call.
+ *
+ * @param posStart the first position in the range, inclusive
+ * @param length the number of positions in the range
+ * @param consumer a consumer for the positions that are set within the range
+ */
+ public void forEachInRange(long posStart, int length, LongConsumer consumer)
{
+ if (length <= 0) {
+ return;
+ }
Review Comment:
Shall we throw instead?
--
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]