Class RocksDBStorageEngineFactory
- java.lang.Object
-
- com.linkedin.davinci.store.StorageEngineFactory
-
- com.linkedin.davinci.store.rocksdb.RocksDBStorageEngineFactory
-
public class RocksDBStorageEngineFactory extends StorageEngineFactory
-
-
Constructor Summary
Constructors Constructor Description RocksDBStorageEngineFactory(VeniceServerConfig serverConfig)
RocksDBStorageEngineFactory(VeniceServerConfig serverConfig, RocksDBMemoryStats rocksDBMemoryStats, InternalAvroSpecificSerializer<StoreVersionState> storeVersionStateSerializer, InternalAvroSpecificSerializer<PartitionState> partitionStateSerializer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Close the storage configurationvoid
closeStorageEngine(AbstractStorageEngine engine)
Close the storage engine from the underlying storage configurationboolean
enforceMemoryLimit(java.lang.String storeNameWithoutVersionSuffix)
Whether memory limiter applies or not.java.util.Optional<org.rocksdb.Statistics>
getAggStatistics()
org.rocksdb.Env
getEnv()
long
getMemoryLimit()
long
getMemtableSize()
java.util.Set<java.lang.String>
getPersistedStoreNames()
Retrieve all the stores persisted previouslyPersistenceType
getPersistenceType()
Return the persistence type current factory supports.org.rocksdb.RateLimiter
getRateLimiter()
java.lang.String
getRocksDBPath(java.lang.String storeName, int partitionId)
org.rocksdb.Cache
getSharedCache(boolean isRMD)
org.rocksdb.SstFileManager
getSstFileManager()
org.rocksdb.SstFileManager
getSstFileManagerForMemoryLimiter()
AbstractStorageEngine
getStorageEngine(VeniceStoreVersionConfig storeConfig)
Get an initialized storage implementationAbstractStorageEngine
getStorageEngine(VeniceStoreVersionConfig storeConfig, boolean replicationMetadataEnabled)
Replication metadata is only supported in RocksDB storage engine.org.rocksdb.WriteBufferManager
getWriteBufferManager()
void
removeStorageEngine(AbstractStorageEngine engine)
Remove the storage engine from the underlying storage configurationvoid
removeStorageEngine(java.lang.String storeName)
Currently, this function doesn't apply any IO throttling and if there is a side effect discovered in the read path in the future, we will need to apply some optimization here.void
removeStorageEnginePartition(java.lang.String storeName, int partitionId)
-
Methods inherited from class com.linkedin.davinci.store.StorageEngineFactory
verifyPersistenceType, verifyPersistenceType
-
-
-
-
Constructor Detail
-
RocksDBStorageEngineFactory
public RocksDBStorageEngineFactory(VeniceServerConfig serverConfig)
-
RocksDBStorageEngineFactory
public RocksDBStorageEngineFactory(VeniceServerConfig serverConfig, RocksDBMemoryStats rocksDBMemoryStats, InternalAvroSpecificSerializer<StoreVersionState> storeVersionStateSerializer, InternalAvroSpecificSerializer<PartitionState> partitionStateSerializer)
-
-
Method Detail
-
getMemoryLimit
public long getMemoryLimit()
-
getMemtableSize
public long getMemtableSize()
-
getAggStatistics
public java.util.Optional<org.rocksdb.Statistics> getAggStatistics()
-
getWriteBufferManager
public org.rocksdb.WriteBufferManager getWriteBufferManager()
-
getRateLimiter
public org.rocksdb.RateLimiter getRateLimiter()
-
getSstFileManager
public org.rocksdb.SstFileManager getSstFileManager()
-
getSstFileManagerForMemoryLimiter
public org.rocksdb.SstFileManager getSstFileManagerForMemoryLimiter()
-
enforceMemoryLimit
public boolean enforceMemoryLimit(java.lang.String storeNameWithoutVersionSuffix)
Whether memory limiter applies or not.
-
getEnv
public org.rocksdb.Env getEnv()
-
getSharedCache
public org.rocksdb.Cache getSharedCache(boolean isRMD)
-
getStorageEngine
public AbstractStorageEngine getStorageEngine(VeniceStoreVersionConfig storeConfig) throws StorageInitializationException
Description copied from class:StorageEngineFactory
Get an initialized storage implementation- Specified by:
getStorageEngine
in classStorageEngineFactory
- Parameters:
storeConfig
- store definition- Returns:
- The storage engine
- Throws:
StorageInitializationException
-
getStorageEngine
public AbstractStorageEngine getStorageEngine(VeniceStoreVersionConfig storeConfig, boolean replicationMetadataEnabled) throws StorageInitializationException
Description copied from class:StorageEngineFactory
Replication metadata is only supported in RocksDB storage engine. For other type of the storage engine, we will throw VeniceException here.- Overrides:
getStorageEngine
in classStorageEngineFactory
- Throws:
StorageInitializationException
-
getPersistedStoreNames
public java.util.Set<java.lang.String> getPersistedStoreNames()
Description copied from class:StorageEngineFactory
Retrieve all the stores persisted previously- Specified by:
getPersistedStoreNames
in classStorageEngineFactory
- Returns:
- All the store names
-
close
public void close()
Description copied from class:StorageEngineFactory
Close the storage configuration- Specified by:
close
in classStorageEngineFactory
-
removeStorageEngine
public void removeStorageEngine(AbstractStorageEngine engine)
Description copied from class:StorageEngineFactory
Remove the storage engine from the underlying storage configuration- Specified by:
removeStorageEngine
in classStorageEngineFactory
- Parameters:
engine
- Specifies the storage engine to be removed
-
removeStorageEngine
public void removeStorageEngine(java.lang.String storeName)
Currently, this function doesn't apply any IO throttling and if there is a side effect discovered in the read path in the future, we will need to apply some optimization here.- Specified by:
removeStorageEngine
in classStorageEngineFactory
-
getRocksDBPath
public java.lang.String getRocksDBPath(java.lang.String storeName, int partitionId)
-
removeStorageEnginePartition
public void removeStorageEnginePartition(java.lang.String storeName, int partitionId)
- Specified by:
removeStorageEnginePartition
in classStorageEngineFactory
-
closeStorageEngine
public void closeStorageEngine(AbstractStorageEngine engine)
Description copied from class:StorageEngineFactory
Close the storage engine from the underlying storage configuration- Specified by:
closeStorageEngine
in classStorageEngineFactory
- Parameters:
engine
- Specifies the storage engine to be removed
-
getPersistenceType
public PersistenceType getPersistenceType()
Description copied from class:StorageEngineFactory
Return the persistence type current factory supports.- Specified by:
getPersistenceType
in classStorageEngineFactory
- Returns:
-
-