Class StoreAwarePartitionWiseKafkaConsumerService
- java.lang.Object
-
- com.linkedin.venice.service.AbstractVeniceService
-
- com.linkedin.davinci.kafka.consumer.AbstractKafkaConsumerService
-
- com.linkedin.davinci.kafka.consumer.KafkaConsumerService
-
- com.linkedin.davinci.kafka.consumer.PartitionWiseKafkaConsumerService
-
- com.linkedin.davinci.kafka.consumer.StoreAwarePartitionWiseKafkaConsumerService
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
public class StoreAwarePartitionWiseKafkaConsumerService extends PartitionWiseKafkaConsumerService
StoreAwarePartitionWiseKafkaConsumerService
is used to allocate share consumer from consumer pool at partition granularity. One shared consumer may have multiple topics, and each topic may have multiple consumers. This is store-aware version of topic-wise shared consumer service. The topic partition assignment in this service has a heuristic that we should distribute the all the subscriptions related to a same store / version as even as possible. The load calculation for each consumer will be: Consumer assignment size + IMPOSSIBLE_MAX_PARTITION_COUNT_PER_CONSUMER * subscription count for the same store; and we will pick the least loaded consumer for a new topic partition request. If there is no eligible consumer, it will throwIllegalStateException
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.linkedin.davinci.kafka.consumer.KafkaConsumerService
KafkaConsumerService.ConsumerAssignmentStrategy
-
Nested classes/interfaces inherited from class com.linkedin.venice.service.AbstractVeniceService
AbstractVeniceService.ServiceState
-
-
Field Summary
-
Fields inherited from class com.linkedin.davinci.kafka.consumer.PartitionWiseKafkaConsumerService
rtTopicPartitionToConsumerMap
-
Fields inherited from class com.linkedin.davinci.kafka.consumer.KafkaConsumerService
aggStats, consumerToConsumptionTask, consumerToLocks, kafkaUrl, kafkaUrlForLogger, poolType, versionTopicToTopicPartitionToConsumer
-
Fields inherited from class com.linkedin.venice.service.AbstractVeniceService
logger, serviceState
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected com.linkedin.davinci.kafka.consumer.SharedKafkaConsumer
pickConsumerForPartition(PubSubTopic versionTopic, PubSubTopicPartition topicPartition)
-
Methods inherited from class com.linkedin.davinci.kafka.consumer.PartitionWiseKafkaConsumerService
alreadySubscribedRealtimeTopicPartition
-
Methods inherited from class com.linkedin.davinci.kafka.consumer.KafkaConsumerService
assignConsumerFor, batchUnsubscribe, getConsumerAssignedToVersionTopicPartition, getIngestionInfoFromConsumer, getLatestOffsetBasedOnMetrics, getMaxElapsedTimeMSSinceLastPollInConsumerPool, getOffsetLagBasedOnMetrics, hasAnySubscriptionFor, removeTopicPartitionFromConsumptionTask, setThreadFactory, startConsumptionIntoDataReceiver, startInner, stopInner, unSubscribe, unsubscribeAll
-
Methods inherited from class com.linkedin.davinci.kafka.consumer.AbstractKafkaConsumerService
unSubscribe
-
-
-
-
Method Detail
-
pickConsumerForPartition
protected com.linkedin.davinci.kafka.consumer.SharedKafkaConsumer pickConsumerForPartition(PubSubTopic versionTopic, PubSubTopicPartition topicPartition)
- Overrides:
pickConsumerForPartition
in classPartitionWiseKafkaConsumerService
-
-