use of com.thinkbiganalytics.metadata.jpa.jobrepo.job.QJpaBatchJobExecution in project kylo by Teradata.
the class OpsFeedManagerFeedProvider method getJobStatusCountByDateFromNow.
public List<JobStatusCount> getJobStatusCountByDateFromNow(String feedName, ReadablePeriod period) {
QJpaBatchJobExecution jobExecution = QJpaBatchJobExecution.jpaBatchJobExecution;
QJpaBatchJobInstance jobInstance = QJpaBatchJobInstance.jpaBatchJobInstance;
QJpaOpsManagerFeed feed = QJpaOpsManagerFeed.jpaOpsManagerFeed;
JPAQuery query = factory.select(Projections.constructor(JpaBatchJobExecutionStatusCounts.class, JobStatusDslQueryExpressionBuilder.jobState().as("status"), Expressions.constant(feedName), jobExecution.startYear, jobExecution.startMonth, jobExecution.startDay, jobExecution.count().as("count"))).from(jobExecution).innerJoin(jobInstance).on(jobExecution.jobInstance.jobInstanceId.eq(jobInstance.jobInstanceId)).innerJoin(feed).on(jobInstance.feed.id.eq(feed.id)).where(jobExecution.startTime.goe(DateTime.now().minus(period)).and(feed.name.eq(feedName)).and(FeedAclIndexQueryAugmentor.generateExistsExpression(feed.id, accessController.isEntityAccessControlled()))).groupBy(jobExecution.status, jobExecution.startYear, jobExecution.startMonth, jobExecution.startDay);
return (List<JobStatusCount>) query.fetch();
}
use of com.thinkbiganalytics.metadata.jpa.jobrepo.job.QJpaBatchJobExecution in project kylo by Teradata.
the class JpaBatchJobExecutionTest method testFilters.
@WithMockJaasUser(username = "dladmin", password = "secret", authorities = { "admin" })
@Test
public void testFilters() {
operationalMetadataAccess.read(() -> {
QJpaBatchJobExecution jobExecution = QJpaBatchJobExecution.jpaBatchJobExecution;
BooleanBuilder builder = GenericQueryDslFilter.buildFilter(jobExecution, "status==\"COMPLETED,FAILED\"");
int i = 0;
return null;
});
}
Aggregations