java.lang.AutoCloseablepublic class ZKConfigurationStore extends YarnConfigurationStore
YarnConfigurationStore.YarnConfigurationStore.LogMutation| Modifier and Type | Field | Description |
|---|---|---|
protected static org.apache.hadoop.yarn.server.records.Version |
CURRENT_VERSION_INFO |
|
static org.slf4j.Logger |
LOG |
| Constructor | Description |
|---|---|
ZKConfigurationStore() |
| Modifier and Type | Method | 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.
|
java.util.List<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 java.util.LinkedList<YarnConfigurationStore.LogMutation> |
getLogs() |
Get a list of configuration mutations.
|
protected byte[] |
getZkData(java.lang.String path) |
|
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(YarnConfigurationStore.LogMutation logMutation) |
Logs the configuration change to backing store.
|
org.apache.hadoop.conf.Configuration |
retrieve() |
Retrieve the persisted configuration.
|
protected void |
safeCreateZkData(java.lang.String path,
byte[] data) |
|
protected void |
setZkData(java.lang.String path,
byte[] data) |
|
void |
storeVersion() |
Persist the hard-coded schema version to the conf store.
|
checkVersionpublic 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 config,
org.apache.hadoop.conf.Configuration schedConf,
RMContext rmContext)
throws java.lang.Exception
YarnConfigurationStoreinitialize in class YarnConfigurationStoreconfig - configuration to initialize store withschedConf - Initial key-value scheduler configuration to persist.rmContext - RMContext for this configuration storejava.io.IOException - if initialization failsjava.lang.Exception@VisibleForTesting protected java.util.LinkedList<YarnConfigurationStore.LogMutation> getLogs() throws java.lang.Exception
YarnConfigurationStoregetLogs in class YarnConfigurationStorejava.lang.Exception - On mutation fetch failurepublic org.apache.hadoop.yarn.server.records.Version getCurrentVersion()
YarnConfigurationStoregetCurrentVersion in class YarnConfigurationStorepublic org.apache.hadoop.yarn.server.records.Version getConfStoreVersion()
throws java.lang.Exception
YarnConfigurationStoregetConfStoreVersion in class YarnConfigurationStorejava.lang.Exception - On version fetch failurepublic void format()
throws java.lang.Exception
YarnConfigurationStoreformat in class YarnConfigurationStorejava.io.IOException - on failure to formatjava.lang.Exceptionpublic void storeVersion()
throws java.lang.Exception
YarnConfigurationStorestoreVersion in class YarnConfigurationStorejava.lang.Exception - On storage failurepublic void logMutation(YarnConfigurationStore.LogMutation logMutation) throws java.lang.Exception
YarnConfigurationStorelogMutation in class YarnConfigurationStorelogMutation - configuration change to be persisted in write ahead logjava.io.IOException - if logging failsjava.lang.Exceptionpublic void confirmMutation(YarnConfigurationStore.LogMutation pendingMutation, boolean isValid) throws java.lang.Exception
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 YarnConfigurationStorependingMutation - the log mutation to applyisValid - if true, update persisted configuration with pending
mutation.java.lang.Exception - if mutation confirmation failspublic org.apache.hadoop.conf.Configuration retrieve()
YarnConfigurationStoreretrieve in class YarnConfigurationStorepublic long getConfigVersion()
throws java.lang.Exception
YarnConfigurationStoregetConfigVersion in class YarnConfigurationStorejava.lang.Exception - On version fetch failure.public java.util.List<YarnConfigurationStore.LogMutation> getConfirmedConfHistory(long fromId)
YarnConfigurationStoregetConfirmedConfHistory in class YarnConfigurationStorefromId - id from which to start getting mutations, inclusive@VisibleForTesting
protected byte[] getZkData(java.lang.String path)
throws java.lang.Exception
java.lang.Exception@VisibleForTesting
protected void setZkData(java.lang.String path,
byte[] data)
throws java.lang.Exception
java.lang.Exception@VisibleForTesting
protected void safeCreateZkData(java.lang.String path,
byte[] data)
throws java.lang.Exception
java.lang.Exceptionpublic void close()
throws java.io.IOException
YarnConfigurationStoreclose in interface java.lang.AutoCloseableclose in class YarnConfigurationStorejava.io.IOException - on failure to closeCopyright © 2008–2025 Apache Software Foundation. All rights reserved.