Class RecordStore<R extends BaseRecord>

java.lang.Object
org.apache.hadoop.hdfs.server.federation.store.RecordStore<R>
Type Parameters:
R - Record to store by this interface.
Direct Known Subclasses:
CachedRecordStore

@Private @Evolving public abstract class RecordStore<R extends BaseRecord> extends Object
Store records in the State Store. Subclasses provide interfaces to operate on those records.
  • Constructor Details

    • RecordStore

      protected RecordStore(Class<R> clazz, StateStoreDriver stateStoreDriver)
      Create a new store for records.
      Parameters:
      clazz - Class of the record to store.
      stateStoreDriver - Driver for the State Store.
  • Method Details

    • getRecordClass

      public Class<R> getRecordClass()
      Report a required record to the data store. The data store uses this to create/maintain storage for the record.
      Returns:
      The class of the required record or null if no record is required for this interface.
    • getDriver

      public StateStoreDriver getDriver()
      Get the State Store driver.
      Returns:
      State Store driver.
    • newInstance

      public static <T extends RecordStore<?>> T newInstance(Class<T> clazz, StateStoreDriver driver)
      Build a state store API implementation interface.
      Type Parameters:
      T - Instance of type RecordStore.
      Parameters:
      clazz - The specific interface implementation to create
      driver - The StateStoreDriver implementation in use.
      Returns:
      An initialized instance of the specified state store API implementation.