protected YarnAppmaster performBuild() throws Exception {
YarnAppmaster appmaster = BeanUtils.instantiate(appmasterClass);
if (appmaster instanceof AbstractAppmaster) {
AbstractAppmaster abstractAppmaster = (AbstractAppmaster) appmaster;
for (Entry<String, String[]> entry : commands.entrySet()) {
abstractAppmaster.setCommands(entry.getKey(), entry.getValue());
}
for (Entry<String, Map<String, String>> entry : environments.entrySet()) {
abstractAppmaster.setEnvironment(entry.getKey(), entry.getValue());
}
abstractAppmaster.setConfiguration(configuration);
abstractAppmaster.setResourceLocalizer(resourceLocalizer);
if (appmaster instanceof AbstractServicesAppmaster) {
AbstractServicesAppmaster abstractServicesAppmaster = (AbstractServicesAppmaster)appmaster;
DefaultContainerLauncher launcher = new DefaultContainerLauncher();
launcher.setConfiguration(configuration);