Class SeparatedStoreBufferService
java.lang.Object
com.linkedin.venice.service.AbstractVeniceService
com.linkedin.davinci.kafka.consumer.AbstractStoreBufferService
com.linkedin.davinci.kafka.consumer.SeparatedStoreBufferService
- All Implemented Interfaces:
Closeable
,AutoCloseable
This store buffer services maintains two separate drainer queues for store ingestions.
For the sorted messages, Venice SN could use SSTFileWriter to ingest into RocksDB, and the performance is constant and stable.
But for the unsorted messages, RocksDB behavior is not constant because of RocksDB compaction and sometimes write compute.
Since there are very different characteristics, it will be helpful to decouple these two types of ingestions to avoid one blocking the other.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.linkedin.venice.service.AbstractVeniceService
AbstractVeniceService.ServiceState
-
Field Summary
Modifier and TypeFieldDescriptionprotected final StoreBufferService
protected final StoreBufferService
Fields inherited from class com.linkedin.venice.service.AbstractVeniceService
logger, serviceState
-
Method Summary
Modifier and TypeMethodDescriptionvoid
drainBufferedRecordsFromTopicPartition
(PubSubTopicPartition topicPartition) This method will wait for all the messages to be processed (persisted to disk) that are already queued up to drainer till now.execSyncOffsetCommandAsync
(PubSubTopicPartition topicPartition, StoreIngestionTask ingestionTask) long
long
long
long
void
putConsumerRecord
(PubSubMessage<KafkaKey, KafkaMessageEnvelope, Long> consumerRecord, StoreIngestionTask ingestionTask, LeaderProducedRecordContext leaderProducedRecordContext, int partition, String kafkaUrl, long beforeProcessingRecordTimestampNs) boolean
void
-
Field Details
-
sortedStoreBufferServiceDelegate
-
unsortedStoreBufferServiceDelegate
-
-
Method Details
-
putConsumerRecord
public void putConsumerRecord(PubSubMessage<KafkaKey, KafkaMessageEnvelope, throws InterruptedExceptionLong> consumerRecord, StoreIngestionTask ingestionTask, LeaderProducedRecordContext leaderProducedRecordContext, int partition, String kafkaUrl, long beforeProcessingRecordTimestampNs) - Specified by:
putConsumerRecord
in classAbstractStoreBufferService
- Throws:
InterruptedException
-
drainBufferedRecordsFromTopicPartition
public void drainBufferedRecordsFromTopicPartition(PubSubTopicPartition topicPartition) throws InterruptedException Description copied from class:AbstractStoreBufferService
This method will wait for all the messages to be processed (persisted to disk) that are already queued up to drainer till now.- Specified by:
drainBufferedRecordsFromTopicPartition
in classAbstractStoreBufferService
- Throws:
InterruptedException
-
execSyncOffsetCommandAsync
public CompletableFuture<Void> execSyncOffsetCommandAsync(PubSubTopicPartition topicPartition, StoreIngestionTask ingestionTask) throws InterruptedException - Specified by:
execSyncOffsetCommandAsync
in classAbstractStoreBufferService
- Throws:
InterruptedException
-
startInner
- Specified by:
startInner
in classAbstractVeniceService
- Returns:
- true if the service is completely started,
false if it is still starting asynchronously (in this case, it is the implementer's
responsibility to set
AbstractVeniceService.serviceState
toAbstractVeniceService.ServiceState.STARTED
upon completion of the async work). - Throws:
Exception
-
stopInner
- Specified by:
stopInner
in classAbstractVeniceService
- Throws:
Exception
-
getTotalMemoryUsage
public long getTotalMemoryUsage()- Specified by:
getTotalMemoryUsage
in classAbstractStoreBufferService
-
getTotalRemainingMemory
public long getTotalRemainingMemory()- Specified by:
getTotalRemainingMemory
in classAbstractStoreBufferService
-
getMaxMemoryUsagePerDrainer
public long getMaxMemoryUsagePerDrainer()- Specified by:
getMaxMemoryUsagePerDrainer
in classAbstractStoreBufferService
-
getMinMemoryUsagePerDrainer
public long getMinMemoryUsagePerDrainer()- Specified by:
getMinMemoryUsagePerDrainer
in classAbstractStoreBufferService
-