java.lang.Object
org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.conf.YarnConfigurationStore
org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.conf.InMemoryConfigurationStore
All Implemented Interfaces:
AutoCloseable

public class InMemoryConfigurationStore extends YarnConfigurationStore
A default implementation of YarnConfigurationStore. Doesn't offer persistent configuration storage, just stores the configuration in memory.
  • Constructor Details

    • InMemoryConfigurationStore

      public InMemoryConfigurationStore()
  • Method Details

    • initialize

      public void initialize(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.conf.Configuration schedConf, RMContext rmContext)
      Description copied from class: YarnConfigurationStore
      Initialize the configuration store, with schedConf as the initial scheduler configuration. If a persisted store already exists, use the scheduler configuration stored there, and ignore schedConf.
      Specified by:
      initialize in class YarnConfigurationStore
      Parameters:
      conf - configuration to initialize store with
      schedConf - Initial key-value scheduler configuration to persist.
      rmContext - RMContext for this configuration store
    • logMutation

      public void logMutation(YarnConfigurationStore.LogMutation logMutation)
      This method does not log as it does not support backing store. The mutation to be applied on top of schedConf will be directly passed in confirmMutation.
      Specified by:
      logMutation in class YarnConfigurationStore
      Parameters:
      logMutation - configuration change to be persisted in write ahead log
    • confirmMutation

      public void confirmMutation(YarnConfigurationStore.LogMutation pendingMutation, boolean isValid)
      Description copied from class: YarnConfigurationStore
      Should be called after logMutation. Gets the pending mutation last logged by logMutation and marks the mutation as persisted (no longer pending). If isValid is true, merge the mutation with the persisted configuration.
      Specified by:
      confirmMutation in class YarnConfigurationStore
      Parameters:
      pendingMutation - the log mutation to apply
      isValid - if true, update persisted configuration with pending mutation.
    • format

      public void format()
      Description copied from class: YarnConfigurationStore
      Format the persisted configuration.
      Specified by:
      format in class YarnConfigurationStore
    • retrieve

      public org.apache.hadoop.conf.Configuration retrieve()
      Description copied from class: YarnConfigurationStore
      Retrieve the persisted configuration.
      Specified by:
      retrieve in class YarnConfigurationStore
      Returns:
      configuration as key-value
    • getConfigVersion

      public long getConfigVersion()
      Description copied from class: YarnConfigurationStore
      Get the last updated config version.
      Specified by:
      getConfigVersion in class YarnConfigurationStore
      Returns:
      Last updated config version.
    • getConfirmedConfHistory

      public List<YarnConfigurationStore.LogMutation> getConfirmedConfHistory(long fromId)
      Configuration mutations not logged (i.e. not persisted) but directly confirmed. As such, a list of persisted configuration mutations does not exist.
      Specified by:
      getConfirmedConfHistory in class YarnConfigurationStore
      Parameters:
      fromId - id from which to start getting mutations, inclusive
      Returns:
      null Configuration mutation list not applicable for this store.
    • getLogs

      Configuration mutations not logged (i.e. not persisted) but directly confirmed. As such, a list of persisted configuration mutations does not exist.
      Specified by:
      getLogs in class YarnConfigurationStore
      Returns:
      null Configuration mutation list not applicable for this store.
    • getConfStoreVersion

      public org.apache.hadoop.yarn.server.records.Version getConfStoreVersion() throws Exception
      Configuration mutations applied directly in-memory. As such, there is no persistent configuration store. As there is no configuration store for versioning purposes, a conf store version is not applicable.
      Specified by:
      getConfStoreVersion in class YarnConfigurationStore
      Returns:
      null Conf store version not applicable for this store.
      Throws:
      Exception - if any exception occurs during getConfStoreVersion.
    • storeVersion

      public void storeVersion() throws Exception
      Configuration mutations not logged (i.e. not persisted). As such, they are not persisted and not versioned. Hence, no version information to store.
      Specified by:
      storeVersion in class YarnConfigurationStore
      Throws:
      Exception - if any exception occurs during store Version.
    • getCurrentVersion

      public org.apache.hadoop.yarn.server.records.Version getCurrentVersion()
      Configuration mutations not logged (i.e. not persisted). As such, they are not persisted and not versioned. Hence, a current version is not applicable.
      Specified by:
      getCurrentVersion in class YarnConfigurationStore
      Returns:
      null A current version not applicable for this store.
    • checkVersion

      public void checkVersion()
      Configuration mutations not logged (i.e. not persisted). As such, they are not persisted and not versioned. Hence, version is always compatible, since it is in-memory.
      Overrides:
      checkVersion in class YarnConfigurationStore
    • close

      public void close() throws IOException
      Description copied from class: YarnConfigurationStore
      Closes the configuration store, releasing any required resources.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in class YarnConfigurationStore
      Throws:
      IOException - on failure to close