nicktelford commented on code in PR #17713:
URL: https://github.com/apache/kafka/pull/17713#discussion_r1836444020
##########
streams/src/main/java/org/apache/kafka/streams/state/internals/MeteredKeyValueStore.java:
##########
@@ -154,7 +155,13 @@ private void registerMetrics() {
StateStoreMetrics.addNumOpenIteratorsGauge(taskId.toString(),
metricsScope, name(), streamsMetrics,
(config, now) -> numOpenIterators.sum());
StateStoreMetrics.addOldestOpenIteratorGauge(taskId.toString(),
metricsScope, name(), streamsMetrics,
- (config, now) -> openIterators.isEmpty() ? null :
openIterators.first().startTimestamp()
+ (config, now) -> {
+ try {
+ return openIterators.isEmpty() ? null :
openIterators.first().startTimestamp();
Review Comment:
> Maybe you can just write your own version of ConcurrentSkipListSet for
these iterators, that wraps the ConcurrentSkipListMap while the providing the
needed APIs, and hides all the dummy value stuff so it doesn't get too messy in
the code itself?
Unfortunately, the internals of `ConcurrentSkipListSet` are `private`, so
our own version would need to be a complete copy of the JDK implementation.
This is probably not a good idea, as upgrading JDK would not benefit from any
improvements in the JDK implementation.
It's not really possible to implement only a subset of the functionality,
because we'd still want to implement the same interfaces (namely,
`NavigableSet` and `Set`.
--
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]