Commit Graph

1914 Commits

Author SHA1 Message Date
Michael Minella
fa286dc1e9 Refactored JobExecution for performance
In order to make the Map based JobRepository threadsafe, the
JobExecutino was modified to use a `CopyOnWriteArraySet` for the
collection backing the child `StepExecution` collection.  However, this
collection option has bad performance characteristics when used with
large collections.  When using partitioning, it can be common to have a
large number of `StepExecution` instances to add which drastically hurts
start up time.

This commit remove the use of the `CopyOnWriteArraySet` for the
`JobExecution#stepExecutions` and replaces it with a `LinkedHashSet`
wrapped via `Collection.synchronizedSet`.

Resolves BATCH-2384
2017-11-02 12:38:35 -05:00
Daniel Heinrich
9322fe6fae BATCH-2455 unifie listener ordering
Why:
Listeners should be called in normal order before some event
(i.e. read, write) and after that event in reverse order.

Side effects:
The ordering of Chunk and ItemReader Listeners is changed and will
change some behaviors of users. This change is still neccesary because
it is not only the correct and obviouse way, but also prevents new
users to hack around this problem.
2017-11-02 10:29:09 -05:00
Michael Minella
e5fe6a5de6 Updated DefaultBatchConfigurer to not overwrite when autowiring
This commit prevents autowiring from overwriting a value set for the
`DataSource` if it has already been set.

Resolves BATCH-2636
2017-11-02 09:58:11 -05:00
Michael Minella
52d2c257c5 Version updates 2017-10-23 15:52:55 -05:00
Michael Minella
b2f8f7f9cd Refactored to add a way to copy JobParameters into another via builder
In a previous commit, the JobParametersBuilder was updated to include
some code from Spring Boot that handled the incrementing of
JobParameters for a previous job.  That commit brought over a private
`merge` method that is actually useful for general consumption.

This commit adds a `addJobParameters` method to the builder providing
the same functionality the `merge` method did in a public method.
2017-10-20 12:43:06 -05:00
Michael Minella
63dfe4b912 Polish 2017-10-20 11:57:56 -05:00
Glenn Renfro
a35784dbd6 Support getNextJobParameters from JobParametersBuilder.
resolves BATCH-2640

Cleanup and added tests to JobParametersBuilder.
2017-10-20 11:06:04 -05:00
Michael Minella
24fbb882e6 Updated job.adoc to have java config examples
This commit addresses the job.adoc and how to configure the various
pieces of the framework it covers via java configuration.
2017-10-18 12:00:27 -05:00
setoguchi
f8cc4918d9 fix typo 2017-10-17 10:29:10 -04:00
Michael Minella
7d2a26a136 Add an ItemProcessor that delegates to a java.util.function.Function
This commit adds a new `ItemProcessor` that delegates to a
`java.util.function.Function`.  It also enables users to configure a
`Function` as an `ItemProcessor` via the builders (so they don't need to
worry about the `ItemProcessor` wrapper in the first place).

Resolves BATCH-2641
2017-09-15 16:44:54 -05:00
Michael Minella
b180c75ce0 Housecleaning of build warnings 2017-09-15 15:58:22 -05:00
Michael Minella
340406a61f Polish 2017-09-14 14:29:26 -05:00
Glenn Renfro
6bdbe3029e Remove JavaDoc warnings part 2 2017-09-12 10:52:22 -05:00
Jimmy Praet
3968b77421 fix build on windows 2017-07-19 09:02:19 -05:00
Cameron
9256148cf2 BATCH-2630 - update not to rely on step execution order from DAO 2017-07-17 11:22:40 -05:00
Michael Minella
263e978a1f Updated for various code warnings
This commit addresses a number of deprications and other code warnings.
There are still many more to address, but this is a start.
2017-05-02 12:48:03 -05:00
Michael Minella
4ad00166f8 Changed default ExecutionContext serialization mechanism
The current default for serializing the ExecutionContext is via XStream
using Jettison's driver.  However, recent updates to Jettison make it
incompatible with XStream with no progress on a fix.  Because of this,
and to encourage the use of well supported library combinations, the
default ExecutionContext serialization mechanism for Spring Batch has
been switched to Jackson (via the
Jackson2ExecutionContextStringSerializer).  This commit also depricates
the XStreamExecutionContextStringSerializer for removal at a later date.
However, it is still available for users that require that during a
migration.

Resolves BATCH-2575
2017-03-22 15:25:14 -05:00
Michael Minella
a6c4dacbbe Refactored bootstrapping of JSR-352 base context
Spring Batch's implementation of JSR-352 previously relied on Spring's
ContextSingletonBeanFactoryLocator.  However, this has been removed in
Spring 5 as a relic of older EJB based use cases.  This commit now
lazily bootstraps the base context on it's own when the first
JsrJobOperator is requested.

Resolves BATCH-2572
2017-03-09 12:16:41 -06:00
Philippe Marschall
f78aa275c0 BATCH-2396 Guard Serializable check message
The exception message for the Serializable check in
DefaultExecutionContextSerializer is always generated. For large
contexts this can quickly put a log of pressure on the allocator and
the heap.

This commit contains the following changes:

 * generate the exception message for non-serializable values in
   DefaultExecutionContextSerializer only when needed

I have signed and agree to the terms of the SpringSource Individual
Contributor License Agreement.

Issue: BATCH-2396
2017-02-02 12:25:11 -06:00
Michael Minella
54a90beed7 Upgraded Mockito
This commit upgrades mockito to the latest currently available version
as well as does some additional cleanup.
2017-01-24 14:18:05 -06:00
Michael Minella
26b02fb836 Replaced snapshot versions and addressed deprications
This commit moves all SNAPSHOT dependencies to the latest available
released versions.  It also addresses a number of deprications in the
Spring Data realm.  Specifically around the deprication of the
Neo4JOperations and the package reorganization within Hibernate.
2016-12-30 14:04:58 -06:00
Michael Minella
80a153527f Updated test based on new error message returned by Spring Framework 5 2016-11-18 10:33:41 -06:00
Michael Minella
a75b067ebc Added builder for JdbcCursorItemReader
This provides a builder for the JdbcCursorItemReader to simplify java
configuration.

Resolves BATCH-2555
2016-11-18 09:18:26 -06:00
Michael Minella
eb2f752b16 Unwrap StepListenerFailedException when determining skip/rollback
When determining if an exception should be skipped or not, the business
exception should be used.  However, when an exception is thrown in the
listener, it's wrapped by a `StepListenerFailedException`.  This leads
to it hiding the underlying exception.  This commit will unwrap the
cause of a `StepListenerFailedException` and use that to determine if it
should be skipped or not.

Resolves BATCH-2322
2016-10-17 11:27:15 -05:00
Michael Minella
ca847e2760 Addressed stopped jobs from a job step
Prior to this commit, when using the `JobStep`, if the child job was
stopped (left in the `STOPPED` state), the step executing that job was
marked as `COMPLETE`, preventing it from being restarted.  This commit
now marks a step that was executing the stopped job also as stopped,
allowing for it to be restarted.

Resolves BATCH-2429
2016-10-14 12:07:48 -05:00
Michael Minella
23f599f1f5 Updated test to dynamically obtain java executable location 2016-10-03 12:56:33 -05:00
Michael Minella
f4c0530730 Upgraded dependency versions and minor polish 2016-08-09 13:19:14 -05:00
Michael Minella
e375771ba6 Fixed doc tags 2016-08-08 15:33:39 -05:00
Billy Korando
e754c8617a Update EnableBatchProcessing.java
Updating the Javadoc for EnablebatchProcessing to include additional beans it puts in context.
2016-08-08 15:16:23 -05:00
Nick Vanderhoven
f7e10909f9 BATCH-2513 Fix for typo in log statement of AbstractListenerFactoryBean.isListener 2016-08-08 13:21:36 -05:00
Andy Wilkinson
5867606f4b Tighten up AutomaticJobRegistrar’s event listening
Previously, AutomaticJobRegistrar listened to all ApplicationEvents
despite only being interested in two ApplicationContextEvents, namely
ContextRefreshedEvent and ContextClosedEvent. This could lead to
an AutomaticJobRegistrar instance being created earlier than necessary.

This commits tightens up AutomaticJobRegistrar so that it only listens
to ApplicationContextEvents.

Closes BATCH-2506
See https://github.com/spring-projects/spring-boot/issues/2395
2016-07-20 22:25:58 -05:00
Michael Minella
ade242f2c4 Updated SimpleStepExecutionSplitter to return a Set with addressable elements 2016-04-19 16:31:23 -05:00
Michael Minella
6e0d0531ce Fixes default schema version 2016-04-19 16:14:22 -05:00
Marten Deinum
22109eea84 This commit adds a ExecutionContextSerializer based on Jackson2.
It has been tested with Jackson 2.3.3 which is the Jackson version
used with the Spring dependency.

Tests have been updated to use Hamcrest matchers and made a bit more reusable.
2016-04-19 12:54:59 -05:00
mark kouba
f6d22f4f80 add shutdown for thread pool task executor so it cleans up and shutdowns
correctly before method exits.
2015-11-25 16:18:56 -06:00
Michael Minella
eafa7ee152 BATCH-2313: Fixed regression of BATCH-2153 by updating HashMap to ConcurrentHashMap 2015-10-15 16:04:00 -05:00
Philippe Marschall
dcc9da8273 BATCH-2407 Use StringBuilder instead of StringBuffer
With Java 1.5 StringBuilder is preferred over StringBuffer for single
threaded access as is has less overhead.

This is evidenced by the class comment of StringBuffer and Effective
Java 2nd Edition Item 67: Avoid excessive synchronization.

> The StringBuilder class should generally be used in preference to
> this one, as it supports all of the same operations but it is faster,
> as it performs no synchronization.

 - replace StringBuffer with StringBuilder where possible

Issue: BATCH-2407
2015-08-06 10:22:39 -05:00
Philippe Marschall
3783345c55 BATCH-2412 Add guards around debug statements
In various places in the code base a debug message is constructed
unconditionally. This adds unnecessary overhead in the common case when
debug logging is off.

 - add guards around debug statements in non-test code

Issue: BATCH-2412
2015-08-05 12:04:44 -05:00
Philippe Marschall
7ec7152c5e BATCH-2410 junit.framework.Assert is deprecated 2015-07-31 12:44:25 -05:00
Alex Jablonski
cbc83015d5 Add regression unit test covering behavior reported in BATCH_2346
Observed that deleting the code fixing issue BATCH_2346 didn't cause
any tests to fail
2015-07-14 14:21:41 -05:00
Andy Wilkinson
ff2b6a8cee Remove remaining dependencies on ParameterizedRowMapper
This is a follow-on from adc2f79. It removes the remaining references
to ParameterizedRowMapper and should, therefore, make things fully
compatible with Spring Framework 4.2.
2015-07-09 16:04:50 -05:00
jpraet
61638d52bd BATCH-2311 JobLauncher allows restart of job_execution with status
UNKNOWN

* additionally prevent restart of step executions with status STARTING,
STARTED or STOPPING
* additionally prevent restart of job executions with status UNKNOWN or
STOPPING
2015-06-09 10:06:15 -05:00
Christian Ramseier
77be8b97b4 use current classloader to get the proxied repository 2015-06-08 16:29:51 -05:00
Michael Minella
55ca2bc895 Changed MySql engines to all be InnoDB
InnoDB is the only option for transactional tables in MySql.  This
change makes all the table definitions consistent (there previously were
a few that were MyISAM).

BATCH-2373
2015-05-15 16:13:00 -05:00
Michael Minella
c8f8be3b8e Added additional tests around *Aware callbacks in GenericApplicatioNContextFactory BATCH-2358 2015-05-15 11:39:47 -05:00
sparsick
fa01295ce6 BATCH-2359: fix for the problem that job arguments defined after an empty line are ignored 2015-04-15 09:49:59 -04:00
Jason Pell
2cdadea4b3 BATCH-2353 update sql server ddl to support ANSI NULL Default = false 2015-04-08 16:43:17 -05:00
Michael Minella
7c60b055c3 Removed dependency on ParameterizedRowMapper
To support Spring Framework 4.2 which removes ParameterizedRowMapper,
all references to that were switched to RowMapper.  As of Spring 3, the
interfaces are identicle so this should cause no backward compatability
issues.

BATCH-2369
2015-03-31 14:08:38 -05:00
Michael Minella
8b32462072 Clear context to job name mapping when clearing contexts BATCH-2347 2015-03-06 11:54:44 -06:00
Michael Minella
256da94a74 Added javadoc discussing transactionality of the ItemWriteListener BATCH-2336 2015-03-06 10:15:29 -06:00