public StepExecutionInfoResponse()

in ambari-infra-manager/src/main/java/org/apache/ambari/infra/model/StepExecutionInfoResponse.java [53:77]


  public StepExecutionInfoResponse(StepExecution stepExecution) {
    this.stepExecutionId = stepExecution.getId();
    this.stepName = stepExecution.getStepName();
    this.jobName = stepExecution.getJobExecution() != null && stepExecution.getJobExecution().getJobInstance() != null ? stepExecution.getJobExecution().getJobInstance().getJobName() : "?";
    this.jobExecutionId = stepExecution.getJobExecutionId();
    this.startTime = toOffsetDateTime(stepExecution.getStartTime());
    this.endTime = toOffsetDateTime(stepExecution.getEndTime());

    if(this.startTime != null && this.endTime != null) {
      this.duration = Duration.between(this.startTime, this.endTime);
    }
    else {
      this.duration = null;
    }

    this.batchStatus = stepExecution.getStatus();
    if (stepExecution.getExitStatus() != null) {
      this.exitCode = stepExecution.getExitStatus().getExitCode();
      this.exitDescription = stepExecution.getExitStatus().getExitDescription();
    }
    else {
      this.exitCode = null;
      this.exitDescription = null;
    }
  }