8000 Consider a beforeStep/afterStep-equivalent that runs on a partition thread. · Issue #57 · jakartaee/batch · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Consider a beforeStep/afterStep-equivalent that runs on a partition thread. #57
Open
@follis

Description

@follis

Originally opened as bug 6288 by ScottKurz

--------------Original Comment History----------------------------
Comment from = ScottKurz on 2014-07-30 14:03:27 +0000

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.


Comment from = m_edgar on 2014-09-19 02:23:58 +0000

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.


Comment from = ScottKurz on 2016-03-30 15:14:36 +0000

Let me follow-up and propose adding beforePartition/afterPartition to StepListener.

So beforeStep/afterStep will continue to be called only on the top-level thread, and the new beforePartition/afterPartition will only be called on the partition threads.

(Also relevant to keep in mind, the PartitionReducer#beginPartitionedStep/afterPartitionedStepCompletion methods allow for before/after calls as well, and only from the top-level. Both these and beforeStep/afterStep can continue to be useful in different cases from the top-level.)

Let's deal with any other new listener method proposals separately (e.g. https://java.net/bugzilla/show_bug.cgi?id=7374)

Bug 7374 is now #91

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0