Class IngestionBatchProcessor
- java.lang.Object
-
- com.linkedin.davinci.kafka.consumer.IngestionBatchProcessor
-
public class IngestionBatchProcessor extends java.lang.Object
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, withIngestionBatchProcessor
, we hope we can utilize the full node's resources to speed up the leader ingestion.
-
-
Constructor Summary
Constructors Constructor Description IngestionBatchProcessor(java.lang.String storeVersionName, java.util.concurrent.ExecutorService batchProcessingThreadPool, KeyLevelLocksManager lockManager, com.linkedin.davinci.kafka.consumer.IngestionBatchProcessor.ProcessingFunction processingFunction, boolean isWriteComputationEnabled, boolean isActiveActiveReplicationEnabled, AggVersionedIngestionStats aggVersionedIngestionStats, HostLevelIngestionStats hostLevelIngestionStats)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static boolean
isAllMessagesFromRTTopic(java.lang.Iterable<PubSubMessage<KafkaKey,KafkaMessageEnvelope,java.lang.Long>> records)
java.util.NavigableMap<ByteArrayKey,java.util.concurrent.locks.ReentrantLock>
lockKeys(java.util.List<PubSubMessage<KafkaKey,KafkaMessageEnvelope,java.lang.Long>> records)
WhenlockManager
is not null, this function will try to lock all the keys (except Control Messages) passed by the params.java.util.List<PubSubMessageProcessedResultWrapper<KafkaKey,KafkaMessageEnvelope,java.lang.Long>>
process(java.util.List<PubSubMessage<KafkaKey,KafkaMessageEnvelope,java.lang.Long>> records, PartitionConsumptionState partitionConsumptionState, int partition, java.lang.String kafkaUrl, int kafkaClusterId, long beforeProcessingRecordTimestampNs, long beforeProcessingBatchRecordsTimestampMs)
void
unlockKeys(java.util.NavigableMap<ByteArrayKey,java.util.concurrent.locks.ReentrantLock> keyLockMap)
-
-
-
Constructor Detail
-
IngestionBatchProcessor
public IngestionBatchProcessor(java.lang.String storeVersionName, java.util.concurrent.ExecutorService batchProcessingThreadPool, KeyLevelLocksManager lockManager, com.linkedin.davinci.kafka.consumer.IngestionBatchProcessor.ProcessingFunction processingFunction, boolean isWriteComputationEnabled, boolean isActiveActiveReplicationEnabled, AggVersionedIngestionStats aggVersionedIngestionStats, HostLevelIngestionStats hostLevelIngestionStats)
-
-
Method Detail
-
lockKeys
public java.util.NavigableMap<ByteArrayKey,java.util.concurrent.locks.ReentrantLock> lockKeys(java.util.List<PubSubMessage<KafkaKey,KafkaMessageEnvelope,java.lang.Long>> records)
WhenlockManager
is not null, this function will try to lock all the keys (except Control Messages) passed by the params.
-
unlockKeys
public void unlockKeys(java.util.NavigableMap<ByteArrayKey,java.util.concurrent.locks.ReentrantLock> keyLockMap)
-
isAllMessagesFromRTTopic
public static boolean isAllMessagesFromRTTopic(java.lang.Iterable<PubSubMessage<KafkaKey,KafkaMessageEnvelope,java.lang.Long>> records)
-
process
public java.util.List<PubSubMessageProcessedResultWrapper<KafkaKey,KafkaMessageEnvelope,java.lang.Long>> process(java.util.List<PubSubMessage<KafkaKey,KafkaMessageEnvelope,java.lang.Long>> records, PartitionConsumptionState partitionConsumptionState, int partition, java.lang.String kafkaUrl, int kafkaClusterId, long beforeProcessingRecordTimestampNs, long beforeProcessingBatchRecordsTimestampMs)
-
-