Class PartitionWiseKafkaConsumerService
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
- All Implemented Interfaces:
Closeable
,AutoCloseable
- Direct Known Subclasses:
StoreAwarePartitionWiseKafkaConsumerService
PartitionWiseKafkaConsumerService
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.
For this basic implementation, we rely on round-robin to allocate next consumer from pool to achieve efficient
and balanced shared consumer partition assignment load. We can improve this allocation strategy if we need to.-
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
Modifier and TypeFieldDescriptionprotected final Map<PubSubTopicPartition,
Set<PubSubConsumerAdapter>> Mapping from real-time topic partition to consumers.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
Modifier and TypeMethodDescriptionprotected boolean
alreadySubscribedRealtimeTopicPartition
(com.linkedin.davinci.kafka.consumer.SharedKafkaConsumer consumer, PubSubTopicPartition topicPartition) protected com.linkedin.davinci.kafka.consumer.SharedKafkaConsumer
pickConsumerForPartition
(PubSubTopic versionTopic, PubSubTopicPartition topicPartition) Methods inherited from class com.linkedin.davinci.kafka.consumer.KafkaConsumerService
assignConsumerFor, batchUnsubscribe, getConsumerAssignedToVersionTopicPartition, getIngestionInfoFor, getLatestOffsetBasedOnMetrics, getMaxElapsedTimeMSSinceLastPollInConsumerPool, getOffsetLagBasedOnMetrics, hasAnySubscriptionFor, removeTopicPartitionFromConsumptionTask, setThreadFactory, startConsumptionIntoDataReceiver, startInner, stopInner, unSubscribe, unsubscribeAll
Methods inherited from class com.linkedin.davinci.kafka.consumer.AbstractKafkaConsumerService
unSubscribe
-
Field Details
-
rtTopicPartitionToConsumerMap
Mapping from real-time topic partition to consumers. For hybrid store, different version topics from one store have same real-time topics, we should avoid same real-time topic partition from different version topics sharing the same consumer from consumer pool.
-
-
Method Details
-
pickConsumerForPartition
protected com.linkedin.davinci.kafka.consumer.SharedKafkaConsumer pickConsumerForPartition(PubSubTopic versionTopic, PubSubTopicPartition topicPartition) - Specified by:
pickConsumerForPartition
in classKafkaConsumerService
-