jtao15 commented on a change in pull request #6682:
URL: https://github.com/apache/incubator-pinot/pull/6682#discussion_r594810131



##########
File path: 
pinot-core/src/main/java/org/apache/pinot/core/data/manager/realtime/SegmentBuildTimeLeaseExtender.java
##########
@@ -46,25 +46,25 @@
   // Retransmit lease request 10% before lease expires.
   private static final int REPEAT_REQUEST_PERIOD_SEC = (EXTRA_TIME_SECONDS * 9 
/ 10);
   private static Logger LOGGER = 
LoggerFactory.getLogger(SegmentBuildTimeLeaseExtender.class);
-  private static final Map<String, SegmentBuildTimeLeaseExtender> 
INSTANCE_TO_LEASE_EXTENDER = new HashMap<>(1);
+  private static final Map<String, SegmentBuildTimeLeaseExtender> 
TABLE_TO_LEASE_EXTENDER = new HashMap<>(1);

Review comment:
       Use `ConcurrentHashMap` and remove `synchronized` for `create()` may 
potential to create multiple lease extender since `create()` is not atomic. I 
think maybe it's better to keep the `HashMap` and add `synchronized` to the 
`getLeaseExtender()` also.




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



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

Reply via email to