https://docs.spring.io/spring-batch/docs/current/reference/html/domain.html#step
The Domain Language of Batch
To any experienced batch architect, the overall concepts of batch processing used in Spring Batch should be familiar and comfortable. There are “Jobs” and “Steps” and developer-supplied processing units called ItemReader and ItemWriter. However, be
docs.spring.io
틀린 해석이 있다면 알려주세요 🪴
Step
Step은 배치 작업의 독립적이고 순차적인 단계들을 캡슐화하는 도메인 개체이다
따라서 모든 작업은 하나 이상의 Step으로 구성된다. 이 Step에는 실제 일괄 처리를 정의하고 제어하는데 필요한 정보를 포함시킨다.
주어진 Step은 작업 작성하는 개발자의 선택에 달려있다.
간단한 Step은 파일에서 데이터베이스로 데이터를 load할 수 있고, 코드는 거의 필요하지 않다(어떻게 짜느냐에 다르지만)
더 복잡한 단계는 처리의 일부로 적용된 복잡한 business rule이 있을 수 있다
Job과 마찬가지로 Step에도 고유한 JobExecution과 관련된 개별 StepExecution이 있다
StepExecution
StepExecution는 Step을 실행하려는 single attemp를 나타낸다
JobExecution 처럼 Step이 실행될 때마다 새로운 StepExecution이 생성된다
하지만 이전 단계가 실패하여 Step이 실행되지 않는다면 이는 실행이 지속되지 않는다
StepExecution는 Step이 실제 시작된 경우에 << 생성된다
StepExecution는 StepExecution 클래스의 개체로 표시된다
각 실행에는 해당 Step 및 JobExecution에 대한 참조, commit and rollback counts and start and end times 와 같은 트랜잭션 관련 데이터가 포함된다
또한 각 StepExecution에는 다시 재시작 하는 데 필요한 통계 또는 상태 정보와 같이 개발자가 batch 실행 간에 유지해야하는 데이터가 포함된 ExecutionContext가 포함된다
Property | Definition |
Status | A BatchStatus object that indicates the status of the execution. While running, the status is BatchStatus.STARTED. If it fails, the status is BatchStatus.FAILED. If it finishes successfully, the status is BatchStatus.COMPLETED. |
startTime | A java.util.Date representing the current system time when the execution was started. This field is empty if the step has yet to start. |
endTime | A java.util.Date representing the current system time when the execution finished, regardless of whether or not it was successful. This field is empty if the step has yet to exit. |
exitStatus | The ExitStatus indicating the result of the execution. It is most important, because it contains an exit code that is returned to the caller. See chapter 5 for more details. This field is empty if the job has yet to exit. |
executionContext | The “property bag” containing any user data that needs to be persisted between executions. |
readCount | The number of items that have been successfully read. |
writeCount | The number of items that have been successfully written. |
commitCount | The number of transactions that have been committed for this execution. |
rollbackCount | The number of times the business transaction controlled by the Step has been rolled back. |
readSkipCount | The number of times read has failed, resulting in a skipped item. |
processSkipCount | The number of times process has failed, resulting in a skipped item. |
filterCount | The number of items that have been “filtered” by the ItemProcessor. |
writeSkipCount | The number of times write has failed, resulting in a skipped item. |
'Web > spring' 카테고리의 다른 글
[Spring Batch] The Domain Language of Batch - (4) JobRepository ~ 끝 (0) | 2023.03.13 |
---|---|
[Spring Batch] The Domain Language of Batch - (3) ExecutionContext (0) | 2023.03.12 |
[Spring Batch] The Domain Language of Batch - (1) Job (0) | 2023.03.11 |
[Spring Batch] Architecture (0) | 2023.03.11 |
[Spring Framework core] 1.10. Classpath Scanning and Managed Components (2) (0) | 2023.03.10 |