From commits-return-16133-archive-asf-public=cust-asf.ponee.io@pinot.apache.org Mon Feb 10 17:39:43 2020 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id D4ED818066C for ; Mon, 10 Feb 2020 18:39:42 +0100 (CET) Received: (qmail 43025 invoked by uid 500); 10 Feb 2020 17:39:42 -0000 Mailing-List: contact commits-help@pinot.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@pinot.apache.org Delivered-To: mailing list commits@pinot.apache.org Received: (qmail 42941 invoked by uid 99); 10 Feb 2020 17:39:42 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Feb 2020 17:39:42 +0000 From: GitBox To: commits@pinot.apache.org Subject: [GitHub] [incubator-pinot] mcvsubbu commented on a change in pull request #5039: Close Kafka consumer before building or downloading immutable segment Message-ID: <158135638209.10022.6491477502305503328.gitbox@gitbox.apache.org> References: In-Reply-To: Date: Mon, 10 Feb 2020 17:39:42 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit 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