lhotari commented on code in PR #17465:
URL: https://github.com/apache/pulsar/pull/17465#discussion_r962877620
##########
pulsar-common/src/main/java/org/apache/pulsar/common/util/collections/ConcurrentOpenLongPairRangeSet.java:
##########
@@ -242,6 +242,27 @@ public Range<T> lastRange() {
return Range.openClosed(consumer.apply(lastSet.getKey(), lower),
consumer.apply(lastSet.getKey(), upper));
}
+ @Override
+ public int cardinality(long lowerKey, long lowerValue, long upperKey, long
upperValue) {
+ NavigableMap<Long, BitSet> subMap = rangeBitSetMap.subMap(lowerKey,
true, upperKey, true);
+ MutableInt v = new MutableInt(0);
+ subMap.forEach((ledgerId, bitset) -> {
Review Comment:
Since the class `ConcurrentOpenLongPairRangeSet` isn't specific to ledgers,
would it make sense to avoid using `ledgerId` as the variable name?
--
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]