sashidhar commented on a change in pull request #7764: #7316 Use 
Map.putIfAbsent() instead of containsKey() + put()
URL: https://github.com/apache/incubator-druid/pull/7764#discussion_r288209118
 
 

 ##########
 File path: 
indexing-hadoop/src/main/java/org/apache/druid/indexer/DetermineHashedPartitionsJob.java
 ##########
 @@ -307,9 +307,7 @@ protected void innerMap(
                          .getSegmentGranularity()
                          
.bucket(DateTimes.utc(inputRow.getTimestampFromEpoch()));
 
-        if (!hyperLogLogs.containsKey(interval)) {
-          hyperLogLogs.put(interval, 
HyperLogLogCollector.makeLatestCollector());
-        }
+        hyperLogLogs.putIfAbsent(interval, 
HyperLogLogCollector.makeLatestCollector());
 
 Review comment:
   Done.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to