public class FSSchedulerConfigurationStore extends YarnConfigurationStore
YarnConfigurationStore
. Offer
configuration storage in FileSystemYarnConfigurationStore.LogMutation
Modifier and Type | Field and Description |
---|---|
protected static org.apache.hadoop.yarn.server.records.Version |
CURRENT_VERSION_INFO |
static org.slf4j.Logger |
LOG |
Constructor and Description |
---|
FSSchedulerConfigurationStore() |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the configuration store, releasing any required resources.
|
void |
confirmMutation(YarnConfigurationStore.LogMutation pendingMutation,
boolean isValid)
Should be called after
logMutation . |
void |
format()
Format the persisted configuration.
|
long |
getConfigVersion()
Get the last updated config version.
|
List<YarnConfigurationStore.LogMutation> |
getConfirmedConfHistory(long fromId)
Get a list of confirmed configuration mutations starting from a given id.
|
protected org.apache.hadoop.yarn.server.records.Version |
getConfStoreVersion()
Get schema version of persisted conf store, for detecting compatibility
issues when changing conf store schema.
|
protected org.apache.hadoop.yarn.server.records.Version |
getCurrentVersion()
Get the hard-coded schema version, for comparison against the schema
version currently persisted.
|
protected LinkedList<YarnConfigurationStore.LogMutation> |
getLogs()
Get a list of configuration mutations.
|
void |
initialize(org.apache.hadoop.conf.Configuration fsConf,
org.apache.hadoop.conf.Configuration vSchedConf,
RMContext rmContext)
Initialize the configuration store, with schedConf as the initial
scheduler configuration.
|
void |
logMutation(YarnConfigurationStore.LogMutation logMutation)
Update and persist latest configuration in temp file.
|
org.apache.hadoop.conf.Configuration |
retrieve()
Retrieve the persisted configuration.
|
protected void |
storeVersion()
Persist the hard-coded schema version to the conf store.
|
checkVersion
public static final org.slf4j.Logger LOG
@VisibleForTesting protected static final org.apache.hadoop.yarn.server.records.Version CURRENT_VERSION_INFO
public void initialize(org.apache.hadoop.conf.Configuration fsConf, org.apache.hadoop.conf.Configuration vSchedConf, RMContext rmContext) throws Exception
YarnConfigurationStore
initialize
in class YarnConfigurationStore
fsConf
- configuration to initialize store withvSchedConf
- Initial key-value scheduler configuration to persist.rmContext
- RMContext for this configuration storeIOException
- if initialization failsException
public void logMutation(YarnConfigurationStore.LogMutation logMutation) throws IOException
logMutation
in class YarnConfigurationStore
logMutation
- configuration change to be persisted in write ahead logIOException
- throw IOE when write temp configuration file failpublic void confirmMutation(YarnConfigurationStore.LogMutation pendingMutation, boolean isValid) throws Exception
YarnConfigurationStore
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.confirmMutation
in class YarnConfigurationStore
pendingMutation
- the log mutation to applyisValid
- if true, finalize temp configuration file
if false, remove temp configuration file and rollbackException
- throw IOE when write temp configuration file failpublic void format() throws Exception
YarnConfigurationStore
format
in class YarnConfigurationStore
IOException
- on failure to formatException
public long getConfigVersion() throws Exception
YarnConfigurationStore
getConfigVersion
in class YarnConfigurationStore
Exception
- On version fetch failure.public org.apache.hadoop.conf.Configuration retrieve() throws IOException
YarnConfigurationStore
retrieve
in class YarnConfigurationStore
IOException
- an I/O exception has occurred.public List<YarnConfigurationStore.LogMutation> getConfirmedConfHistory(long fromId)
YarnConfigurationStore
getConfirmedConfHistory
in class YarnConfigurationStore
fromId
- id from which to start getting mutations, inclusiveprotected LinkedList<YarnConfigurationStore.LogMutation> getLogs()
YarnConfigurationStore
getLogs
in class YarnConfigurationStore
protected org.apache.hadoop.yarn.server.records.Version getConfStoreVersion() throws Exception
YarnConfigurationStore
getConfStoreVersion
in class YarnConfigurationStore
Exception
- On version fetch failureprotected void storeVersion() throws Exception
YarnConfigurationStore
storeVersion
in class YarnConfigurationStore
Exception
- On storage failureprotected org.apache.hadoop.yarn.server.records.Version getCurrentVersion()
YarnConfigurationStore
getCurrentVersion
in class YarnConfigurationStore
public void close() throws IOException
YarnConfigurationStore
close
in interface AutoCloseable
close
in class YarnConfigurationStore
IOException
- on failure to closeCopyright © 2008–2024 Apache Software Foundation. All rights reserved.