Class StorageEngineFactory

java.lang.Object
com.linkedin.davinci.store.StorageEngineFactory
Direct Known Subclasses:
BlackHoleStorageEngineFactory, InMemoryStorageEngineFactory, RocksDBStorageEngineFactory

public abstract class StorageEngineFactory extends 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 Details

    • StorageEngineFactory

      public StorageEngineFactory()
  • Method Details

    • 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 Set<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(String storeName)
      Remove the storage engine without opening it.
    • removeStorageEnginePartition

      public abstract void removeStorageEnginePartition(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)