stage.addHostRoleExecutionCommand(scHost.getHostName(), Role.valueOf(scHost
.getServiceComponentName()), command,
event, scHost.getClusterName(),
scHost.getServiceName());
ExecutionCommand execCmd = stage.getExecutionCommandWrapper(scHost.getHostName(),
scHost.getServiceComponentName()).getExecutionCommand();
// Generate cluster host info
execCmd.setClusterHostInfo(
StageUtils.getClusterHostInfo(cluster, hostsMap));
Host host = clusters.getHost(scHost.getHostName());
execCmd.setConfigurations(configurations);
// 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", this.jdkResourceUrl);
execCmd.setHostLevelParams(params);
Map<String, String> roleParams = new TreeMap<String, String>();
execCmd.setRoleParams(roleParams);
return;
}