Package com.linkedin.davinci.store
Class StorageEngineFactory
- java.lang.Object
-
- com.linkedin.davinci.store.StorageEngineFactory
-
- Direct Known Subclasses:
BlackHoleStorageEngineFactory
,InMemoryStorageEngineFactory
,RocksDBStorageEngineFactory
public abstract class StorageEngineFactory extends java.lang.Object
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 Constructor Description StorageEngineFactory()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract void
close()
Close the storage configurationabstract void
closeStorageEngine(AbstractStorageEngine engine)
Close the storage engine from the underlying storage configurationabstract java.util.Set<java.lang.String>
getPersistedStoreNames()
Retrieve all the stores persisted previouslyabstract PersistenceType
getPersistenceType()
Return the persistence type current factory supports.abstract AbstractStorageEngine
getStorageEngine(VeniceStoreVersionConfig storeDef)
Get an initialized storage implementationAbstractStorageEngine
getStorageEngine(VeniceStoreVersionConfig storeDef, boolean replicationMetadataEnabled)
Replication metadata is only supported in RocksDB storage engine.abstract void
removeStorageEngine(AbstractStorageEngine engine)
Remove the storage engine from the underlying storage configurationabstract void
removeStorageEngine(java.lang.String storeName)
Remove the storage engine without opening it.abstract void
removeStorageEnginePartition(java.lang.String storeName, int partition)
void
verifyPersistenceType(VeniceStoreVersionConfig storeConfig)
void
verifyPersistenceType(AbstractStorageEngine engine)
-
-
-
Method Detail
-
getStorageEngine
public abstract AbstractStorageEngine getStorageEngine(VeniceStoreVersionConfig storeDef) throws StorageInitializationException
Get an initialized storage implementation- Parameters:
storeDef
- store definition- Returns:
- The storage engine
- Throws:
StorageInitializationException
-
getStorageEngine
public AbstractStorageEngine 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
public abstract java.util.Set<java.lang.String> getPersistedStoreNames()
Retrieve all the stores persisted previously- Returns:
- All the store names
-
close
public abstract void close()
Close the storage configuration
-
removeStorageEngine
public abstract void removeStorageEngine(AbstractStorageEngine engine)
Remove the storage engine from the underlying storage configuration- Parameters:
engine
- Specifies the storage engine to be removed
-
removeStorageEngine
public abstract void removeStorageEngine(java.lang.String storeName)
Remove the storage engine without opening it.
-
removeStorageEnginePartition
public abstract void removeStorageEnginePartition(java.lang.String storeName, int partition)
-
closeStorageEngine
public abstract void closeStorageEngine(AbstractStorageEngine engine)
Close the storage engine from the underlying storage configuration- Parameters:
engine
- Specifies the storage engine to be removed
-
getPersistenceType
public abstract PersistenceType getPersistenceType()
Return the persistence type current factory supports.- Returns:
-
verifyPersistenceType
public void verifyPersistenceType(VeniceStoreVersionConfig storeConfig)
-
verifyPersistenceType
public void verifyPersistenceType(AbstractStorageEngine engine)
-
-