Task Repository Schema
This appendix provides an ERD for the database schema used in the task repository.
Table Information
Stores the task execution information.
Column Name | Required | Type | Field Length | Notes |
---|---|---|---|---|
TASK_EXECUTION_ID |
TRUE |
BIGINT |
X |
Spring Cloud Task Framework at app startup establishes the next available id as obtained from the |
START_TIME |
FALSE |
DATETIME(6) |
X |
Spring Cloud Task Framework at app startup establishes the value. |
END_TIME |
FALSE |
DATETIME(6) |
X |
Spring Cloud Task Framework at app exit establishes the value. |
TASK_NAME |
FALSE |
VARCHAR |
100 |
Spring Cloud Task Framework at app startup will set this to "Application" unless user establish the name using the |
EXIT_CODE |
FALSE |
INTEGER |
X |
Follows Spring Boot defaults unless overridden by the user as discussed here. |
EXIT_MESSAGE |
FALSE |
VARCHAR |
2500 |
User Defined as discussed here. |
ERROR_MESSAGE |
FALSE |
VARCHAR |
2500 |
Spring Cloud Task Framework at app exit establishes the value. |
LAST_UPDATED |
TRUE |
TIMESTAMP |
X |
Spring Cloud Task Framework at app startup establishes the value. Or if the record is created outside of task then the value must be populated at record creation time. |
EXTERNAL_EXECUTION_ID |
FALSE |
VARCHAR |
250 |
If the |
PARENT_TASK_EXECUTION_ID |
FALSE |
BIGINT |
X |
If the |
Stores the parameters used for a task execution
Column Name | Required | Type | Field Length |
---|---|---|---|
TASK_EXECUTION_ID |
TRUE |
BIGINT |
X |
TASK_PARAM |
FALSE |
VARCHAR |
2500 |
Used to link the task execution to the batch execution.
Column Name | Required | Type | Field Length |
---|---|---|---|
TASK_EXECUTION_ID |
TRUE |
BIGINT |
X |
JOB_EXECUTION_ID |
TRUE |
BIGINT |
X |
Used for the single-instance-enabled
feature discussed here.
Column Name | Required | Type | Field Length | Notes |
---|---|---|---|---|
LOCK_KEY |
TRUE |
CHAR |
36 |
UUID for the this lock |
REGION |
TRUE |
VARCHAR |
100 |
User can establish a group of locks using this field. |
CLIENT_ID |
TRUE |
CHAR |
36 |
The task execution id that contains the name of the app to lock. |
CREATED_DATE |
TRUE |
DATETIME |
X |
The date that the entry was created |
The DDL for setting up tables for each database type can be found here. |
SQL Server
By default Spring Cloud Task uses a sequence table for determining the TASK_EXECUTION_ID
for the TASK_EXECUTION
table.
However, when launching multiple tasks simultaneously while using SQL Server, this can cause a deadlock to occur on the TASK_SEQ
table.
The resolution is to drop the TASK_EXECUTION_SEQ
table and create a sequence using the same name. For example:
DROP TABLE TASK_SEQ;
CREATE SEQUENCE [DBO].[TASK_SEQ] AS BIGINT
START WITH 1
INCREMENT BY 1;
Set the START WITH to a higher value than your current execution id.
|
Building This Documentation
This project uses Maven to generate this documentation. To generate it for yourself,
run the following command: $ mvn clean install -DskipTests -P docs
.
Observability metadata
Observability - Metrics
Below you can find a list of all metrics declared by this project.
Task Active
Metrics created around a task execution.
Metric name spring.cloud.task
(defined by convention class org.springframework.cloud.task.listener.DefaultTaskExecutionObservationConvention
). Type timer
.
Metric name spring.cloud.task.active
(defined by convention class org.springframework.cloud.task.listener.DefaultTaskExecutionObservationConvention
). Type long task timer
.
KeyValues that are added after starting the Observation might be missing from the *.active metrics. |
Micrometer internally uses nanoseconds for the baseunit. However, each backend determines the actual baseunit. (i.e. Prometheus uses seconds)
|
Fully qualified name of the enclosing class org.springframework.cloud.task.listener.TaskExecutionObservation
.
All tags must be prefixed with spring.cloud.task prefix!
|
Name |
Description |
|
App id for CF cloud. |
|
App name for CF cloud. |
|
App version for CF cloud. |
|
Instance index for CF cloud. |
|
Organization Name for CF cloud. |
|
Space id for CF cloud. |
|
Space name for CF cloud. |
|
Task execution id. |
|
Task exit code. |
|
External execution id for task. |
|
Task name measurement. |
|
Task parent execution id. |
|
task status. Can be either success or failure. |
Task Runner Observation
Observation created when a task runner is executed.
Metric name spring.cloud.task.runner
(defined by convention class org.springframework.cloud.task.configuration.observation.DefaultTaskObservationConvention
). Type timer
.
Metric name spring.cloud.task.runner.active
(defined by convention class org.springframework.cloud.task.configuration.observation.DefaultTaskObservationConvention
). Type long task timer
.
KeyValues that are added after starting the Observation might be missing from the *.active metrics. |
Micrometer internally uses nanoseconds for the baseunit. However, each backend determines the actual baseunit. (i.e. Prometheus uses seconds)
|
Fully qualified name of the enclosing class org.springframework.cloud.task.configuration.observation.TaskDocumentedObservation
.
All tags must be prefixed with spring.cloud.task prefix!
|
Name |
Description |
|
Name of the bean that was executed by Spring Cloud Task. |
Observability - Spans
Below you can find a list of all spans declared by this project.
Task Active Span
Metrics created around a task execution.
Span name spring.cloud.task
(defined by convention class org.springframework.cloud.task.listener.DefaultTaskExecutionObservationConvention
).
Fully qualified name of the enclosing class org.springframework.cloud.task.listener.TaskExecutionObservation
.
All tags must be prefixed with spring.cloud.task prefix!
|
Name |
Description |
|
App id for CF cloud. |
|
App name for CF cloud. |
|
App version for CF cloud. |
|
Instance index for CF cloud. |
|
Organization Name for CF cloud. |
|
Space id for CF cloud. |
|
Space name for CF cloud. |
|
Task execution id. |
|
Task exit code. |
|
External execution id for task. |
|
Task name measurement. |
|
Task parent execution id. |
|
task status. Can be either success or failure. |
Task Runner Observation Span
Observation created when a task runner is executed.
Span name spring.cloud.task.runner
(defined by convention class org.springframework.cloud.task.configuration.observation.DefaultTaskObservationConvention
).
Fully qualified name of the enclosing class org.springframework.cloud.task.configuration.observation.TaskDocumentedObservation
.
All tags must be prefixed with spring.cloud.task prefix!
|
Name |
Description |
|
Name of the bean that was executed by Spring Cloud Task. |