Package io.kestra.jdbc.repository
Class AbstractJdbcExecutionRepository
java.lang.Object
io.kestra.jdbc.repository.AbstractJdbcRepository
io.kestra.jdbc.repository.AbstractJdbcExecutionRepository
- All Implemented Interfaces:
io.kestra.core.repositories.ExecutionRepositoryInterface,io.kestra.core.repositories.SaveRepositoryInterface<io.kestra.core.models.executions.Execution>,JdbcIndexerInterface<io.kestra.core.models.executions.Execution>
public abstract class AbstractJdbcExecutionRepository
extends AbstractJdbcRepository
implements io.kestra.core.repositories.ExecutionRepositoryInterface, JdbcIndexerInterface<io.kestra.core.models.executions.Execution>
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.kestra.core.repositories.ExecutionRepositoryInterface
io.kestra.core.repositories.ExecutionRepositoryInterface.ChildFilter, io.kestra.core.repositories.ExecutionRepositoryInterface.FlowFilter -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final AbstractJdbcExecutorStateStorageprotected final AbstractJdbcRepository<io.kestra.core.models.executions.Execution> -
Constructor Summary
ConstructorsConstructorDescriptionAbstractJdbcExecutionRepository(AbstractJdbcRepository<io.kestra.core.models.executions.Execution> jdbcRepository, io.micronaut.context.ApplicationContext applicationContext, AbstractJdbcExecutorStateStorage executorStateStorage) -
Method Summary
Modifier and TypeMethodDescriptiondailyGroupByFlowStatistics(String query, String tenantId, String namespace, String flowId, List<io.kestra.core.repositories.ExecutionRepositoryInterface.FlowFilter> flows, ZonedDateTime startDate, ZonedDateTime endDate, boolean groupByNamespaceOnly) List<io.kestra.core.models.executions.statistics.DailyExecutionStatistics> dailyStatistics(String query, String tenantId, List<io.kestra.core.models.flows.FlowScope> scope, String namespace, String flowId, ZonedDateTime startDate, ZonedDateTime endDate, io.kestra.core.utils.DateUtils.GroupType groupBy, List<io.kestra.core.models.flows.State.Type> states, boolean isTaskRun) List<io.kestra.core.models.executions.statistics.DailyExecutionStatistics> dailyStatisticsForAllTenants(String query, String namespace, String flowId, ZonedDateTime startDate, ZonedDateTime endDate, io.kestra.core.utils.DateUtils.GroupType groupBy, boolean isTaskRun) io.kestra.core.models.executions.Executiondelete(io.kestra.core.models.executions.Execution execution) List<io.kestra.core.models.executions.statistics.ExecutionCount> executionCounts(String tenantId, List<io.kestra.core.models.executions.statistics.Flow> flows, List<io.kestra.core.models.flows.State.Type> states, ZonedDateTime startDate, ZonedDateTime endDate) executionCountsGroupedByNamespace(String tenantId, String namespace, ZonedDateTime startDate, ZonedDateTime endDate) io.kestra.core.repositories.ArrayListTotal<io.kestra.core.models.executions.Execution> find(io.micronaut.data.model.Pageable pageable, String query, String tenantId, List<io.kestra.core.models.flows.FlowScope> scope, String namespace, String flowId, ZonedDateTime startDate, ZonedDateTime endDate, List<io.kestra.core.models.flows.State.Type> state, Map<String, String> labels, String triggerExecutionId, io.kestra.core.repositories.ExecutionRepositoryInterface.ChildFilter childFilter) reactor.core.publisher.Flux<io.kestra.core.models.executions.Execution> find(String query, String tenantId, List<io.kestra.core.models.flows.FlowScope> scope, String namespace, String flowId, ZonedDateTime startDate, ZonedDateTime endDate, List<io.kestra.core.models.flows.State.Type> state, Map<String, String> labels, String triggerExecutionId, io.kestra.core.repositories.ExecutionRepositoryInterface.ChildFilter childFilter, boolean deleted) reactor.core.publisher.Flux<io.kestra.core.models.executions.Execution> findAllByTriggerExecutionId(String tenantId, String triggerExecutionId) io.kestra.core.repositories.ArrayListTotal<io.kestra.core.models.executions.Execution> findByFlowId(String tenantId, String namespace, String id, io.micronaut.data.model.Pageable pageable) Optional<io.kestra.core.models.executions.Execution> protected abstract org.jooq.ConditionfindCondition(String query, Map<String, String> labels) io.kestra.core.repositories.ArrayListTotal<io.kestra.core.models.executions.TaskRun> findTaskRun(io.micronaut.data.model.Pageable pageable, String query, String tenantId, String namespace, String flowId, ZonedDateTime startDate, ZonedDateTime endDate, List<io.kestra.core.models.flows.State.Type> states, Map<String, String> labels, String triggerExecutionId, io.kestra.core.repositories.ExecutionRepositoryInterface.ChildFilter childFilter) List<io.kestra.core.models.executions.Execution> lastExecutions(String tenantId, List<io.kestra.core.repositories.ExecutionRepositoryInterface.FlowFilter> flows) io.kestra.core.runners.Executorlock(String executionId, Function<org.apache.commons.lang3.tuple.Pair<io.kestra.core.models.executions.Execution, io.kestra.core.runners.ExecutorState>, org.apache.commons.lang3.tuple.Pair<io.kestra.core.runners.Executor, io.kestra.core.runners.ExecutorState>> function) purge(io.kestra.core.models.executions.Execution execution) io.kestra.core.models.executions.Executionsave(io.kestra.core.models.executions.Execution execution) io.kestra.core.models.executions.Executionsave(org.jooq.DSLContext dslContext, io.kestra.core.models.executions.Execution execution) protected org.jooq.ConditionstatesFilter(List<io.kestra.core.models.flows.State.Type> state) io.kestra.core.models.executions.Executionupdate(io.kestra.core.models.executions.Execution execution) Methods inherited from class io.kestra.jdbc.repository.AbstractJdbcRepository
buildTenantCondition, defaultFilter, defaultFilter, defaultFilter, defaultFilter, field, field, groupByFields, groupByFields, groupByFields, groupByFields, weekFromTimestampMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.kestra.core.repositories.ExecutionRepositoryInterface
find, findById
-
Field Details
-
jdbcRepository
-
executorStateStorage
-
-
Constructor Details
-
AbstractJdbcExecutionRepository
public AbstractJdbcExecutionRepository(AbstractJdbcRepository<io.kestra.core.models.executions.Execution> jdbcRepository, io.micronaut.context.ApplicationContext applicationContext, AbstractJdbcExecutorStateStorage executorStateStorage)
-
-
Method Details
-
isTaskRunEnabled
- Specified by:
isTaskRunEnabledin interfaceio.kestra.core.repositories.ExecutionRepositoryInterface
-
findAllByTriggerExecutionId
public reactor.core.publisher.Flux<io.kestra.core.models.executions.Execution> findAllByTriggerExecutionId(String tenantId, String triggerExecutionId) - Specified by:
findAllByTriggerExecutionIdin interfaceio.kestra.core.repositories.ExecutionRepositoryInterface
-
findById
public Optional<io.kestra.core.models.executions.Execution> findById(String tenantId, String id, boolean allowDeleted) - Specified by:
findByIdin interfaceio.kestra.core.repositories.ExecutionRepositoryInterface
-
findCondition
-
statesFilter
-
find
public io.kestra.core.repositories.ArrayListTotal<io.kestra.core.models.executions.Execution> find(io.micronaut.data.model.Pageable pageable, @Nullable String query, @Nullable String tenantId, @Nullable List<io.kestra.core.models.flows.FlowScope> scope, @Nullable String namespace, @Nullable String flowId, @Nullable ZonedDateTime startDate, @Nullable ZonedDateTime endDate, @Nullable List<io.kestra.core.models.flows.State.Type> state, @Nullable Map<String, String> labels, @Nullable String triggerExecutionId, @Nullable io.kestra.core.repositories.ExecutionRepositoryInterface.ChildFilter childFilter) - Specified by:
findin interfaceio.kestra.core.repositories.ExecutionRepositoryInterface
-
find
public reactor.core.publisher.Flux<io.kestra.core.models.executions.Execution> find(@Nullable String query, @Nullable String tenantId, @Nullable List<io.kestra.core.models.flows.FlowScope> scope, @Nullable String namespace, @Nullable String flowId, @Nullable ZonedDateTime startDate, @Nullable ZonedDateTime endDate, @Nullable List<io.kestra.core.models.flows.State.Type> state, @Nullable Map<String, String> labels, @Nullable String triggerExecutionId, @Nullable io.kestra.core.repositories.ExecutionRepositoryInterface.ChildFilter childFilter, boolean deleted) - Specified by:
findin interfaceio.kestra.core.repositories.ExecutionRepositoryInterface
-
findByFlowId
public io.kestra.core.repositories.ArrayListTotal<io.kestra.core.models.executions.Execution> findByFlowId(String tenantId, String namespace, String id, io.micronaut.data.model.Pageable pageable) - Specified by:
findByFlowIdin interfaceio.kestra.core.repositories.ExecutionRepositoryInterface
-
findTaskRun
public io.kestra.core.repositories.ArrayListTotal<io.kestra.core.models.executions.TaskRun> findTaskRun(io.micronaut.data.model.Pageable pageable, @Nullable String query, @Nullable String tenantId, @Nullable String namespace, @Nullable String flowId, @Nullable ZonedDateTime startDate, @Nullable ZonedDateTime endDate, @Nullable List<io.kestra.core.models.flows.State.Type> states, @Nullable Map<String, String> labels, @Nullable String triggerExecutionId, @Nullable io.kestra.core.repositories.ExecutionRepositoryInterface.ChildFilter childFilter) - Specified by:
findTaskRunin interfaceio.kestra.core.repositories.ExecutionRepositoryInterface
-
maxTaskRunSetting
- Specified by:
maxTaskRunSettingin interfaceio.kestra.core.repositories.ExecutionRepositoryInterface
-
dailyStatisticsForAllTenants
public List<io.kestra.core.models.executions.statistics.DailyExecutionStatistics> dailyStatisticsForAllTenants(@Nullable String query, @Nullable String namespace, @Nullable String flowId, @Nullable ZonedDateTime startDate, @Nullable ZonedDateTime endDate, @Nullable io.kestra.core.utils.DateUtils.GroupType groupBy, boolean isTaskRun) - Specified by:
dailyStatisticsForAllTenantsin interfaceio.kestra.core.repositories.ExecutionRepositoryInterface
-
dailyStatistics
public List<io.kestra.core.models.executions.statistics.DailyExecutionStatistics> dailyStatistics(@Nullable String query, @Nullable String tenantId, @Nullable List<io.kestra.core.models.flows.FlowScope> scope, @Nullable String namespace, @Nullable String flowId, @Nullable ZonedDateTime startDate, @Nullable ZonedDateTime endDate, @Nullable io.kestra.core.utils.DateUtils.GroupType groupBy, @Nullable List<io.kestra.core.models.flows.State.Type> states, boolean isTaskRun) - Specified by:
dailyStatisticsin interfaceio.kestra.core.repositories.ExecutionRepositoryInterface
-
executionCountsGroupedByNamespace
public Map<String,io.kestra.core.models.executions.statistics.ExecutionCountStatistics> executionCountsGroupedByNamespace(@Nullable String tenantId, @Nullable String namespace, @Nullable ZonedDateTime startDate, @Nullable ZonedDateTime endDate) - Specified by:
executionCountsGroupedByNamespacein interfaceio.kestra.core.repositories.ExecutionRepositoryInterface
-
dailyGroupByFlowStatistics
public Map<String,Map<String, dailyGroupByFlowStatisticsList<io.kestra.core.models.executions.statistics.DailyExecutionStatistics>>> (@Nullable String query, @Nullable String tenantId, @Nullable String namespace, @Nullable String flowId, @Nullable List<io.kestra.core.repositories.ExecutionRepositoryInterface.FlowFilter> flows, @Nullable ZonedDateTime startDate, @Nullable ZonedDateTime endDate, boolean groupByNamespaceOnly) - Specified by:
dailyGroupByFlowStatisticsin interfaceio.kestra.core.repositories.ExecutionRepositoryInterface
-
executionCounts
public List<io.kestra.core.models.executions.statistics.ExecutionCount> executionCounts(@Nullable String tenantId, List<io.kestra.core.models.executions.statistics.Flow> flows, @Nullable List<io.kestra.core.models.flows.State.Type> states, @Nullable ZonedDateTime startDate, @Nullable ZonedDateTime endDate) - Specified by:
executionCountsin interfaceio.kestra.core.repositories.ExecutionRepositoryInterface
-
lastExecutions
public List<io.kestra.core.models.executions.Execution> lastExecutions(@Nullable String tenantId, List<io.kestra.core.repositories.ExecutionRepositoryInterface.FlowFilter> flows) - Specified by:
lastExecutionsin interfaceio.kestra.core.repositories.ExecutionRepositoryInterface
-
save
public io.kestra.core.models.executions.Execution save(io.kestra.core.models.executions.Execution execution) - Specified by:
savein interfaceio.kestra.core.repositories.ExecutionRepositoryInterface- Specified by:
savein interfaceio.kestra.core.repositories.SaveRepositoryInterface<io.kestra.core.models.executions.Execution>
-
save
public io.kestra.core.models.executions.Execution save(org.jooq.DSLContext dslContext, io.kestra.core.models.executions.Execution execution) - Specified by:
savein interfaceJdbcIndexerInterface<io.kestra.core.models.executions.Execution>
-
update
public io.kestra.core.models.executions.Execution update(io.kestra.core.models.executions.Execution execution) - Specified by:
updatein interfaceio.kestra.core.repositories.ExecutionRepositoryInterface
-
delete
public io.kestra.core.models.executions.Execution delete(io.kestra.core.models.executions.Execution execution) - Specified by:
deletein interfaceio.kestra.core.repositories.ExecutionRepositoryInterface
-
purge
- Specified by:
purgein interfaceio.kestra.core.repositories.ExecutionRepositoryInterface
-
lock
public io.kestra.core.runners.Executor lock(String executionId, Function<org.apache.commons.lang3.tuple.Pair<io.kestra.core.models.executions.Execution, io.kestra.core.runners.ExecutorState>, org.apache.commons.lang3.tuple.Pair<io.kestra.core.runners.Executor, io.kestra.core.runners.ExecutorState>> function) -
sortMapping
- Specified by:
sortMappingin interfaceio.kestra.core.repositories.ExecutionRepositoryInterface- Throws:
IllegalArgumentException
-