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:
java.io.Closeable,java.lang.AutoCloseable
public class SeparatedStoreBufferService extends AbstractStoreBufferService
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
Fields Modifier and Type Field Description protected StoreBufferServicesortedStoreBufferServiceDelegateprotected StoreBufferServiceunsortedStoreBufferServiceDelegate-
Fields inherited from class com.linkedin.venice.service.AbstractVeniceService
logger, serviceState
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddrainBufferedRecordsFromTopicPartition(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.java.util.concurrent.CompletableFuture<java.lang.Void>execSyncOffsetCommandAsync(PubSubTopicPartition topicPartition, StoreIngestionTask ingestionTask)longgetMaxMemoryUsagePerDrainer()longgetMinMemoryUsagePerDrainer()longgetTotalMemoryUsage()longgetTotalRemainingMemory()voidputConsumerRecord(PubSubMessage<KafkaKey,KafkaMessageEnvelope,java.lang.Long> consumerRecord, StoreIngestionTask ingestionTask, LeaderProducedRecordContext leaderProducedRecordContext, int partition, java.lang.String kafkaUrl, long beforeProcessingRecordTimestampNs)booleanstartInner()voidstopInner()
-
-
-
Field Detail
-
sortedStoreBufferServiceDelegate
protected final StoreBufferService sortedStoreBufferServiceDelegate
-
unsortedStoreBufferServiceDelegate
protected final StoreBufferService unsortedStoreBufferServiceDelegate
-
-
Method Detail
-
putConsumerRecord
public void putConsumerRecord(PubSubMessage<KafkaKey,KafkaMessageEnvelope,java.lang.Long> consumerRecord, StoreIngestionTask ingestionTask, LeaderProducedRecordContext leaderProducedRecordContext, int partition, java.lang.String kafkaUrl, long beforeProcessingRecordTimestampNs) throws java.lang.InterruptedException
- Specified by:
putConsumerRecordin classAbstractStoreBufferService- Throws:
java.lang.InterruptedException
-
drainBufferedRecordsFromTopicPartition
public void drainBufferedRecordsFromTopicPartition(PubSubTopicPartition topicPartition) throws java.lang.InterruptedException
Description copied from class:AbstractStoreBufferServiceThis method will wait for all the messages to be processed (persisted to disk) that are already queued up to drainer till now.- Specified by:
drainBufferedRecordsFromTopicPartitionin classAbstractStoreBufferService- Throws:
java.lang.InterruptedException
-
execSyncOffsetCommandAsync
public java.util.concurrent.CompletableFuture<java.lang.Void> execSyncOffsetCommandAsync(PubSubTopicPartition topicPartition, StoreIngestionTask ingestionTask) throws java.lang.InterruptedException
- Specified by:
execSyncOffsetCommandAsyncin classAbstractStoreBufferService- Throws:
java.lang.InterruptedException
-
startInner
public boolean startInner() throws java.lang.Exception- Specified by:
startInnerin 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.serviceStatetoAbstractVeniceService.ServiceState.STARTEDupon completion of the async work). - Throws:
java.lang.Exception
-
stopInner
public void stopInner() throws java.lang.Exception- Specified by:
stopInnerin classAbstractVeniceService- Throws:
java.lang.Exception
-
getTotalMemoryUsage
public long getTotalMemoryUsage()
- Specified by:
getTotalMemoryUsagein classAbstractStoreBufferService
-
getTotalRemainingMemory
public long getTotalRemainingMemory()
- Specified by:
getTotalRemainingMemoryin classAbstractStoreBufferService
-
getMaxMemoryUsagePerDrainer
public long getMaxMemoryUsagePerDrainer()
- Specified by:
getMaxMemoryUsagePerDrainerin classAbstractStoreBufferService
-
getMinMemoryUsagePerDrainer
public long getMinMemoryUsagePerDrainer()
- Specified by:
getMinMemoryUsagePerDrainerin classAbstractStoreBufferService
-
-