스케줄러로 변경

This commit is contained in:
2026-03-08 21:33:41 +09:00
parent a6bb589189
commit b156b61caf
49 changed files with 3572 additions and 126 deletions

View File

@@ -10,12 +10,6 @@ spring:
idle-timeout: 600000
max-lifetime: 1800000
application:
name: make-shapefile-service
main:
web-application-type: none # Disable web server for CLI application
converter:
inference-id: D5E46F60FC40B1A8BE0CD1F3547AA6
# Optional: omit or set empty to create merged shapefile for all batch-ids
@@ -45,7 +39,3 @@ logging:
org.springframework: WARN
pattern:
console: '%d{yyyy-MM-dd HH:mm:ss} - %msg%n'
layer:
geoserver-url: http://label-tile.gs.dabeeo.com
workspace: cd

View File

@@ -5,16 +5,17 @@ spring:
password: kamco_cds_Q!W@E#R$
driver-class-name: org.postgresql.Driver
hikari:
maximum-pool-size: 5
maximum-pool-size: 10 # Increased for batch processing
connection-timeout: 30000
idle-timeout: 600000
max-lifetime: 1800000
application:
name: make-shapefile-service
main:
web-application-type: none # Disable web server for CLI application
batch:
job:
enabled: false # CLI에서 명시적으로 실행
jdbc:
initialize-schema: always # 메타데이터 테이블 자동 생성
table-prefix: BATCH_
converter:
inference-id: D5E46F60FC40B1A8BE0CD1F3547AA6
@@ -27,15 +28,19 @@ converter:
output-base-dir: '/data/model_output/export/'
crs: 'EPSG:5186'
batch:
chunk-size: 1000 # 청크 크기 (메모리 ~40MB per chunk)
skip-limit: 100 # 청크당 skip 허용 건수
fetch-size: 1000 # JDBC 커서 fetch 크기
enable-partitioning: false # 초기에는 비활성화
partition-concurrency: 4 # Map ID별 병렬 처리 동시성 (4=~300MB, 8=~600MB)
geoserver:
base-url: 'https://kamco.geo-dev.gs.dabeeo.com/geoserver'
base-url: 'https://aicd-geo.e-kamco.com:18080/geoserver'
workspace: 'cd'
overwrite-existing: true
connection-timeout: 30000
read-timeout: 60000
# Credentials (optional - environment variables take precedence)
# Uncomment and set values for development convenience
# For production, use GEOSERVER_USERNAME and GEOSERVER_PASSWORD environment variables
username: 'admin'
password: 'geoserver'
@@ -45,9 +50,3 @@ logging:
org.springframework: WARN
pattern:
console: '%d{yyyy-MM-dd HH:mm:ss} - %msg%n'
layer:
geoserver-url: https://kamco.geo-dev.gs.dabeeo.com
wms-path: geoserver/cd
wmts-path: geoserver/cd/gwc/service
workspace: cd

View File

@@ -3,3 +3,5 @@ spring:
name: make-shapefile-service
profiles:
active: prod
main:
web-application-type: none # Disable web server for CLI application

View File

@@ -0,0 +1,69 @@
-- 배치 실행 이력 테이블
-- 각 스텝별 시작/종료 시간, 소요 시간, 성공 여부, 에러 사유 추적
CREATE TABLE IF NOT EXISTS batch_execution_history (
id BIGSERIAL PRIMARY KEY,
-- Spring Batch 메타데이터 참조
job_execution_id BIGINT NOT NULL,
step_execution_id BIGINT,
-- 스텝 정보
step_name VARCHAR(100) NOT NULL,
step_type VARCHAR(50), -- 'TASKLET' or 'CHUNK'
-- 시간 정보
start_time TIMESTAMP NOT NULL,
end_time TIMESTAMP,
duration_ms BIGINT, -- 소요 시간 (밀리초)
-- 실행 결과
status VARCHAR(20) NOT NULL, -- 'STARTED', 'COMPLETED', 'FAILED'
exit_code VARCHAR(20), -- 'COMPLETED', 'FAILED', 'UNKNOWN'
exit_message TEXT,
-- 에러 정보
error_message TEXT,
error_stack_trace TEXT,
-- 처리 통계 (chunk 기반 스텝용)
read_count BIGINT DEFAULT 0,
write_count BIGINT DEFAULT 0,
commit_count BIGINT DEFAULT 0,
rollback_count BIGINT DEFAULT 0,
skip_count BIGINT DEFAULT 0,
-- 배치 파라미터 정보
batch_ids TEXT,
inference_id VARCHAR(100),
-- 메타데이터
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
-- 인덱스 생성
CREATE INDEX IF NOT EXISTS idx_batch_exec_hist_job_exec_id
ON batch_execution_history(job_execution_id);
CREATE INDEX IF NOT EXISTS idx_batch_exec_hist_step_exec_id
ON batch_execution_history(step_execution_id);
CREATE INDEX IF NOT EXISTS idx_batch_exec_hist_step_name
ON batch_execution_history(step_name);
CREATE INDEX IF NOT EXISTS idx_batch_exec_hist_status
ON batch_execution_history(status);
CREATE INDEX IF NOT EXISTS idx_batch_exec_hist_start_time
ON batch_execution_history(start_time DESC);
-- 코멘트 추가
COMMENT ON TABLE batch_execution_history IS '배치 실행 이력 추적 테이블 - 스텝별 시작/종료 시간, 소요 시간, 성공 여부, 에러 사유 기록';
COMMENT ON COLUMN batch_execution_history.job_execution_id IS 'Spring Batch Job Execution ID';
COMMENT ON COLUMN batch_execution_history.step_execution_id IS 'Spring Batch Step Execution ID';
COMMENT ON COLUMN batch_execution_history.step_name IS '스텝 이름 (validateGeometryType, generateShapefile 등)';
COMMENT ON COLUMN batch_execution_history.duration_ms IS '스텝 소요 시간 (밀리초)';
COMMENT ON COLUMN batch_execution_history.status IS '실행 상태 (STARTED, COMPLETED, FAILED)';
COMMENT ON COLUMN batch_execution_history.error_message IS '에러 발생 시 에러 메시지';
COMMENT ON COLUMN batch_execution_history.error_stack_trace IS '에러 발생 시 전체 스택 트레이스';