Class IngestionBatchProcessor
java.lang.Object
com.linkedin.davinci.kafka.consumer.IngestionBatchProcessor
This class is used to process the AA/WC messages in parallel to address the long-tail partition lagging issues.
For the AA/WC message handling, the consumption is not the bottleneck, but the processing overhead, and
even with a single consumer, with
IngestionBatchProcessor
, we hope we can utilize the full node's
resources to speed up the leader ingestion.-
Constructor Summary
ConstructorDescriptionIngestionBatchProcessor
(String storeVersionName, ExecutorService batchProcessingThreadPool, KeyLevelLocksManager lockManager, com.linkedin.davinci.kafka.consumer.IngestionBatchProcessor.ProcessingFunction processingFunction, boolean isWriteComputationEnabled, boolean isActiveActiveReplicationEnabled, AggVersionedIngestionStats aggVersionedIngestionStats, HostLevelIngestionStats hostLevelIngestionStats) -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
lockKeys
(List<PubSubMessage<KafkaKey, KafkaMessageEnvelope, Long>> records) WhenlockManager
is not null, this function will try to lock all the keys (except Control Messages) passed by the params.process
(List<PubSubMessage<KafkaKey, KafkaMessageEnvelope, Long>> records, PartitionConsumptionState partitionConsumptionState, int partition, String kafkaUrl, int kafkaClusterId, long beforeProcessingRecordTimestampNs, long beforeProcessingBatchRecordsTimestampMs) void
unlockKeys
(NavigableMap<ByteArrayKey, ReentrantLock> keyLockMap)
-
Constructor Details
-
IngestionBatchProcessor
public IngestionBatchProcessor(String storeVersionName, ExecutorService batchProcessingThreadPool, KeyLevelLocksManager lockManager, com.linkedin.davinci.kafka.consumer.IngestionBatchProcessor.ProcessingFunction processingFunction, boolean isWriteComputationEnabled, boolean isActiveActiveReplicationEnabled, AggVersionedIngestionStats aggVersionedIngestionStats, HostLevelIngestionStats hostLevelIngestionStats)
-
-
Method Details
-
lockKeys
public NavigableMap<ByteArrayKey,ReentrantLock> lockKeys(List<PubSubMessage<KafkaKey, KafkaMessageEnvelope, Long>> records) WhenlockManager
is not null, this function will try to lock all the keys (except Control Messages) passed by the params. -
isAllMessagesFromRTTopic
public static boolean isAllMessagesFromRTTopic(Iterable<PubSubMessage<KafkaKey, KafkaMessageEnvelope, Long>> records) -
process
public List<PubSubMessageProcessedResultWrapper<KafkaKey,KafkaMessageEnvelope, processLong>> (List<PubSubMessage<KafkaKey, KafkaMessageEnvelope, Long>> records, PartitionConsumptionState partitionConsumptionState, int partition, String kafkaUrl, int kafkaClusterId, long beforeProcessingRecordTimestampNs, long beforeProcessingBatchRecordsTimestampMs)
-