Class InMemoryConfigurationStore
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
A default implementation of
YarnConfigurationStore. Doesn't offer
persistent configuration storage, just stores the configuration in memory.-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.conf.YarnConfigurationStore
YarnConfigurationStore.LogMutation -
Field Summary
Fields inherited from class org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.conf.YarnConfigurationStore
LOG -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidConfiguration mutations not logged (i.e. not persisted).voidclose()Closes the configuration store, releasing any required resources.voidconfirmMutation(YarnConfigurationStore.LogMutation pendingMutation, boolean isValid) Should be called afterlogMutation.voidformat()Format the persisted configuration.longGet the last updated config version.getConfirmedConfHistory(long fromId) Configuration mutations not logged (i.e. not persisted) but directly confirmed.org.apache.hadoop.yarn.server.records.VersionConfiguration mutations applied directly in-memory.org.apache.hadoop.yarn.server.records.VersionConfiguration mutations not logged (i.e. not persisted).protected LinkedList<YarnConfigurationStore.LogMutation>getLogs()Configuration mutations not logged (i.e. not persisted) but directly confirmed.voidinitialize(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.conf.Configuration schedConf, RMContext rmContext) Initialize the configuration store, with schedConf as the initial scheduler configuration.voidlogMutation(YarnConfigurationStore.LogMutation logMutation) This method does not log as it does not support backing store.org.apache.hadoop.conf.Configurationretrieve()Retrieve the persisted configuration.voidConfiguration mutations not logged (i.e. not persisted).
-
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:YarnConfigurationStoreInitialize 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:
initializein classYarnConfigurationStore- Parameters:
conf- configuration to initialize store withschedConf- Initial key-value scheduler configuration to persist.rmContext- RMContext for this configuration store
-
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:
logMutationin classYarnConfigurationStore- Parameters:
logMutation- configuration change to be persisted in write ahead log
-
confirmMutation
Description copied from class:YarnConfigurationStoreShould be called afterlogMutation. Gets the pending mutation last logged bylogMutationand marks the mutation as persisted (no longer pending). If isValid is true, merge the mutation with the persisted configuration.- Specified by:
confirmMutationin classYarnConfigurationStore- Parameters:
pendingMutation- the log mutation to applyisValid- if true, update persisted configuration with pending mutation.
-
format
public void format()Description copied from class:YarnConfigurationStoreFormat the persisted configuration.- Specified by:
formatin classYarnConfigurationStore
-
retrieve
public org.apache.hadoop.conf.Configuration retrieve()Description copied from class:YarnConfigurationStoreRetrieve the persisted configuration.- Specified by:
retrievein classYarnConfigurationStore- Returns:
- configuration as key-value
-
getConfigVersion
public long getConfigVersion()Description copied from class:YarnConfigurationStoreGet the last updated config version.- Specified by:
getConfigVersionin classYarnConfigurationStore- Returns:
- Last updated config version.
-
getConfirmedConfHistory
Configuration mutations not logged (i.e. not persisted) but directly confirmed. As such, a list of persisted configuration mutations does not exist.- Specified by:
getConfirmedConfHistoryin classYarnConfigurationStore- 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:
getLogsin classYarnConfigurationStore- Returns:
- null Configuration mutation list not applicable for this store.
-
getConfStoreVersion
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:
getConfStoreVersionin classYarnConfigurationStore- Returns:
- null Conf store version not applicable for this store.
- Throws:
Exception- if any exception occurs during getConfStoreVersion.
-
storeVersion
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:
storeVersionin classYarnConfigurationStore- 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:
getCurrentVersionin classYarnConfigurationStore- 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:
checkVersionin classYarnConfigurationStore
-
close
Description copied from class:YarnConfigurationStoreCloses the configuration store, releasing any required resources.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein classYarnConfigurationStore- Throws:
IOException- on failure to close
-