Package com.vmware.bdd.plugin.ambari.api.model.cluster

Examples of com.vmware.bdd.plugin.ambari.api.model.cluster.ApiTaskInfo


   @Override
   public ApiRequest getRequestWithTasks(String clusterName, Long requestId) throws AmbariApiException {
      ApiRequest apiRequest = new ApiRequest();
      List<ApiTask> apiTasks = new ArrayList<>();
      ApiTask apiTask = new ApiTask();
      ApiTaskInfo taskInfo = new ApiTaskInfo();
      taskInfo.setStatus("FAILED");
      taskInfo.setHostName("host01");
      apiTask.setApiTaskInfo(taskInfo);
      apiTasks.add(apiTask);
      apiRequest.setApiTasks(apiTasks);
      ApiRequestInfo apiRequestInfo = new ApiRequestInfo();
      apiRequestInfo.setRequestStatus("FAILED");
View Full Code Here


         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());
View Full Code Here

      Map<String, NodeReport> nodeReports = currentReport.getNodeReports();
      for (String nodeReportKey : nodeReports.keySet()) {
         for (ApiTask apiTask : apiRequest.getApiTasks()) {
            NodeReport nodeReport = nodeReports.get(nodeReportKey);
            nodeReport.setUseClusterMsg(false);
            ApiTaskInfo apiTaskInfo = apiTask.getApiTaskInfo();
            if (nodeReport.getHostname().equals(apiTaskInfo.getHostName())) {
               TaskStatus taskStatus =
                     TaskStatus.valueOf(apiTask.getApiTaskInfo().getStatus());
               if (taskStatus.isRunningState()) {
                  if (clusterRequestStatus.isFailedState() &&
                        apiTaskInfo.getStderr() != null &&
                        !apiTaskInfo.getStderr().isEmpty()) {
                     nodeReport.setAction(apiTaskInfo.getCommandDetail() + ": "
                           + apiTaskInfo.getStderr());
                  } else {
                     nodeReport.setAction(apiTaskInfo.getCommandDetail());
                  }
                  nodeReports.put(nodeReportKey, nodeReport);
               }
            }
         }
View Full Code Here

TOP

Related Classes of com.vmware.bdd.plugin.ambari.api.model.cluster.ApiTaskInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.