ServiceInfo serviceInfo = ambariMetaInfo.getServiceInfo(stackId.getStackName(),
stackId.getStackVersion(), serviceName);
ComponentInfo componentInfo = ambariMetaInfo.getComponent(
stackId.getStackName(), stackId.getStackVersion(),
serviceName, componentName);
StackInfo stackInfo = ambariMetaInfo.getStackInfo(stackId.getStackName(),
stackId.getStackVersion());
ExecutionCommand execCmd = stage.getExecutionCommandWrapper(scHost.getHostName(),
scHost.getServiceComponentName()).getExecutionCommand();
Host host = clusters.getHost(scHost.getHostName());
// Hack - Remove passwords from configs
if (event.getServiceComponentName().equals(Role.HIVE_CLIENT.toString())) {
configHelper.applyCustomConfig(configurations, Configuration.HIVE_CONFIG_TAG,
Configuration.HIVE_METASTORE_PASSWORD_PROPERTY, "", true);
}
String jobtrackerHost = getJobTrackerHost(cluster);
if (!scHost.getHostName().equals(jobtrackerHost)) {
if (configTags.get(Configuration.GLOBAL_CONFIG_TAG) != null) {
configHelper.applyCustomConfig(
configurations, Configuration.GLOBAL_CONFIG_TAG,
Configuration.RCA_ENABLED_PROPERTY, "false", false);
}
}
execCmd.setConfigurations(configurations);
execCmd.setConfigurationTags(configTags);
if (commandParams == null) { // if not defined
commandParams = new TreeMap<String, String>();
}
String commandTimeout = configs.getDefaultAgentTaskTimeout();
/*
* This script is only used for
* default commads like INSTALL/STOP/START
*/
CommandScriptDefinition script = componentInfo.getCommandScript();
if (serviceInfo.getSchemaVersion().equals(AmbariMetaInfo.SCHEMA_VERSION_2)) {
if (script != null) {
commandParams.put(SCRIPT, script.getScript());
commandParams.put(SCRIPT_TYPE, script.getScriptType().toString());
if (script.getTimeout() > 0) {
commandTimeout = String.valueOf(script.getTimeout());
}
} else {
String message = String.format("Component %s of service %s has no " +
"command script defined", componentName, serviceName);
throw new AmbariException(message);
}
}
commandParams.put(COMMAND_TIMEOUT, commandTimeout);
commandParams.put(SERVICE_PACKAGE_FOLDER,
serviceInfo.getServicePackageFolder());
commandParams.put(HOOKS_FOLDER, stackInfo.getStackHooksFolder());
execCmd.setCommandParams(commandParams);
String repoInfo = customCommandExecutionHelper.getRepoInfo(cluster, host);
if (LOG.isDebugEnabled()) {