jsancio commented on a change in pull request #10344:
URL: https://github.com/apache/kafka/pull/10344#discussion_r596467199



##########
File path: core/src/main/scala/kafka/raft/KafkaMetadataLog.scala
##########
@@ -37,8 +37,9 @@ final class KafkaMetadataLog private (
   log: Log,
   scheduler: Scheduler,
   // This object needs to be thread-safe because it is used by the 
snapshotting thread to notify the
-  // polling thread when snapshots are created.
-  snapshotIds: ConcurrentSkipListSet[OffsetAndEpoch],
+  // polling thread when snapshots are created. Using a Map instead of a Set 
so that there is no
+  // need to handle NoSuchElementException.
+  snapshotIds: ConcurrentSkipListMap[OffsetAndEpoch, Unit],

Review comment:
       We can probably use iterator and reverse-iterator but iterators require 
`hasNext` follow by `next`. I didn't want to think/research the concurrency and 
consistency implications.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to