Package com.linkedin.davinci.store
Class StorageEngineFactory
java.lang.Object
com.linkedin.davinci.store.StorageEngineFactory
- Direct Known Subclasses:
BlackHoleStorageEngineFactory,InMemoryStorageEngineFactory,RocksDBStorageEngineFactory
An abstraction that represents the shared resources of a persistence engine.
This could include file handles, db connection pools, caches, etc.
For example for BDB it holds the various environments, for jdbc it holds a
connection pool reference
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidclose()Close the storage configurationabstract voidcloseStorageEngine(StorageEngine engine) Close the storage engine from the underlying storage configurationRetrieve all the stores persisted previouslyabstract PersistenceTypeReturn the persistence type current factory supports.abstract StorageEnginegetStorageEngine(VeniceStoreVersionConfig storeDef) Get an initialized storage implementationgetStorageEngine(VeniceStoreVersionConfig storeDef, boolean replicationMetadataEnabled) Replication metadata is only supported in RocksDB storage engine.abstract voidremoveStorageEngine(StorageEngine engine) Remove the storage engine from the underlying storage configurationabstract voidremoveStorageEngine(String storeName) Remove the storage engine without opening it.abstract voidremoveStorageEnginePartition(String storeName, int partition) voidverifyPersistenceType(VeniceStoreVersionConfig storeConfig) voidverifyPersistenceType(StorageEngine engine)
-
Constructor Details
-
StorageEngineFactory
public StorageEngineFactory()
-
-
Method Details
-
getStorageEngine
public abstract StorageEngine getStorageEngine(VeniceStoreVersionConfig storeDef) throws StorageInitializationException Get an initialized storage implementation- Parameters:
storeDef- store definition- Returns:
- The storage engine
- Throws:
StorageInitializationException
-
getStorageEngine
public StorageEngine getStorageEngine(VeniceStoreVersionConfig storeDef, boolean replicationMetadataEnabled) Replication metadata is only supported in RocksDB storage engine. For other type of the storage engine, we will throw VeniceException here. -
getPersistedStoreNames
Retrieve all the stores persisted previously- Returns:
- All the store names
-
close
public abstract void close()Close the storage configuration -
removeStorageEngine
Remove the storage engine from the underlying storage configuration- Parameters:
engine- Specifies the storage engine to be removed
-
removeStorageEngine
Remove the storage engine without opening it. -
removeStorageEnginePartition
-
closeStorageEngine
Close the storage engine from the underlying storage configuration- Parameters:
engine- Specifies the storage engine to be removed
-
getPersistenceType
Return the persistence type current factory supports.- Returns:
-
verifyPersistenceType
-
verifyPersistenceType
-