Nikita-Shupletsov commented on code in PR #20512:
URL: https://github.com/apache/kafka/pull/20512#discussion_r2334607715
##########
streams/src/main/java/org/apache/kafka/streams/internals/metrics/OpenIterators.java:
##########
@@ -51,7 +52,10 @@ public void add(final MeteredIterator iterator) {
if (openIterators.size() == 1) {
metricName =
StateStoreMetrics.addOldestOpenIteratorGauge(taskId.toString(), metricsScope,
name, streamsMetrics,
- (config, now) -> openIterators.first().startTimestamp()
+ (config, now) -> {
+ final Iterator<MeteredIterator> openIteratorsIterator =
openIterators.iterator();
+ return openIteratorsIterator.hasNext() ?
openIteratorsIterator.next().startTimestamp() : null;
Review Comment:
good suggestion. I've updated the PR. please let me know if the changes make
sense to 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]