Bugzilla – Bug 6288
Consider a beforeStep/afterStep-equivalent that runs on a partition thread.
Last modified: 2014-09-19 02:23:58 UTC
It is a noticeable asymmetry between partitioned and non-partition steps that there is no equivalent to beforeStep/afterStep on the partition thread.
True, the ChunkListener runs on the partition thread, but you don't have a clear way without inventing one to know it's the last chunk. True, the PartitionAnalyzer runs at the end of the partition, but that's back on the main thread.
Would be curious to hear other opinions on whether this would be desirable for a future release.
I agree with your comments. The closest fit, as you say, is the ChunkListener. It requires some extra coding to know that it is the final chunk and overall doesn't feel as clean as a PartitionListener (or extended StepListener) interface would.
That leaves partitioned batchlet steps without any before/after listener options at all. Of course it could be coded/called directly from each batchlet, but I think the listener approach is cleaner.