Search in sources :

Example 1 with DefaultExecutedStep

use of com.thinkbiganalytics.jobrepo.query.model.DefaultExecutedStep in project kylo by Teradata.

the class JobModelTransform method executedStep.

public static ExecutedStep executedStep(BatchStepExecution stepExecution) {
    DefaultExecutedStep step = new DefaultExecutedStep();
    NifiEventStepExecution nifiEventStepExecution = stepExecution.getNifiEventStepExecution();
    if (nifiEventStepExecution != null) {
        step.setNifiEventId(nifiEventStepExecution.getEventId());
    }
    step.setRunning(!stepExecution.isFinished());
    step.setStartTime(stepExecution.getStartTime());
    step.setEndTime(stepExecution.getEndTime());
    step.setLastUpdateTime(stepExecution.getLastUpdated());
    step.setVersion(stepExecution.getVersion().intValue());
    step.setStepName(stepExecution.getStepName());
    step.setExitDescription(stepExecution.getExitMessage());
    step.setExitCode(stepExecution.getExitCode().name());
    step.setId(stepExecution.getStepExecutionId());
    step.setTimeSinceEndTime(ModelUtils.timeSince(stepExecution.getStartTime(), stepExecution.getEndTime()));
    step.setRunTime(ModelUtils.runTime(stepExecution.getStartTime(), stepExecution.getEndTime()));
    Map<String, String> stepExecutionContext = stepExecution.getStepExecutionContextAsMap();
    if (stepExecutionContext != null) {
        step.setExecutionContext(new HashMap<>(stepExecutionContext));
    }
    return step;
}
Also used : DefaultExecutedStep(com.thinkbiganalytics.jobrepo.query.model.DefaultExecutedStep) NifiEventStepExecution(com.thinkbiganalytics.metadata.api.jobrepo.nifi.NifiEventStepExecution)

Aggregations

DefaultExecutedStep (com.thinkbiganalytics.jobrepo.query.model.DefaultExecutedStep)1 NifiEventStepExecution (com.thinkbiganalytics.metadata.api.jobrepo.nifi.NifiEventStepExecution)1