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



##########
File path: 
pinot-core/src/test/java/org/apache/pinot/core/data/manager/realtime/LLRealtimeSegmentDataManagerTest.java
##########
@@ -765,6 +768,20 @@ public void 
testOnlyOneSegmentHoldingTheSemaphoreForParticularPartition()
     
Assert.assertEquals(secondSegmentDataManager.get().getPartitionGroupConsumerSemaphore().availablePermits(),
 1);
   }
 
+  @Test
+  public void testDifferentSegmentBuildTimeLeaseExtenderDestroyedForTables()

Review comment:
       What's the meaning of this test name? What/How to destroy? Can you add 
some comments to the test?

##########
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);
 
   private ScheduledExecutorService _executor;
   private final Map<String, Future> _segmentToFutureMap = new 
ConcurrentHashMap<>();
   private final String _instanceId;
   private final ServerSegmentCompletionProtocolHandler _protocolHandler;
 
-  public static SegmentBuildTimeLeaseExtender getLeaseExtender(final String 
instanceId) {
-    return INSTANCE_TO_LEASE_EXTENDER.get(instanceId);
+  public static SegmentBuildTimeLeaseExtender getLeaseExtender(final String 
tableNameWithType) {
+    return TABLE_TO_LEASE_EXTENDER.get(tableNameWithType);
   }
 
   public static synchronized SegmentBuildTimeLeaseExtender create(final String 
instanceId,
       ServerMetrics serverMetrics, String tableNameWithType) {
-    SegmentBuildTimeLeaseExtender leaseExtender = 
INSTANCE_TO_LEASE_EXTENDER.get(instanceId);
+    SegmentBuildTimeLeaseExtender leaseExtender = 
TABLE_TO_LEASE_EXTENDER.get(tableNameWithType);
     if (leaseExtender != null) {
-      LOGGER.warn("Instance already exists");
+      LOGGER.warn("Lease extender for {} already exists", tableNameWithType);

Review comment:
       `Lease extender for Table:  {} already exists`.




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