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
FieldsModifier and TypeFieldDescriptionprotected final StoreBufferServiceprotected final StoreBufferServiceFields inherited from class com.linkedin.venice.service.AbstractVeniceService
logger, serviceState -
Method Summary
Modifier and TypeMethodDescriptionvoiddrainBufferedRecordsFromTopicPartition(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) voidexecSyncOffsetFromSnapshotAsync(PubSubTopicPartition topicPartition, PartitionTracker vtDivSnapshot, StoreIngestionTask ingestionTask) longlonglonglongvoidputConsumerRecord(DefaultPubSubMessage consumerRecord, StoreIngestionTask ingestionTask, LeaderProducedRecordContext leaderProducedRecordContext, int partition, String kafkaUrl, long beforeProcessingRecordTimestampNs) booleanvoid
-
Field Details
-
sortedStoreBufferServiceDelegate
-
unsortedStoreBufferServiceDelegate
-
-
Method Details
-
putConsumerRecord
public void putConsumerRecord(DefaultPubSubMessage consumerRecord, StoreIngestionTask ingestionTask, LeaderProducedRecordContext leaderProducedRecordContext, int partition, String kafkaUrl, long beforeProcessingRecordTimestampNs) throws InterruptedException - Specified by:
putConsumerRecordin classAbstractStoreBufferService- Throws:
InterruptedException
-
drainBufferedRecordsFromTopicPartition
public void drainBufferedRecordsFromTopicPartition(PubSubTopicPartition topicPartition) throws 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:
InterruptedException
-
execSyncOffsetCommandAsync
public CompletableFuture<Void> execSyncOffsetCommandAsync(PubSubTopicPartition topicPartition, StoreIngestionTask ingestionTask) throws InterruptedException - Specified by:
execSyncOffsetCommandAsyncin classAbstractStoreBufferService- Throws:
InterruptedException
-
execSyncOffsetFromSnapshotAsync
public void execSyncOffsetFromSnapshotAsync(PubSubTopicPartition topicPartition, PartitionTracker vtDivSnapshot, StoreIngestionTask ingestionTask) throws InterruptedException - Specified by:
execSyncOffsetFromSnapshotAsyncin classAbstractStoreBufferService- Throws:
InterruptedException
-
startInner
- 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:
Exception
-
stopInner
- Specified by:
stopInnerin classAbstractVeniceService- Throws:
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
-