public class LeveldbConfigurationStore extends YarnConfigurationStore
YarnConfigurationStore.| 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 |
|---|
LeveldbConfigurationStore() |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the configuration store, releasing any required resources.
|
void |
confirmMutation(boolean isValid)
Should be called after
logMutation. |
void |
format()
Format the persisted configuration.
|
long |
getConfigVersion()
Get the last updated config version.
|
List<org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.conf.YarnConfigurationStore.LogMutation> |
getConfirmedConfHistory(long fromId)
Get a list of confirmed configuration mutations starting from a given id.
|
org.apache.hadoop.yarn.server.records.Version |
getConfStoreVersion()
Get schema version of persisted conf store, for detecting compatibility
issues when changing conf store schema.
|
org.apache.hadoop.yarn.server.records.Version |
getCurrentVersion()
Get the hard-coded schema version, for comparison against the schema
version currently persisted.
|
protected org.iq80.leveldb.DB |
getDB() |
protected LinkedList<org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.conf.YarnConfigurationStore.LogMutation> |
getLogs()
Get a list of configuration mutations.
|
void |
initialize(org.apache.hadoop.conf.Configuration config,
org.apache.hadoop.conf.Configuration schedConf,
RMContext rmContext)
Initialize the configuration store, with schedConf as the initial
scheduler configuration.
|
void |
logMutation(org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.conf.YarnConfigurationStore.LogMutation logMutation)
Logs the configuration change to backing store.
|
org.apache.hadoop.conf.Configuration |
retrieve()
Retrieve the persisted configuration.
|
void |
storeVersion()
Persist the hard-coded schema version to the conf store.
|
protected void |
storeVersion(org.apache.hadoop.yarn.server.records.Version version) |
checkVersionpublic static final org.slf4j.Logger LOG
protected static final org.apache.hadoop.yarn.server.records.Version CURRENT_VERSION_INFO
public void initialize(org.apache.hadoop.conf.Configuration config,
org.apache.hadoop.conf.Configuration schedConf,
RMContext rmContext)
throws IOException
YarnConfigurationStoreinitialize in class YarnConfigurationStoreconfig - configuration to initialize store withschedConf - Initial key-value scheduler configuration to persist.rmContext - RMContext for this configuration storeIOException - if initialization failspublic void format()
throws Exception
YarnConfigurationStoreformat in class YarnConfigurationStoreIOException - on failure to formatExceptionpublic void close()
throws IOException
YarnConfigurationStoreclose in class YarnConfigurationStoreIOException - on failure to closepublic void logMutation(org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.conf.YarnConfigurationStore.LogMutation logMutation)
throws IOException
YarnConfigurationStorelogMutation in class YarnConfigurationStorelogMutation - configuration change to be persisted in write ahead logIOException - if logging failspublic void confirmMutation(boolean isValid)
throws IOException
YarnConfigurationStorelogMutation. 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 YarnConfigurationStoreisValid - if true, update persisted configuration with pending
mutation.IOExceptionpublic org.apache.hadoop.conf.Configuration retrieve()
YarnConfigurationStoreretrieve in class YarnConfigurationStorepublic long getConfigVersion()
YarnConfigurationStoregetConfigVersion in class YarnConfigurationStorepublic List<org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.conf.YarnConfigurationStore.LogMutation> getConfirmedConfHistory(long fromId)
YarnConfigurationStoregetConfirmedConfHistory in class YarnConfigurationStorefromId - id from which to start getting mutations, inclusivepublic org.apache.hadoop.yarn.server.records.Version getConfStoreVersion()
throws Exception
YarnConfigurationStoregetConfStoreVersion in class YarnConfigurationStoreException - On version fetch failureprotected LinkedList<org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.conf.YarnConfigurationStore.LogMutation> getLogs() throws Exception
YarnConfigurationStoregetLogs in class YarnConfigurationStoreException - On mutation fetch failureprotected org.iq80.leveldb.DB getDB()
public void storeVersion()
throws Exception
YarnConfigurationStorestoreVersion in class YarnConfigurationStoreException - On storage failureprotected void storeVersion(org.apache.hadoop.yarn.server.records.Version version)
public org.apache.hadoop.yarn.server.records.Version getCurrentVersion()
YarnConfigurationStoregetCurrentVersion in class YarnConfigurationStoreCopyright © 2008–2022 Apache Software Foundation. All rights reserved.