Dynamic chunk size via CompletionPolicy no longer possible in new Chunk API? #5311
-
|
Hi, in the old chunk implementation it was possible to configure a dynamic chunk size per job execution by using a CompletionPolicy that could read a chunk-size value from job parameters. For example: With the new chunk-oriented programming model, the chunk() method only accepts a fixed int value and does not offer an overload that accepts a CompletionPolicy. Regards, |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
|
Defining the chunk size dynamically could be done by defining a step-scoped tasklet, not necessarily through a step-scoped completion policy (this is true for the old implementation in v5 as well). There is a note about this here, but I can provide an example if needed. |
Beta Was this translation helpful? Give feedback.
-
|
Hi @fmbenhassine, thanks for your response. Maybe an example would help to resolve the confusion |
Beta Was this translation helpful? Give feedback.
The reason is that prior to v6, where the implementation of the chunk-oriented processing model was based on
Tasklet/TaskletStep, it was possible to scope the tasklet itself to the step, meaning there was an "intermediate" batch artefact that can be step-scoped (therefore no need for a job scope). Now with v6, the chunk-oriented processing model is directly implemented in aStepimplementation, thus, the intermediate concept is gone. So indeed, the reason is purely technical in this case.I will close #4869 with a link to this discussion and I will update the reference documentation accordingly. Once that done, I will close this discussion. Of course if you need more details on this, pl…