2

I am building a Spring Batch application.
Suppose that I have a Job which executes, for example:

  • Split an audio file
  • Perform Speech-To-Text
  • Suppose that I have a TaskExecutor, allowing the Chunk-oriented step(s) to be parallelyzed.

    Are there any benefits in using 2-Steps instead of putting all these operations in a single one?

    My doubt is that using 2-Steps causes the "already finished files" to wait for all the pool to complete, causing inefficiency.

    Thanks in advance

    4

    1 回答 1

    0

    I would recommend doing this in two steps. The main reason is error handling. I'd assume that once you split the file, you won't want to have to do that again if there is an error on the speech-to-text processing. If that is the case, by separating the processing into two steps, the split functionality won't need to be rerun. Also, it means that the chunk oriented processing can be more stateful in that the chunks that have been processed successfully won't need to be re-executed. Yes, you could code this functionality yourself to behave this way, but Spring Batch provides the functionality out of the box...why not take advantage of it?

    于 2019-04-15T14:06:53.417 回答