C0urante commented on code in PR #12281:
URL: https://github.com/apache/kafka/pull/12281#discussion_r921456034


##########
streams/src/main/java/org/apache/kafka/streams/state/internals/metrics/RocksDBMetricsRecordingTrigger.java:
##########
@@ -32,12 +32,12 @@ public RocksDBMetricsRecordingTrigger(final Time time) {
 
     public void addMetricsRecorder(final RocksDBMetricsRecorder 
metricsRecorder) {
         final String metricsRecorderName = 
metricsRecorderName(metricsRecorder);
-        if (metricsRecordersToTrigger.containsKey(metricsRecorderName)) {
+        final RocksDBMetricsRecorder existingRocksDBMetricsRecorder = 
metricsRecordersToTrigger.putIfAbsent(metricsRecorderName, metricsRecorder);

Review Comment:
   This is a nice improvement in readability, but are we certain it's 
necessary? I commented on the change to the plugin scanning logic in Connect 
because I'm familiar with that part of the code base; I don't have the same 
familiarity with Streams, though.
   
   I think it's fine to merge this change, but if this method isn't intended to 
be invoked concurrently, we should modify the PR title so that the commit 
message doesn't imply this is a bug fix and instead recognizes it as a cosmetic 
improvement.



-- 
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: jira-unsubscr...@kafka.apache.org

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

Reply via email to