use of com.thinkbiganalytics.jobrepo.query.model.DefaultExecutedJob in project kylo by Teradata.
the class JobModelTransform method executedJob.
public static ExecutedJob executedJob(LatestFeedJobExecution jobExecution) {
DefaultExecutedJob executedJob = new DefaultExecutedJob();
executedJob.setExecutionId(jobExecution.getJobExecutionId());
executedJob.setStartTime(jobExecution.getStartTime());
executedJob.setEndTime(jobExecution.getEndTime());
executedJob.setExitCode(jobExecution.getExitCode().name());
executedJob.setExitStatus(jobExecution.getExitMessage());
executedJob.setStatus(ExecutionStatus.valueOf(jobExecution.getStatus().name()));
executedJob.setJobName(jobExecution.getFeedName());
executedJob.setRunTime(ModelUtils.runTime(jobExecution.getStartTime(), jobExecution.getEndTime()));
executedJob.setTimeSinceEndTime(ModelUtils.timeSince(jobExecution.getStartTime(), jobExecution.getEndTime()));
executedJob.setInstanceId(jobExecution.getJobInstanceId());
executedJob.setStream(jobExecution.isStream());
executedJob.setFeedId(jobExecution.getFeedId());
executedJob.setFeedName(jobExecution.getFeedName());
return executedJob;
}
use of com.thinkbiganalytics.jobrepo.query.model.DefaultExecutedJob in project kylo by Teradata.
the class IntegrationTestBase method getJobs.
protected DefaultExecutedJob[] getJobs() {
// http://localhost:8400/proxy/v1/jobs
Response response = given(JobsRestController.BASE).when().get();
response.then().statusCode(HTTP_OK);
return JsonPath.from(response.asString()).getObject("data", DefaultExecutedJob[].class);
}
use of com.thinkbiganalytics.jobrepo.query.model.DefaultExecutedJob in project kylo by Teradata.
the class FeedWithConnectedReusableTemplateIT method assertExecutedJobs.
private void assertExecutedJobs(FeedMetadata feed) throws IOException {
DefaultExecutedJob[] jobs = getJobs(feed.getCategoryAndFeedName().toLowerCase());
DefaultExecutedJob ingest = Arrays.stream(jobs).findFirst().orElse(null);
Assert.assertNotNull(ingest);
Assert.assertEquals(ExecutionStatus.COMPLETED, ingest.getStatus());
Assert.assertEquals(ExitStatus.COMPLETED.getExitCode(), ingest.getExitCode());
LOG.info("Asserting user data jobs has expected number of steps");
DefaultExecutedJob job = getJobWithSteps(ingest.getExecutionId());
Assert.assertEquals(ingest.getExecutionId(), job.getExecutionId());
List<ExecutedStep> steps = job.getExecutedSteps();
Assert.assertEquals(8, steps.size());
for (ExecutedStep step : steps) {
Assert.assertEquals(ExitStatus.COMPLETED.getExitCode(), step.getExitCode());
}
}
use of com.thinkbiganalytics.jobrepo.query.model.DefaultExecutedJob in project kylo by Teradata.
the class JobModelTransform method executedJob.
public static ExecutedJob executedJob(BatchJobExecution jobExecution) {
DefaultExecutedJob job = (DefaultExecutedJob) executedJobSimple(jobExecution);
Map<String, String> jobExecutionContext = jobExecution.getJobExecutionContextAsMap();
if (jobExecutionContext != null) {
job.setExecutionContext(new HashMap<>(jobExecutionContext));
}
OpsManagerFeed feed = jobExecution.getJobInstance().getFeed();
if (feed != null) {
job.setJobType(feed.getFeedType().name());
}
Map<String, String> jobParams = jobExecution.getJobParametersAsMap();
if (jobParams != null) {
job.setJobParameters(new HashMap<>(jobParams));
}
job.setExecutedSteps(executedSteps(jobExecution.getStepExecutions()));
return job;
}
use of com.thinkbiganalytics.jobrepo.query.model.DefaultExecutedJob in project kylo by Teradata.
the class JobModelTransform method executedJobSimple.
public static ExecutedJob executedJobSimple(BatchJobExecution jobExecution) {
DefaultExecutedJob job = new DefaultExecutedJob();
job.setExecutionId(jobExecution.getJobExecutionId());
job.setStartTime(jobExecution.getStartTime());
job.setEndTime(jobExecution.getEndTime());
job.setCreateTime(jobExecution.getCreateTime());
job.setExitCode(jobExecution.getExitCode().name());
job.setExitStatus(jobExecution.getExitMessage());
job.setStatus(ExecutionStatus.valueOf(jobExecution.getStatus().name()));
job.setJobName(jobExecution.getJobInstance().getJobName());
job.setRunTime(ModelUtils.runTime(jobExecution.getStartTime(), jobExecution.getEndTime()));
job.setTimeSinceEndTime(ModelUtils.timeSince(jobExecution.getStartTime(), jobExecution.getEndTime()));
job.setInstanceId(jobExecution.getJobInstance().getJobInstanceId());
job.setStream(jobExecution.isStream());
if (jobExecution.getJobInstance() != null && jobExecution.getJobInstance().getFeed() != null) {
job.setFeedName(jobExecution.getJobInstance().getFeed().getName());
job.setFeedId(jobExecution.getJobInstance().getFeed().getId().toString());
}
return job;
}
Aggregations