Commit Graph

88 Commits

Author SHA1 Message Date
Gunnar Hillert
de1ebfb351 gh-424 Add the ability to retrieve the last TaskExecution for Tasks
- Add the ability to retrieve the last TaskExecution to:
  - MapTaskExecutionDao
  - JdbcTaskExecutionDao
- Refactor `JdbcTaskExecutionDao` and use `NamedParameterJdbcTemplate` for all persistence store calls
- Add the following TaskExecution methods to TaskExplorer:
  - getLatestTaskExecutionsByTaskNames
  - getLatestTaskExecutionForTaskName
- Add Tests
- Ensure that code is JDK7 compatible due to backporting needs
- Ensure commit backports to 1.2.x

Polishing on tests during merge
2018-06-15 16:54:28 -04:00
Glenn Renfro
5672b326ed SimpleTaskConfiguration ignores proxy beans when validating datasources
If a user adds spring-cloud-starter-config to the dependencies it has to add a proxy for the datasource else the Hikari connection pool pukes.

resolves #407
2018-04-13 16:19:52 -05:00
Glenn Renfro
0915dc6dfe TaskRepositoryInitializer now uses TaskConfigurer to determine the datasource
resolves #405
2018-03-09 13:22:17 -05:00
Michael Minella
6426cfea7e Polish 2018-02-13 09:28:22 -06:00
Glenn Renfro
76309b89ff Removed code that was marked as deprecated.
Also updated test that tested deprecated code.

resolves #366
2018-02-13 09:28:09 -06:00
Glenn Renfro
d8a73ba183 Prevent a task from starting if an inst with the same name is running.
resolves #81

Using LockRegistryLeaderInitiator to do leadership election.

When task is started and singleInstanceEnabled isset to true then we use leader election
to determine if a task needs to be started.

Error Event Name had to be updated
2018-01-25 13:24:53 -06:00
Glenn Renfro
94e074d841 Set the spring.cloud.task.closecontext_enable default to false
resolves #364
2018-01-24 14:11:35 -06:00
Glenn Renfro
3f316a0170 SCT now handles exceptions thrown by execution listeners
resolves #341
2018-01-24 12:12:50 -06:00
Glenn Renfro
3ad9efe3fe Updated tests to remove deprecated code from tests
* cleanup removing unused headers
* Updated asserts in code base that needed messages (marked as deprecated)
* left one test that was testing a deprecated constructor.  When that code is removed we can remove that test.
* some other cleanup

resolves #338
2018-01-18 11:42:37 -06:00
Glenn Renfro
d95f46002f Migrate Task to Spring Cloud Build 2.0.x
resolves #313
2017-07-12 11:38:00 -05:00
Glenn Renfro
6c47223859 Repository is not initialized if tablePrefix is set.
resolves #311
2017-06-26 16:04:22 -05:00
Glenn Renfro
b03f8398a7 Task identifies if JPA is in use and uses JPTransactionManager
resolves #309
2017-06-26 15:49:20 -05:00
Glenn Renfro
6fad14ead7 Support DB2 on Mainframe as DB2ZOS
resolves #303

Added support for DB2ZOS DatabaseType.
Added DB2AS400, DB2VSE, based on how Spring Batch implemeted DB2 identification via metadata.
All DB2 database types will use the DB2 repository initialize sql script

Tested this against a local DB2.
2017-05-19 10:44:08 -04:00
David Turanski
a1cffe8bd4 Change closecontextEnable to closeContextEnabled
Added test

Updated to use the standard log library

resolves #217
2017-04-12 11:06:26 -04:00
Michael Minella
ac41b8c26d Refactor to clense task name
When using Spring Boot, the id of the application context can be a colon
delimited string of values.  By default, Spring Cloud Task uses this
value as the task name.  However, when using JMX, this can cause issues.
This commit updates the SimpleTaskNameResolver to clense the colons and
replace them with underscores.

Resolves #280
2017-03-29 17:45:28 -04:00
Thomas Risberg
fec40fd3f8 Adding a method to pass in taskName for new empty TaskExecution
Resolves #298

Added test and add param to javadoc
2017-03-29 14:17:02 -04:00
Glenn Renfro
80812beee8 Updated the migration scripts to use all caps for table names (#288)
* Updated the migration scripts to use all caps for table names

In the original migration scripts the table names were all lower case.  However the original table definitions were capitalized, and on file systems that are case sensitive,
mysql fails to update the table.  Because of the 2 different cases.

resolves #287

* Updated the 1.1.x branch migration scripts

In the original migration scripts the table names were all lower case.  However the original table definitions were capitalized, and on file systems that are case sensitive,
mysql fails to update the table.  Because of the 2 different cases.

* Added migration script for db2.
2017-03-02 16:07:06 -05:00
Thomas Risberg
929117b365 Changing PARENT_EXECUTION_ID to NUMBER
Resolves #283
2017-02-23 18:59:07 -05:00
Michael Minella
48af5e5b32 Added TaskExecutionListenerSupport
This commit adds the TaskExecutionListenerSupport, a no-op
implementation of the TaskExecutionListner. This allows a user to extend
the TaskExecutionListenerSupport and simply override what they need
instead of implementing all of the methods.
2017-02-10 14:16:11 -06:00
Glenn Renfro
a7fe76c7d6 Do not update the externalExecutionId if null when starting TaskExecution
resolves #271
2017-02-09 09:07:22 -06:00
Glenn Renfro
acaaad89f3 Adds support for Task Execution Parent Ids
resolves #261
2017-01-20 14:47:12 -06:00
Glenn Renfro
91aaf0022c Change Engine for sequence to InnoDB
resolves #262
2017-01-06 13:15:12 -06:00
Michael Minella
3d1ee18db3 Minor polish 2017-01-06 12:54:38 -06:00
Glenn Renfro
10bb457a5a Allows user to set table prefix via properties.
resolves #244
2017-01-06 12:54:30 -06:00
Glenn Renfro
2eb1c49e12 Added ability to update externalExecutionId
resolves #259
2017-01-06 16:47:29 +01:00
Glenn Renfro
1185421803 TaskBatchAutoConfiguration now uses datasource from TaskConfigurer
resovles #252
2016-12-20 19:25:26 -06:00
Michael Minella
91485769d5 Fixed release versions 2016-11-22 10:22:13 -06:00
Glenn Renfro
9074926736 Updated RC1 to GA for migration comments, tests and docs. 2016-11-22 09:39:42 -06:00
Glenn Renfro
fa5cb4f242 Update docs and static maven artifacts to RC1 2016-11-03 22:47:07 -04:00
Glenn Renfro
d6e224f2ef Updated based on Code Review 2016-11-01 17:32:22 -04:00
Glenn Renfro
eff83a1897 Added More tests. 2016-11-01 17:32:22 -04:00
Glenn Renfro
1611c28768 Adding a few more tests.
Added unit tests to classes that had no coverage.
Added unit tests to classes bump up coverage.
2016-11-01 17:32:22 -04:00
Glenn Renfro
02a8c3368b Updates the TaskRepository createTaskExecution to support TaskExecution param
resolves #223

Updated to use TaskExecution when creating new executions for test.
2016-11-01 13:12:32 -04:00
Gunnar Hillert
7298bdd485 gh-235 Fix Sort Properties are ignored in JdbcTaskExecutionDao
- Add support for sorting similar to SCDF Core's `AbstractRdbmsKeyValueRepository`

Added tests on merge
2016-11-01 09:05:05 -04:00
Thomas Risberg
2444b8055e Adding the new ERROR_MESSAGE and EXTERNAL_EXECUTION_ID columns for DB2 2016-10-27 15:27:24 -04:00
Thomas Schuettel
c61a6e9c35 Adds DB2 support
Provides the files and enum constants for Spring Cloud Task
to work with a DB2 database.
2016-10-27 15:26:50 -04:00
Glenn Renfro
81f34d118a Adding comment for those upgrading from .m1.
Removed column keyword from some of the definitions
2016-10-14 17:34:35 -04:00
Michael Minella
17e4250586 Checks for invalid ExecutionId in the TaskLifeCycleListener
resolves #115
* Fixes bug where if the user set the environment variable and commandline args a unique constraint would fire.
* Updated docs
* Removed deprecation
* Fixed version number for integration test.

Added integration tests for externally generated task executions

Add externalExecutionId

resolves #80
2016-10-12 12:45:29 -05:00
Michael Minella
441bbfe492 Checks for invalid ExecutionId in the TaskLifeCycleListener
resolves #115
* Fixes bug where if the user set the environment variable and commandline args a unique constraint would fire.
* Updated docs
* Removed deprecation
* Fixed version number for integration test.

Added integration tests for externally generated task executions
2016-10-10 17:45:35 -05:00
Glenn Renfro
9dada07944 1.0.x - 1.1.x DB Migration scripts
resolves #205
2016-09-09 16:28:27 -04:00
Miguel Gomes
9ccbe60cba Fix NPE when return an eventExitCode before ApplicationFailedEvent 2016-09-08 13:47:23 -05:00
Glenn Renfro
4e7e75cc82 Moved the Error size trimming from DAO to repository.
* We had a discussion on this sometime back and it was decided at that time to keep these type of trims and verification in the Repository.
* Fixed bug where trimming was taking 1 character too many
* Updated ExitMessage maxSize test to verify size
* Added ErrorMessage maxSize Test
* While adding taskExplorer to the test noticed it was missing 2 basic tests and added those as well
2016-09-06 11:00:42 -05:00
Michael Minella
db0565b7cf Introduced Error Message to Task Execution
To provide the ability to control task orchestration via the exit
message, we moved the stack trace storage to a new field.  This means
that exit message is now a field we can use similar to how exit code is
in batch, and still have the stack trace of an unsuccessful task
execution stored.

Resolves spring-cloud/spring-cloud-task#186

Disabled integration tests by default

Just some cleanup on merge
2016-08-15 18:30:15 -04:00
Michael Minella
172f4b957a Added code to record task completion when process is terminated gracefully
Updated per code review

Updates for merge
2016-07-25 16:51:44 -04:00
Glenn Renfro
de3d09664e Updated to use DelegatedResourceLoader that can use an empty loaders map 2016-07-07 10:42:52 -05:00
Michael Minella
7f1ece96e6 Removed unused default 2016-07-06 15:52:21 -05:00
Michael Minella
57e9d4dcae Refactored dependency management
Created a Spring Boot starter that can be used to configure Spring Cloud
Task and it's related functionality.

Updates per code review

Removed autowiring of app context

Refactored DeployerPartitionHandler to correctly use environment variables

Exposed deployment properties of TaskLauncher

Exposed deployment properties via the TaskLaunchRequest

Updated based on code review
2016-07-06 16:15:13 -04:00
Michael Minella
77fdfbdbc0 Refactored the use of the name parameters to be arguments
This PR refactors the use of the term parameters to arguments to be
consistent with how the component is utilized within Spring Cloud Data
Flow.
2016-06-09 09:39:14 -05:00
didiez
a55970fe77 Fixed explicit cast exception while using oracle 10g 2016-05-20 10:07:30 -05:00
Glenn Renfro
df14546a7f SCT-139 Exception info and error codes will be recorded for the task
resolves spring-cloud/spring-cloud-task#139
2016-05-20 09:57:23 -05:00