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>
@Singleton
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.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, 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) io.kestra.core.repositories.ArrayListTotal<io.kestra.core.models.executions.Execution>find(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> state, Map<String, String> labels, String triggerExecutionId) io.reactivex.Flowable<io.kestra.core.models.executions.Execution>find(String query, String tenantId, 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.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) 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) Methods inherited from class io.kestra.jdbc.repository.AbstractJdbcRepository
buildTenantCondition, defaultFilter, defaultFilter, field, field, groupByFields, groupByFields
-
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
-
findById
- 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 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) - Specified by:
findin interfaceio.kestra.core.repositories.ExecutionRepositoryInterface
-
find
public io.reactivex.Flowable<io.kestra.core.models.executions.Execution> find(@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> state, @Nullable Map<String, String> labels, @Nullable String triggerExecutionId) - 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) - Specified by:
findTaskRunin interfaceio.kestra.core.repositories.ExecutionRepositoryInterface
-
maxTaskRunSetting
- Specified by:
maxTaskRunSettingin interfaceio.kestra.core.repositories.ExecutionRepositoryInterface
-
dailyStatistics
public List<io.kestra.core.models.executions.statistics.DailyExecutionStatistics> dailyStatistics(@Nullable String query, @Nullable String tenantId, @Nullable String namespace, @Nullable String flowId, @Nullable ZonedDateTime startDate, @Nullable ZonedDateTime endDate, @Nullable io.kestra.core.utils.DateUtils.GroupType groupBy, boolean isTaskRun) - Specified by:
dailyStatisticsin 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>
-
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
-