@Override
protected YarnConfiguration performBuild() throws Exception {
ConfigurationFactoryBean fb = new ConfigurationFactoryBean();
if (!loadDefaults) {
fb.setConfiguration(new YarnConfiguration(new Configuration(false)));
}
fb.setResources(resources);
fb.setProperties(properties);
fb.setFsUri(fileSystemUri);
fb.setRmAddress(rmAddress);
fb.setSchedulerAddress(schedulerAddress);
if (hadoopSecurity != null) {
fb.setSecurityAuthMethod(hadoopSecurity.getSecurityAuthMethod());
fb.setUserPrincipal(hadoopSecurity.getUserPrincipal());
fb.setUserKeytab(hadoopSecurity.getUserKeytab());
fb.setNamenodePrincipal(hadoopSecurity.getNamenodePrincipal());
fb.setRmManagerPrincipal(hadoopSecurity.getRmManagerPrincipal());
}
fb.afterPropertiesSet();
YarnConfiguration c = fb.getObject();
c = postProcess(c);
return c;
}