Class AbstractRDBStore<DEF extends org.apache.hadoop.hdds.utils.db.DBDefinition>

java.lang.Object
org.apache.hadoop.ozone.container.metadata.AbstractRDBStore<DEF>
Type Parameters:
DEF - Generic parameter defining the schema for the DB.
All Implemented Interfaces:
AutoCloseable, DBStoreManager, org.apache.ratis.util.UncheckedAutoCloseable
Direct Known Subclasses:
AbstractDatanodeStore, WitnessedContainerMetadataStoreImpl

public abstract class AbstractRDBStore<DEF extends org.apache.hadoop.hdds.utils.db.DBDefinition> extends Object implements DBStoreManager
Abstract Interface defining the way to interact with any rocksDB in the datanode.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    AbstractRDBStore(DEF dbDef, org.apache.hadoop.hdds.conf.ConfigurationSource config, boolean openReadOnly)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    void
     
    void
     
    void
    flushLog(boolean sync)
     
    org.apache.hadoop.hdds.utils.db.BatchOperationHandler
    Helper to create and write batch transactions.
    protected DEF
     
     
    org.apache.hadoop.hdds.utils.db.DBStore
    Get datanode store.
    protected abstract org.apache.hadoop.hdds.utils.db.DBStore
    initDBStore(org.apache.hadoop.hdds.utils.db.DBStoreBuilder dbStoreBuilder, org.apache.hadoop.hdds.utils.db.managed.ManagedDBOptions options, org.apache.hadoop.hdds.conf.ConfigurationSource config)
     
    boolean
    Returns if the underlying DB is closed.
    void
    Stop datanode manager.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.apache.hadoop.ozone.container.metadata.DBStoreManager

    compactionIfNeeded
  • Constructor Details

    • AbstractRDBStore

      protected AbstractRDBStore(DEF dbDef, org.apache.hadoop.hdds.conf.ConfigurationSource config, boolean openReadOnly) throws org.apache.hadoop.hdds.utils.db.RocksDatabaseException, org.apache.hadoop.hdds.utils.db.CodecException
      Throws:
      org.apache.hadoop.hdds.utils.db.RocksDatabaseException
      org.apache.hadoop.hdds.utils.db.CodecException
  • Method Details

    • initDBStore

      protected abstract org.apache.hadoop.hdds.utils.db.DBStore initDBStore(org.apache.hadoop.hdds.utils.db.DBStoreBuilder dbStoreBuilder, org.apache.hadoop.hdds.utils.db.managed.ManagedDBOptions options, org.apache.hadoop.hdds.conf.ConfigurationSource config) throws org.apache.hadoop.hdds.utils.db.RocksDatabaseException, org.apache.hadoop.hdds.utils.db.CodecException
      Throws:
      org.apache.hadoop.hdds.utils.db.RocksDatabaseException
      org.apache.hadoop.hdds.utils.db.CodecException
    • stop

      public void stop()
      Description copied from interface: DBStoreManager
      Stop datanode manager.
      Specified by:
      stop in interface DBStoreManager
    • getStore

      public org.apache.hadoop.hdds.utils.db.DBStore getStore()
      Description copied from interface: DBStoreManager
      Get datanode store.
      Specified by:
      getStore in interface DBStoreManager
      Returns:
      datanode store.
    • isClosed

      public boolean isClosed()
      Description copied from interface: DBStoreManager
      Returns if the underlying DB is closed. This call is thread safe.
      Specified by:
      isClosed in interface DBStoreManager
      Returns:
      true if the DB is closed.
    • getBatchHandler

      public org.apache.hadoop.hdds.utils.db.BatchOperationHandler getBatchHandler()
      Description copied from interface: DBStoreManager
      Helper to create and write batch transactions.
      Specified by:
      getBatchHandler in interface DBStoreManager
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface org.apache.ratis.util.UncheckedAutoCloseable
    • flushDB

      public void flushDB() throws org.apache.hadoop.hdds.utils.db.RocksDatabaseException
      Specified by:
      flushDB in interface DBStoreManager
      Throws:
      org.apache.hadoop.hdds.utils.db.RocksDatabaseException
    • flushLog

      public void flushLog(boolean sync) throws org.apache.hadoop.hdds.utils.db.RocksDatabaseException
      Specified by:
      flushLog in interface DBStoreManager
      Throws:
      org.apache.hadoop.hdds.utils.db.RocksDatabaseException
    • compactDB

      public void compactDB() throws org.apache.hadoop.hdds.utils.db.RocksDatabaseException
      Specified by:
      compactDB in interface DBStoreManager
      Throws:
      org.apache.hadoop.hdds.utils.db.RocksDatabaseException
    • getDbProfile

      public DatanodeDBProfile getDbProfile()
    • getDbDef

      protected DEF getDbDef()