YARN-6497. Method length of ResourceManager#serviceInit() is too long (Gergely Novák via jeagles)
This commit is contained in:
parent
c48a7a0e9e
commit
fee8342f6b
@ -59,6 +59,7 @@
|
|||||||
import org.apache.hadoop.yarn.event.Dispatcher;
|
import org.apache.hadoop.yarn.event.Dispatcher;
|
||||||
import org.apache.hadoop.yarn.event.EventDispatcher;
|
import org.apache.hadoop.yarn.event.EventDispatcher;
|
||||||
import org.apache.hadoop.yarn.event.EventHandler;
|
import org.apache.hadoop.yarn.event.EventHandler;
|
||||||
|
import org.apache.hadoop.yarn.exceptions.YarnException;
|
||||||
import org.apache.hadoop.yarn.exceptions.YarnRuntimeException;
|
import org.apache.hadoop.yarn.exceptions.YarnRuntimeException;
|
||||||
import org.apache.hadoop.yarn.server.resourcemanager.ahs.RMApplicationHistoryWriter;
|
import org.apache.hadoop.yarn.server.resourcemanager.ahs.RMApplicationHistoryWriter;
|
||||||
import org.apache.hadoop.yarn.server.resourcemanager.amlauncher.AMLauncherEventType;
|
import org.apache.hadoop.yarn.server.resourcemanager.amlauncher.AMLauncherEventType;
|
||||||
@ -238,13 +239,7 @@ protected void serviceInit(Configuration conf) throws Exception {
|
|||||||
rmContext.setConfigurationProvider(configurationProvider);
|
rmContext.setConfigurationProvider(configurationProvider);
|
||||||
|
|
||||||
// load core-site.xml
|
// load core-site.xml
|
||||||
InputStream coreSiteXMLInputStream =
|
loadConfigurationXml(YarnConfiguration.CORE_SITE_CONFIGURATION_FILE);
|
||||||
this.configurationProvider.getConfigurationInputStream(this.conf,
|
|
||||||
YarnConfiguration.CORE_SITE_CONFIGURATION_FILE);
|
|
||||||
if (coreSiteXMLInputStream != null) {
|
|
||||||
this.conf.addResource(coreSiteXMLInputStream,
|
|
||||||
YarnConfiguration.CORE_SITE_CONFIGURATION_FILE);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Do refreshUserToGroupsMappings with loaded core-site.xml
|
// Do refreshUserToGroupsMappings with loaded core-site.xml
|
||||||
Groups.getUserToGroupsMappingServiceWithLoadedConfiguration(this.conf)
|
Groups.getUserToGroupsMappingServiceWithLoadedConfiguration(this.conf)
|
||||||
@ -257,13 +252,7 @@ protected void serviceInit(Configuration conf) throws Exception {
|
|||||||
ProxyUsers.refreshSuperUserGroupsConfiguration(this.conf);
|
ProxyUsers.refreshSuperUserGroupsConfiguration(this.conf);
|
||||||
|
|
||||||
// load yarn-site.xml
|
// load yarn-site.xml
|
||||||
InputStream yarnSiteXMLInputStream =
|
loadConfigurationXml(YarnConfiguration.YARN_SITE_CONFIGURATION_FILE);
|
||||||
this.configurationProvider.getConfigurationInputStream(this.conf,
|
|
||||||
YarnConfiguration.YARN_SITE_CONFIGURATION_FILE);
|
|
||||||
if (yarnSiteXMLInputStream != null) {
|
|
||||||
this.conf.addResource(yarnSiteXMLInputStream,
|
|
||||||
YarnConfiguration.YARN_SITE_CONFIGURATION_FILE);
|
|
||||||
}
|
|
||||||
|
|
||||||
validateConfigs(this.conf);
|
validateConfigs(this.conf);
|
||||||
|
|
||||||
@ -339,6 +328,16 @@ protected void serviceInit(Configuration conf) throws Exception {
|
|||||||
super.serviceInit(this.conf);
|
super.serviceInit(this.conf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void loadConfigurationXml(String configurationFile)
|
||||||
|
throws YarnException, IOException {
|
||||||
|
InputStream configurationInputStream =
|
||||||
|
this.configurationProvider.getConfigurationInputStream(this.conf,
|
||||||
|
configurationFile);
|
||||||
|
if (configurationInputStream != null) {
|
||||||
|
this.conf.addResource(configurationInputStream, configurationFile);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
protected EmbeddedElector createEmbeddedElector() throws IOException {
|
protected EmbeddedElector createEmbeddedElector() throws IOException {
|
||||||
EmbeddedElector elector;
|
EmbeddedElector elector;
|
||||||
curatorEnabled =
|
curatorEnabled =
|
||||||
|
Loading…
x
Reference in New Issue
Block a user