mcvsubbu commented on a change in pull request #5039: Close Kafka consumer before building
or downloading immutable segment
URL: https://github.com/apache/incubator-pinot/pull/5039#discussion_r377206123
##########
File path: pinot-core/src/main/java/org/apache/pinot/core/data/manager/realtime/LLRealtimeSegmentDataManager.java
##########
@@ -1097,15 +1135,24 @@ public LLRealtimeSegmentDataManager(RealtimeSegmentZKMetadata segmentZKMetadata,
.setInvertedIndexColumns(invertedIndexColumns).setRealtimeSegmentZKMetadata(segmentZKMetadata)
.setOffHeap(_isOffHeap).setMemoryManager(_memoryManager)
.setStatsHistory(realtimeTableDataManager.getStatsHistory())
- .setAggregateMetrics(indexingConfig.isAggregateMetrics())
- .setNullHandlingEnabled(_nullHandlingEnabled);
+ .setAggregateMetrics(indexingConfig.isAggregateMetrics()).setNullHandlingEnabled(_nullHandlingEnabled);
// Create message decoder
_messageDecoder = StreamDecoderProvider.create(_partitionLevelStreamConfig, _schema);
_clientId = _streamTopic + "-" + _streamPartitionId;
// Create record transformer
_recordTransformer = CompositeTransformer.getDefaultTransformer(schema);
+
+ // Acquire semaphore to create Kafka consumers
+ try {
+ _partitionConsumerSemaphore.acquire();
+ _acquiredConsumerSemaphore.set(true);
+ } catch (InterruptedException e) {
+ String errorMsg = "InterruptedException when acquiring semaphore for Segment: " + _segmentNameStr;
+ segmentLogger.error(errorMsg);
Review comment:
nit: segmentLogger already has segment name
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
|