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 StoreBufferService
sortedStoreBufferServiceDelegate
protected StoreBufferService
unsortedStoreBufferServiceDelegate
-
Fields inherited from class com.linkedin.venice.service.AbstractVeniceService
logger, serviceState
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
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.java.util.concurrent.CompletableFuture<java.lang.Void>
execSyncOffsetCommandAsync(PubSubTopicPartition topicPartition, StoreIngestionTask ingestionTask)
long
getMaxMemoryUsagePerDrainer()
long
getMinMemoryUsagePerDrainer()
long
getTotalMemoryUsage()
long
getTotalRemainingMemory()
void
putConsumerRecord(PubSubMessage<KafkaKey,KafkaMessageEnvelope,java.lang.Long> consumerRecord, StoreIngestionTask ingestionTask, LeaderProducedRecordContext leaderProducedRecordContext, int partition, java.lang.String kafkaUrl, long beforeProcessingRecordTimestampNs)
boolean
startInner()
void
stopInner()
-
-
-
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:
putConsumerRecord
in classAbstractStoreBufferService
- Throws:
java.lang.InterruptedException
-
drainBufferedRecordsFromTopicPartition
public void drainBufferedRecordsFromTopicPartition(PubSubTopicPartition topicPartition) throws java.lang.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:
java.lang.InterruptedException
-
execSyncOffsetCommandAsync
public java.util.concurrent.CompletableFuture<java.lang.Void> execSyncOffsetCommandAsync(PubSubTopicPartition topicPartition, StoreIngestionTask ingestionTask) throws java.lang.InterruptedException
- Specified by:
execSyncOffsetCommandAsync
in classAbstractStoreBufferService
- Throws:
java.lang.InterruptedException
-
startInner
public boolean startInner() throws java.lang.Exception
- 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:
java.lang.Exception
-
stopInner
public void stopInner() throws java.lang.Exception
- Specified by:
stopInner
in classAbstractVeniceService
- Throws:
java.lang.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
-
-