logger.error("Failed to do request: " + ApiUtils.objectToJson(apiRequest.getApiRequestInfo()));
List<ApiTask> apiTasks = apiRequest.getApiTasks();
Map<String, NodeReport> nodeReports = clusterReport.getNodeReports();
HashMap<String, List<String>> errMsg = new HashMap<>();
for (ApiTask apiTask : apiTasks) {
ApiTaskInfo taskInfo = apiTask.getApiTaskInfo();
if (TaskStatus.valueOf(taskInfo.getStatus()).isFailedState()) {
if (!errMsg.containsKey(taskInfo.getHostName())) {
List<String> errs = new ArrayList<>();
errMsg.put(taskInfo.getHostName(), errs);
}
String taskErrMsg = taskInfo.getCommandDetail() + " " + taskInfo.getStatus();
errMsg.get(taskInfo.getHostName()).add(taskErrMsg);
logger.error("command: " + taskInfo.getCommandDetail() +
"role: " + taskInfo.getRole() +
"stderr: " + taskInfo.getStderr() +
"status: " + taskInfo.getStatus());
}
}
for (NodeReport nodeReport: nodeReports.values()) {
if (errMsg.containsKey(nodeReport.getHostname())) {
nodeReport.setErrMsg(errMsg.get(nodeReport.getHostname()).toString());