Class MainIngestionStorageMetadataService

  • All Implemented Interfaces:
    StorageMetadataService, OffsetManager, java.io.Closeable, java.lang.AutoCloseable

    public class MainIngestionStorageMetadataService
    extends AbstractVeniceService
    implements StorageMetadataService
    MainIngestionStorageMetadataService is an in-memory storage metadata service for IsolatedIngestionBackend. It keeps storage metadata in the memory so RocksDB metadata partitions can be opened by isolated ingestion process only. For metadata update generated by hybrid ingestion, it will sync and persist the update to the RocksDB metadata partition through IPC protocol.
    • Method Detail

      • clearStoreVersionState

        public void clearStoreVersionState​(java.lang.String topicName)
        Description copied from interface: StorageMetadataService
        This will clear all metadata, including store-version state and partition states, tied to {@param topicName}.
        Specified by:
        clearStoreVersionState in interface StorageMetadataService
        Parameters:
        topicName - to be cleared
      • put

        public void put​(java.lang.String topicName,
                        int partitionId,
                        OffsetRecord record)
                 throws VeniceException
        Description copied from interface: OffsetManager
        Records the offset with underlying/external storage. Persistence to disk happens in configurable time interval by a background thread. For example in case of BDB the check pointer thread can be configured to do this.
        Specified by:
        put in interface OffsetManager
        Parameters:
        topicName - kafka topic to which the consumer thread is registered to.
        partitionId - kafka partition id for which the consumer thread is registered to.
        record - OffSetRecord containing last read offset for the topic and partition combination.
        Throws:
        VeniceException
      • clearOffset

        public void clearOffset​(java.lang.String topicName,
                                int partitionId)
        Specified by:
        clearOffset in interface OffsetManager
      • getLastOffset

        public OffsetRecord getLastOffset​(java.lang.String topicName,
                                          int partitionId)
                                   throws VeniceException
        Description copied from interface: OffsetManager
        Gets the Last Known persisted offset of this consumer.
        Specified by:
        getLastOffset in interface OffsetManager
        Parameters:
        topicName - kafka topic to which the consumer thread is registered to.
        partitionId - kafka partition id for which the consumer thread is registered to.
        Returns:
        OffsetRecord - contains offset and time when it was recorded before the consumer thread went down. consumer
        Throws:
        VeniceException
      • putOffsetRecord

        public void putOffsetRecord​(java.lang.String topicName,
                                    int partitionId,
                                    OffsetRecord record)
        putOffsetRecord will only put OffsetRecord into in-memory state, without persisting into metadata RocksDB partition.
      • putStoreVersionState

        public void putStoreVersionState​(java.lang.String topicName,
                                         StoreVersionState record)
        putStoreVersionState will only put StoreVersionState into in-memory state, without persisting into metadata RocksDB partition.