Skip to content

Commit 4398696

Browse files
committed
docs: 배치 모듈 JavaDoc 한글화
1 parent 2dbb9df commit 4398696

12 files changed

Lines changed: 152 additions & 152 deletions

apps/commerce-batch/src/main/java/com/loopers/batch/config/BatchConfig.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
import org.springframework.context.annotation.Configuration;
44

55
/**
6-
* Base configuration class for Spring Batch.
6+
* Spring Batch 기본 설정 클래스.
77
*
8-
* <p>Spring Boot 3.x auto-configures Spring Batch, so @EnableBatchProcessing is not needed.
9-
* <p>This class can be used for common batch configuration beans if needed.
8+
* <p>Spring Boot 3.x는 Spring Batch를 자동 설정하므로 @EnableBatchProcessing은 필요하지 않습니다.
9+
* <p>이 클래스는 필요한 경우 공통 배치 설정 빈을 정의하는 용도로 사용할 수 있습니다.
1010
*/
1111
@Configuration
1212
public class BatchConfig {

apps/commerce-batch/src/main/java/com/loopers/batch/config/MonthlyRankingJobConfig.java

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -25,23 +25,23 @@
2525
import org.springframework.transaction.PlatformTransactionManager;
2626

2727
/**
28-
* Configuration class for monthly ranking aggregation batch job.
28+
* 월간 랭킹 집계 배치 작업 설정 클래스.
2929
*
30-
* <p>This job aggregates product metrics data on a monthly basis and
31-
* stores the top N rankings in the materialized view table.
30+
* <p>이 작업은 상품 지표 데이터를 월간 단위로 집계하여
31+
* 상위 N개 랭킹을 Materialized View 테이블에 저장합니다.
3232
*
33-
* <p>Job execution example:
33+
* <p>작업 실행 예시:
3434
* <pre>
3535
* java -jar commerce-batch.jar \
3636
* --job.name=monthlyRankingJob \
3737
* yearMonth=2025-01
3838
* </pre>
3939
*
40-
* <p>Chunk-oriented processing flow:
40+
* <p>Chunk 지향 처리 흐름:
4141
* <ol>
42-
* <li>Reader: Aggregate product_metrics by month</li>
43-
* <li>Processor: Calculate ranking scores</li>
44-
* <li>Writer: Save to mv_product_rank_monthly</li>
42+
* <li>Reader: product_metrics를 월간 단위로 집계</li>
43+
* <li>Processor: 랭킹 점수 계산</li>
44+
* <li>Writer: mv_product_rank_monthly에 저장</li>
4545
* </ol>
4646
*/
4747
@Slf4j
@@ -56,11 +56,11 @@ public class MonthlyRankingJobConfig {
5656
private final MonthlyRankRepository monthlyRankRepository;
5757

5858
/**
59-
* Defines the monthly ranking job.
59+
* 월간 랭킹 작업을 정의합니다.
6060
*
61-
* @param jobRepository the Spring Batch job repository
62-
* @param monthlyRankingStep the step to execute
63-
* @return configured Job instance
61+
* @param jobRepository Spring Batch 작업 저장소
62+
* @param monthlyRankingStep 실행할 Step
63+
* @return 설정된 Job 인스턴스
6464
*/
6565
@Bean
6666
public Job monthlyRankingJob(
@@ -73,12 +73,12 @@ public Job monthlyRankingJob(
7373
}
7474

7575
/**
76-
* Defines the monthly ranking step with chunk-oriented processing.
76+
* Chunk 지향 처리를 사용하는 월간 랭킹 Step을 정의합니다.
7777
*
78-
* @param jobRepository the Spring Batch job repository
79-
* @param transactionManager the transaction manager
80-
* @param yearMonth the target month (injected from job parameters)
81-
* @return configured Step instance
78+
* @param jobRepository Spring Batch 작업 저장소
79+
* @param transactionManager 트랜잭션 관리자
80+
* @param yearMonth 대상 월 (작업 파라미터에서 주입)
81+
* @return 설정된 Step 인스턴스
8282
*/
8383
@Bean
8484
@JobScope
@@ -98,10 +98,10 @@ public Step monthlyRankingStep(
9898
}
9999

100100
/**
101-
* Creates an ItemReader for monthly metrics aggregation.
101+
* 월간 지표 집계를 위한 ItemReader를 생성합니다.
102102
*
103-
* @param yearMonth the target month
104-
* @return configured ItemReader
103+
* @param yearMonth 대상 월
104+
* @return 설정된 ItemReader
105105
*/
106106
@Bean
107107
@StepScope
@@ -112,10 +112,10 @@ public ItemReader<ProductRankingAggregation> monthlyMetricsReader(
112112
}
113113

114114
/**
115-
* Creates an ItemProcessor for ranking score calculation.
115+
* 랭킹 점수 계산을 위한 ItemProcessor를 생성합니다.
116116
*
117-
* @param yearMonth the target month
118-
* @return configured ItemProcessor
117+
* @param yearMonth 대상 월
118+
* @return 설정된 ItemProcessor
119119
*/
120120
@Bean
121121
@StepScope
@@ -127,9 +127,9 @@ public ItemProcessor<ProductRankingAggregation, MonthlyProductRank> monthlyRanki
127127
}
128128

129129
/**
130-
* Creates an ItemWriter for persisting monthly rankings.
130+
* 월간 랭킹 저장을 위한 ItemWriter를 생성합니다.
131131
*
132-
* @return configured ItemWriter
132+
* @return 설정된 ItemWriter
133133
*/
134134
@Bean
135135
@StepScope

apps/commerce-batch/src/main/java/com/loopers/batch/config/WeeklyRankingJobConfig.java

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -25,23 +25,23 @@
2525
import org.springframework.transaction.PlatformTransactionManager;
2626

2727
/**
28-
* Configuration class for weekly ranking aggregation batch job.
28+
* 주간 랭킹 집계 배치 작업 설정 클래스.
2929
*
30-
* <p>This job aggregates product metrics data on a weekly basis and
31-
* stores the top N rankings in the materialized view table.
30+
* <p>이 작업은 상품 지표 데이터를 주간 단위로 집계하여
31+
* 상위 N개 랭킹을 Materialized View 테이블에 저장합니다.
3232
*
33-
* <p>Job execution example:
33+
* <p>작업 실행 예시:
3434
* <pre>
3535
* java -jar commerce-batch.jar \
3636
* --job.name=weeklyRankingJob \
3737
* yearWeek=2025-W01
3838
* </pre>
3939
*
40-
* <p>Chunk-oriented processing flow:
40+
* <p>Chunk 지향 처리 흐름:
4141
* <ol>
42-
* <li>Reader: Aggregate product_metrics by week</li>
43-
* <li>Processor: Calculate ranking scores</li>
44-
* <li>Writer: Save to mv_product_rank_weekly</li>
42+
* <li>Reader: product_metrics를 주간 단위로 집계</li>
43+
* <li>Processor: 랭킹 점수 계산</li>
44+
* <li>Writer: mv_product_rank_weekly에 저장</li>
4545
* </ol>
4646
*/
4747
@Slf4j
@@ -56,11 +56,11 @@ public class WeeklyRankingJobConfig {
5656
private final WeeklyRankRepository weeklyRankRepository;
5757

5858
/**
59-
* Defines the weekly ranking job.
59+
* 주간 랭킹 작업을 정의합니다.
6060
*
61-
* @param jobRepository the Spring Batch job repository
62-
* @param weeklyRankingStep the step to execute
63-
* @return configured Job instance
61+
* @param jobRepository Spring Batch 작업 저장소
62+
* @param weeklyRankingStep 실행할 Step
63+
* @return 설정된 Job 인스턴스
6464
*/
6565
@Bean
6666
public Job weeklyRankingJob(
@@ -73,12 +73,12 @@ public Job weeklyRankingJob(
7373
}
7474

7575
/**
76-
* Defines the weekly ranking step with chunk-oriented processing.
76+
* Chunk 지향 처리를 사용하는 주간 랭킹 Step을 정의합니다.
7777
*
78-
* @param jobRepository the Spring Batch job repository
79-
* @param transactionManager the transaction manager
80-
* @param yearWeek the target week in ISO format (injected from job parameters)
81-
* @return configured Step instance
78+
* @param jobRepository Spring Batch 작업 저장소
79+
* @param transactionManager 트랜잭션 관리자
80+
* @param yearWeek ISO 형식의 대상 주차 (작업 파라미터에서 주입)
81+
* @return 설정된 Step 인스턴스
8282
*/
8383
@Bean
8484
@JobScope
@@ -98,10 +98,10 @@ public Step weeklyRankingStep(
9898
}
9999

100100
/**
101-
* Creates an ItemReader for weekly metrics aggregation.
101+
* 주간 지표 집계를 위한 ItemReader를 생성합니다.
102102
*
103-
* @param yearWeek the target week
104-
* @return configured ItemReader
103+
* @param yearWeek 대상 주차
104+
* @return 설정된 ItemReader
105105
*/
106106
@Bean
107107
@StepScope
@@ -112,10 +112,10 @@ public ItemReader<ProductRankingAggregation> weeklyMetricsReader(
112112
}
113113

114114
/**
115-
* Creates an ItemProcessor for ranking score calculation.
115+
* 랭킹 점수 계산을 위한 ItemProcessor를 생성합니다.
116116
*
117-
* @param yearWeek the target week
118-
* @return configured ItemProcessor
117+
* @param yearWeek 대상 주차
118+
* @return 설정된 ItemProcessor
119119
*/
120120
@Bean
121121
@StepScope
@@ -127,9 +127,9 @@ public ItemProcessor<ProductRankingAggregation, WeeklyProductRank> weeklyRanking
127127
}
128128

129129
/**
130-
* Creates an ItemWriter for persisting weekly rankings.
130+
* 주간 랭킹 저장을 위한 ItemWriter를 생성합니다.
131131
*
132-
* @return configured ItemWriter
132+
* @return 설정된 ItemWriter
133133
*/
134134
@Bean
135135
@StepScope

apps/commerce-batch/src/main/java/com/loopers/batch/processor/RankingScoreProcessor.java

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,24 @@
77
import org.springframework.batch.item.ItemProcessor;
88

99
/**
10-
* ItemProcessor for converting aggregated metrics into ranking entities.
10+
* 집계된 지표를 랭킹 엔티티로 변환하는 ItemProcessor.
1111
*
12-
* <p>This processor transforms ProductRankingAggregation DTOs into either
13-
* WeeklyProductRank or MonthlyProductRank entities based on the period type.
14-
* The ranking score is calculated using weighted metrics.
12+
* <p>이 Processor는 ProductRankingAggregation DTO를 기간 타입에 따라
13+
* WeeklyProductRank 또는 MonthlyProductRank 엔티티로 변환합니다.
14+
* 랭킹 점수는 가중치가 적용된 지표를 사용하여 계산됩니다.
1515
*
16-
* <p>Score calculation formula:
16+
* <p>점수 계산 공식:
1717
* <pre>
18-
* score = (viewCount * WEIGHT_VIEW) +
19-
* (likeCount * WEIGHT_LIKE) +
20-
* (orderCount * WEIGHT_ORDER * log10(salesAmount + 1))
18+
* 점수 = (조회수 * 조회_가중치) +
19+
* (좋아요수 * 좋아요_가중치) +
20+
* (주문수 * 주문_가중치 * log10(판매금액 + 1))
2121
* </pre>
2222
*
23-
* where:
23+
* 가중치:
2424
* <ul>
25-
* <li>WEIGHT_VIEW = 0.1</li>
26-
* <li>WEIGHT_LIKE = 0.2</li>
27-
* <li>WEIGHT_ORDER = 0.6</li>
25+
* <li>조회_가중치 = 0.1</li>
26+
* <li>좋아요_가중치 = 0.2</li>
27+
* <li>주문_가중치 = 0.6</li>
2828
* </ul>
2929
*/
3030
@Slf4j
@@ -38,10 +38,10 @@ public class RankingScoreProcessor implements ItemProcessor<ProductRankingAggreg
3838
private final String period;
3939

4040
/**
41-
* Constructs a new RankingScoreProcessor.
41+
* RankingScoreProcessor 생성자.
4242
*
43-
* @param periodType the type of period ("WEEKLY" or "MONTHLY")
44-
* @param period the period string (e.g., "2025-W01" or "2025-01")
43+
* @param periodType 기간 타입 ("WEEKLY" 또는 "MONTHLY")
44+
* @param period 기간 문자열 (예: "2025-W01" 또는 "2025-01")
4545
*/
4646
public RankingScoreProcessor(String periodType, String period) {
4747
this.periodType = periodType;
@@ -81,13 +81,13 @@ public Object process(ProductRankingAggregation item) {
8181
}
8282

8383
/**
84-
* Calculates the ranking score based on weighted metrics.
84+
* 가중치가 적용된 지표를 기반으로 랭킹 점수를 계산합니다.
8585
*
86-
* <p>Uses logarithmic normalization for sales amount to prevent
87-
* extreme values from dominating the score.
86+
* <p>판매 금액에 대해 로그 정규화를 사용하여
87+
* 극단적인 값이 점수를 지배하는 것을 방지합니다.
8888
*
89-
* @param agg the aggregated metrics
90-
* @return the calculated score
89+
* @param agg 집계된 지표
90+
* @return 계산된 점수
9191
*/
9292
private double calculateScore(ProductRankingAggregation agg) {
9393
double salesAmountValue = agg.getSalesAmount() != null ? agg.getSalesAmount().doubleValue() : 0.0;

0 commit comments

Comments
 (0)