stage.addHostRoleExecutionCommand(scHost.getHostName(), Role.valueOf(scHost
.getServiceComponentName()), command,
event, scHost.getClusterName(),
scHost.getServiceName());
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);
}
execCmd.setConfigurations(configurations);
execCmd.setConfigurationTags(configTags);
execCmd.setCommandParams(commandParams);
// send stack info to agent
StackId stackId = scHost.getDesiredStackVersion();
Map<String, List<RepositoryInfo>> repos = ambariMetaInfo.getRepository(
stackId.getStackName(), stackId.getStackVersion());
String repoInfo = "";
if (!repos.containsKey(host.getOsType())) {
// FIXME should this be an error?
LOG.warn("Could not retrieve repo information for host"
+ ", hostname=" + scHost.getHostName()
+ ", clusterName=" + cluster.getClusterName()
+ ", stackInfo=" + stackId.getStackId());
} else {
repoInfo = gson.toJson(repos.get(host.getOsType()));
}
if (LOG.isDebugEnabled()) {
LOG.debug("Sending repo information to agent"
+ ", hostname=" + scHost.getHostName()
+ ", clusterName=" + cluster.getClusterName()
+ ", stackInfo=" + stackId.getStackId()
+ ", repoInfo=" + repoInfo);
}
Map<String, String> params = new TreeMap<String, String>();
params.put("repo_info", repoInfo);
params.put("jdk_location", jdkResourceUrl);
params.put("stack_version", stackId.getStackVersion());
params.put("db_name", serverDB);
params.put("mysql_jdbc_url" , mysqljdbcUrl);
params.put("oracle_jdbc_url", ojdbcUrl);
if (configs.getServerDBName().equalsIgnoreCase(Configuration
.ORACLE_DB_NAME)) {
params.put("db_driver_filename", configs.getOjdbcJarName());
} else if (configs.getServerDBName().equalsIgnoreCase(Configuration
.MYSQL_DB_NAME)) {
params.put("db_driver_filename", configs.getMySQLJarName());
}
execCmd.setHostLevelParams(params);
Map<String, String> roleParams = new TreeMap<String, String>();
execCmd.setRoleParams(roleParams);
}