|
@@ -253,9 +253,8 @@ public class ResourceManager extends CompositeService implements Recoverable {
|
|
|
// load core-site.xml
|
|
|
loadConfigurationXml(YarnConfiguration.CORE_SITE_CONFIGURATION_FILE);
|
|
|
|
|
|
- // Do refreshUserToGroupsMappings with loaded core-site.xml
|
|
|
- Groups.getUserToGroupsMappingServiceWithLoadedConfiguration(this.conf)
|
|
|
- .refresh();
|
|
|
+ // Refresh user to group mappings during init.
|
|
|
+ refreshUserToGroupMappingsWithConf();
|
|
|
|
|
|
// Do refreshSuperUserGroupsConfiguration with loaded core-site.xml
|
|
|
// Or use RM specific configurations to overwrite the common ones first
|
|
@@ -340,6 +339,21 @@ public class ResourceManager extends CompositeService implements Recoverable {
|
|
|
super.serviceInit(this.conf);
|
|
|
}
|
|
|
|
|
|
+ private void refreshUserToGroupMappingsWithConf()
|
|
|
+ throws YarnException, IOException {
|
|
|
+ Configuration newConf = new Configuration(false);
|
|
|
+ InputStream confFileInputStream =
|
|
|
+ configurationProvider
|
|
|
+ .getConfigurationInputStream(newConf, YarnConfiguration.CORE_SITE_CONFIGURATION_FILE);
|
|
|
+ if (confFileInputStream != null) {
|
|
|
+ newConf.addResource(confFileInputStream);
|
|
|
+ }
|
|
|
+
|
|
|
+ // Do refreshUserToGroupsMappings with loaded core-site.xml
|
|
|
+ Groups.getUserToGroupsMappingServiceWithLoadedConfiguration(newConf)
|
|
|
+ .refresh();
|
|
|
+ }
|
|
|
+
|
|
|
private void loadConfigurationXml(String configurationFile)
|
|
|
throws YarnException, IOException {
|
|
|
InputStream configurationInputStream =
|