HANTE hai 1 mes
pai
achega
166fb80319
Modificáronse 24 ficheiros con 71 adicións e 55 borrados
  1. 1 1
      conf/utic-traf-server.pid
  2. 0 4
      utic-center-common/src/main/java/com/utic/center/common/annotation/DbmsElapsed.java
  3. 0 4
      utic-center-common/src/main/java/com/utic/center/common/annotation/ProcessElapsed.java
  4. 1 0
      utic-center-common/src/main/java/com/utic/center/common/annotation/ProcessingElapsed.java
  5. 0 4
      utic-center-common/src/main/java/com/utic/center/common/annotation/ScheduleElapsed.java
  6. 1 0
      utic-center-common/src/main/java/com/utic/center/common/annotation/SchedulingElapsed.java
  7. 8 0
      utic-center-common/src/main/java/com/utic/center/common/aspect/LoggingAspect.java
  8. 1 8
      utic-traf-server/src/main/java/com/utic/center/utic/traf/server/controller/UticTrafServerController.java
  9. 4 4
      utic-traf-server/src/main/java/com/utic/center/utic/traf/server/dao/mapper/utic/UticTrafficMapper.java
  10. 3 3
      utic-traf-server/src/main/java/com/utic/center/utic/traf/server/dao/repository/dwdb/DwdbTrafficRepository.java
  11. 17 1
      utic-traf-server/src/main/java/com/utic/center/utic/traf/server/dao/repository/utic/UticTrafficRepository.java
  12. 1 1
      utic-traf-server/src/main/java/com/utic/center/utic/traf/server/service/LinkParamService.java
  13. 1 1
      utic-traf-server/src/main/java/com/utic/center/utic/traf/server/service/LinkPatternService.java
  14. 1 1
      utic-traf-server/src/main/java/com/utic/center/utic/traf/server/service/LinkTrafAsnService.java
  15. 1 1
      utic-traf-server/src/main/java/com/utic/center/utic/traf/server/service/LinkTrafCollectService.java
  16. 1 1
      utic-traf-server/src/main/java/com/utic/center/utic/traf/server/service/LinkTrafFusionService.java
  17. 1 1
      utic-traf-server/src/main/java/com/utic/center/utic/traf/server/service/LinkTrafMissingService.java
  18. 4 1
      utic-traf-server/src/main/java/com/utic/center/utic/traf/server/service/LinkTrafPrcsAfterService.java
  19. 1 2
      utic-traf-server/src/main/java/com/utic/center/utic/traf/server/service/LinkTrafPrcsDebugService.java
  20. 1 1
      utic-traf-server/src/main/java/com/utic/center/utic/traf/server/service/LinkTrafPrcsPrepareService.java
  21. 5 2
      utic-traf-server/src/main/java/com/utic/center/utic/traf/server/service/LinkTrafSaveDwdbService.java
  22. 9 6
      utic-traf-server/src/main/java/com/utic/center/utic/traf/server/service/LinkTrafSaveUticService.java
  23. 4 1
      utic-traf-server/src/main/java/com/utic/center/utic/traf/server/service/worker/LinkTrafSaveUticWorker.java
  24. 5 7
      utic-traf-server/src/main/resources/mybatis/mapper/utic/UticTrafficMapper.xml

+ 1 - 1
conf/utic-traf-server.pid

@@ -1 +1 @@
-15328
+6484

+ 0 - 4
utic-center-common/src/main/java/com/utic/center/common/annotation/DbmsElapsed.java

@@ -1,4 +0,0 @@
-package com.utic.center.common.annotation;
-
-public @interface DbmsElapsed {
-}

+ 0 - 4
utic-center-common/src/main/java/com/utic/center/common/annotation/ProcessElapsed.java

@@ -1,4 +0,0 @@
-package com.utic.center.common.annotation;
-
-public @interface ProcessElapsed {
-}

+ 1 - 0
utic-center-common/src/main/java/com/utic/center/common/annotation/ProcessingElapsed.java

@@ -12,5 +12,6 @@ public @interface ProcessingElapsed {
     String name() default "UNKNOWN_PROCESS";
     boolean starting() default true;  // 로깅 여부
     boolean ending() default true;  // 로깅 여부
+    boolean endLine() default false;
 }
 

+ 0 - 4
utic-center-common/src/main/java/com/utic/center/common/annotation/ScheduleElapsed.java

@@ -1,4 +0,0 @@
-package com.utic.center.common.annotation;
-
-public @interface ScheduleElapsed {
-}

+ 1 - 0
utic-center-common/src/main/java/com/utic/center/common/annotation/SchedulingElapsed.java

@@ -12,5 +12,6 @@ public @interface SchedulingElapsed {
     String name() default "UNKNOWN_PROCESS";
     boolean starting() default true;  // 로깅 여부
     boolean ending() default true;  // 로깅 여부
+    boolean endLine() default false;
 }
 

+ 8 - 0
utic-center-common/src/main/java/com/utic/center/common/aspect/LoggingAspect.java

@@ -16,6 +16,8 @@ import org.springframework.stereotype.Component;
 @Component
 public class LoggingAspect extends AbstractLoggingAspect {
 
+    final String endLine = "----------------------------------------------------------------------------------------------------------";
+
     @Around("@annotation(com.utic.center.common.annotation.ProcessingElapsed)")
     public Object aspectProcessingElapsedTime(ProceedingJoinPoint joinPoint) throws Throwable {
         MethodSignature signature = (MethodSignature) joinPoint.getSignature();
@@ -35,6 +37,9 @@ public class LoggingAspect extends AbstractLoggingAspect {
             if (annotation.ending()) {
                 log.info("<<** {} {}", type, LogUtils.elapsedLogLength(processName + " End", executionTime, type.length()));
             }
+            if (annotation.endLine()) {
+                log.info("{}", endLine);
+            }
             return proceed;
         }
         catch (InterruptedException e) {
@@ -68,5 +73,8 @@ public class LoggingAspect extends AbstractLoggingAspect {
             log.info("<<## {} {}: [{}]",
                     type, LogUtils.elapsedLogLength(processName + " End", executionTime, type.length()), TimeUtils.getCurrentTimeString());
         }
+        if (annotation.endLine()) {
+            log.info("{}", endLine);
+        }
     }
 }

+ 1 - 8
utic-traf-server/src/main/java/com/utic/center/utic/traf/server/controller/UticTrafServerController.java

@@ -64,7 +64,6 @@ public class UticTrafServerController {
     }
     public void run() {
         final String header = "==========================================================================================================";
-        final String step = "----------------------------------------------------------------------------------------------------------";
         final String completed = "**********************************************************************************************************";
         final long start = System.currentTimeMillis();
         long tmpStart;
@@ -93,25 +92,21 @@ public class UticTrafServerController {
             // 1. ASN 교통정보 이관(TRAFFIC_LOC) 작업
             this.asnService.processing();
             jobInfo.setAsnEtlpTime(System.currentTimeMillis() - start);
-            log.info(step);
 
             // 2. 수집원별 링크 원시 교통정보 조회
             tmpStart = System.currentTimeMillis();
             this.collectService.processing();
             jobInfo.setCollectTime(System.currentTimeMillis() - tmpStart);
-            log.info(step);
 
             // 2. 가공방식에 따른 퓨전 소통정보 생성
             tmpStart = System.currentTimeMillis();
             this.fusionService.processing();
             jobInfo.setFusionTime(System.currentTimeMillis() - tmpStart);
-            log.info(step);
 
             // 3. 결측처리
             tmpStart = System.currentTimeMillis();
             this.missingService.processing();
             jobInfo.setMissingTime(System.currentTimeMillis() - tmpStart);
-            log.info(step);
 
             // 4. 소통정보 저장(TRAFFIC_CENTER_CACHE) 작업
             tmpStart = System.currentTimeMillis();
@@ -125,7 +120,6 @@ public class UticTrafServerController {
             tmpStart = System.currentTimeMillis();
             this.saveDwdbService.processing();
             jobInfo.setSaveDwdbTime(System.currentTimeMillis() - tmpStart);
-            log.info(step);
 
             // 6. 디버그 정보 출력
             this.debugService.processing();
@@ -134,13 +128,11 @@ public class UticTrafServerController {
             tmpStart = System.currentTimeMillis();
             this.prepareService.processing();
             jobInfo.setPrepareTime(System.currentTimeMillis() - tmpStart);
-            log.info(step);
 
             // 8. 가공 후 처리
             tmpStart = System.currentTimeMillis();
             this.prcsAfterService.processing();
             jobInfo.setPrcsAfterTime(System.currentTimeMillis() - tmpStart);
-            log.info(step);
         }
         finally {
             this.isRunning = false; // 현재 작업이 종료됨을 표시
@@ -153,5 +145,6 @@ public class UticTrafServerController {
         ApplicationRepository.addJobInfo(jobInfo);
 
         log.info("<<## 05MIN {} [{}].", LogUtils.elapsedLogLength("정주기 교통정보 가공 End", executionTime, 5), this.prevPrcsTime);
+        log.info(header);
     }
 }

+ 4 - 4
utic-traf-server/src/main/java/com/utic/center/utic/traf/server/dao/mapper/utic/UticTrafficMapper.java

@@ -17,10 +17,10 @@ public interface UticTrafficMapper {
     int insertCenterRecv(@Param("centerId") String centerId, @Param("infoType") String infoType, @Param("seq") Integer seq, @Param("dataCnt") Integer dataCnt);
 
     int truncateTrafficCenter(@Param("tableName") String tableName);
-    void disableIndexes(@Param("tableName") String tableName);
-    void disablePrimaryKey(@Param("tableName") String tableName);
-    void rebuildIndexes(@Param("tableName") String tableName);
-    void enablePrimaryKey(@Param("tableName") String tableName);
+    int disableIndexes(@Param("tableName") String tableName, @Param("index") String index);
+    int disablePrimaryKey(@Param("tableName") String tableName);
+    int rebuildIndexes(@Param("tableName") String tableName, @Param("index") String index);
+    int enablePrimaryKey(@Param("tableName") String tableName);
     int insertTrafficCenter(@Param("tableName") String tableName, @Param("obj") LinkTrafCenterDto obj);
     int swapTrafficCenterView(@Param("sourceTable") String sourceTable);
 

+ 3 - 3
utic-traf-server/src/main/java/com/utic/center/utic/traf/server/dao/repository/dwdb/DwdbTrafficRepository.java

@@ -13,15 +13,15 @@ public class DwdbTrafficRepository {
     
     private final DwdbTrafficMapper mapper;
 
-    @SqlOperation(type = SqlOperation.SqlType.SELECT, table = "TRAFFIC_CENTER_", param = "targetMonth")
+    @SqlOperation(type = SqlOperation.SqlType.SELECT, table = "TRAFFIC_CENTER_MM", param = "targetMonth")
     public DataCountDto findTrafficCenterHistDataExists(String targetMonth) {
         return this.mapper.findTrafficCenterHistDataExists(targetMonth);
     }
-    @SqlOperation(type = SqlOperation.SqlType.TRUNCATE, table = "TRAFFIC_CENTER_", param = "targetMonth")
+    @SqlOperation(type = SqlOperation.SqlType.TRUNCATE, table = "TRAFFIC_CENTER_MM", param = "targetMonth")
     public int truncateTrafficCenterHist(String targetMonth) {
         return this.mapper.truncateTrafficCenterHist(targetMonth);
     }
-    @SqlOperation(type = SqlOperation.SqlType.INSERT, table = "TRAFFIC_CENTER_", param = "targetMonth")
+    @SqlOperation(type = SqlOperation.SqlType.INSERT, table = "TRAFFIC_CENTER_MM", param = "targetMonth")
     public int insertTrafficCenterHist(String targetMonth, LinkTrafCenterDto obj) {
         return this.mapper.insertTrafficCenterHist(targetMonth, obj);
     }

+ 17 - 1
utic-traf-server/src/main/java/com/utic/center/utic/traf/server/dao/repository/utic/UticTrafficRepository.java

@@ -43,13 +43,29 @@ public class UticTrafficRepository {
     public int truncateTrafficCenter(String tableName) {
         return this.mapper.truncateTrafficCenter(tableName);
     }
+    @SqlOperation(type = SqlOperation.SqlType.UPDATE, table = "disableIndexes", param = "tableName", param2 = "index")
+    public int disableIndexes(@Param("tableName") String tableName, String index) {
+        return this.mapper.disableIndexes(tableName, index);
+    }
+    @SqlOperation(type = SqlOperation.SqlType.UPDATE, table = "disablePrimaryKey", param = "tableName")
+    public int disablePrimaryKey(@Param("tableName") String tableName) {
+        return this.mapper.disablePrimaryKey(tableName);
+    }
+    @SqlOperation(type = SqlOperation.SqlType.UPDATE, table = "rebuildIndexes", param = "tableName", param2 = "index")
+    public int rebuildIndexes(@Param("tableName") String tableName, String index) {
+        return this.mapper.rebuildIndexes(tableName, index);
+    }
+    @SqlOperation(type = SqlOperation.SqlType.UPDATE, table = "enablePrimaryKey", param = "tableName")
+    public int enablePrimaryKey(@Param("tableName") String tableName) {
+        return this.mapper.enablePrimaryKey(tableName);
+    }
 
     @SqlOperation(type = SqlOperation.SqlType.INSERT, table = "TRAFFIC_CENTER", param = "tableName")
     public int insertTrafficCenter(String tableName, @Param("obj") LinkTrafCenterDto obj) {
         return this.mapper.insertTrafficCenter(tableName, obj);
     }
 
-    @SqlOperation(type = SqlOperation.SqlType.UPDATE, table = "TRAFFIC_CENTER(VIEW)", param = "currTable", param2 = "nextTable")
+    @SqlOperation(type = SqlOperation.SqlType.UPDATE, table = "swapTrafficCenterView", param = "currTable", param2 = "nextTable")
     public int swapTrafficCenterView(String currTable, String nextTable) {
         return this.mapper.swapTrafficCenterView(nextTable);
     }

+ 1 - 1
utic-traf-server/src/main/java/com/utic/center/utic/traf/server/service/LinkParamService.java

@@ -108,7 +108,7 @@ public class LinkParamService implements AbstractProcessService {
         this.trafGradeMap.put(t109.getRoadRank(), t107);
     }
 
-    @ProcessingElapsed(type="PARAMETER", name="교통정보 파라미터 로딩", starting = false)
+    @ProcessingElapsed(type="PARAMETER", name="교통정보 파라미터 로딩", starting = false, endLine = true)
     @Override
     public boolean processing() {
         loadTrafficGrade();

+ 1 - 1
utic-traf-server/src/main/java/com/utic/center/utic/traf/server/service/LinkPatternService.java

@@ -63,7 +63,7 @@ public class LinkPatternService implements AbstractProcessService {
         return true;
     }
 
-    @ProcessingElapsed(type="PATTERN", name="링크 패턴정보 로딩", starting = false)
+    @ProcessingElapsed(type="PATTERN", name="링크 패턴정보 로딩", starting = false, endLine = true)
     @Override
     public boolean processing() {
         if (initialize()) {

+ 1 - 1
utic-traf-server/src/main/java/com/utic/center/utic/traf/server/service/LinkTrafAsnService.java

@@ -46,7 +46,7 @@ public class LinkTrafAsnService implements AbstractProcessService {
         }
     }
 
-    @ProcessingElapsed(type="@ASNDB", name="ASN 소통정보 이관", starting = false)
+    @ProcessingElapsed(type="@ASNDB", name="ASN 소통정보 이관", starting = false, endLine = true)
     @Override
     public boolean processing() {
         // 1. 센터정보 조회

+ 1 - 1
utic-traf-server/src/main/java/com/utic/center/utic/traf/server/service/LinkTrafCollectService.java

@@ -76,7 +76,7 @@ public class LinkTrafCollectService implements AbstractProcessService {
         });
     }
 
-    @ProcessingElapsed(type="TRAFFIC", name="수집원별 교통정보 조회", starting = false)
+    @ProcessingElapsed(type="TRAFFIC", name="수집원별 교통정보 조회", starting = false, endLine = true)
     @Override
     public boolean processing() {
 //        initialize(); // 작업전에 초기화 하지 않고 작업이 끝난후에 초기화한다.(LinkTrafPrcsPrepareService)

+ 1 - 1
utic-traf-server/src/main/java/com/utic/center/utic/traf/server/service/LinkTrafFusionService.java

@@ -60,7 +60,7 @@ public class LinkTrafFusionService implements AbstractProcessService {
 //        logInfo("소통정보 초기화", totalCnt, totalCnt, start);
     }
 
-    @ProcessingElapsed(type="TRAFFIC", name="링크 소통정보 퓨전", starting = false)
+    @ProcessingElapsed(type="TRAFFIC", name="링크 소통정보 퓨전", starting = false, endLine = true)
     @Override
     public boolean processing() {
         // 0. 교통정보 초기화

+ 1 - 1
utic-traf-server/src/main/java/com/utic/center/utic/traf/server/service/LinkTrafMissingService.java

@@ -30,7 +30,7 @@ public class LinkTrafMissingService implements AbstractProcessService {
     private final LinkTrafCollectService collectService;
     private final LinkPatternService patternService;
 
-    @ProcessingElapsed(type="TRAFFIC", name="링크 소통정보 결측", starting = false)
+    @ProcessingElapsed(type="TRAFFIC", name="링크 소통정보 결측", starting = false, endLine = true)
     @Override
     public boolean processing() {
         // 모든 결측 알고리즘에 대해 결측 처리를 수행하고

+ 4 - 1
utic-traf-server/src/main/java/com/utic/center/utic/traf/server/service/LinkTrafPrcsAfterService.java

@@ -23,12 +23,15 @@ public class LinkTrafPrcsAfterService implements AbstractProcessService {
     private final UticTrafficRepository uticRepo;
     private final DwdbTrafficRepository dwdbRepo;
 
-    @ProcessingElapsed(type="PRCS", name="교통정보 준비 작업", starting = false)
+    @ProcessingElapsed(type="PRCS", name="교통정보 준비 작업", starting = false, endLine = true)
     @Override
     public boolean processing() {
 
         this.uticRepo.truncateTrafficLoc();         // 지역 교통정보 테이블 초기화
         this.uticRepo.truncateTrafficCenter(ApplicationRepository.nextTrafficCenter); // 작업 할 소통정보 테이블 초기화
+        this.uticRepo.disableIndexes(ApplicationRepository.nextTrafficCenter, "1");
+        this.uticRepo.disableIndexes(ApplicationRepository.nextTrafficCenter, "2");
+        this.uticRepo.disablePrimaryKey(ApplicationRepository.nextTrafficCenter);
 
         // DWDB TRAFFIC_CENTER_MM(TRAFFIC_CENTER_HIST) 초기화
         // 다음달 테이블을 truncate 한다.

+ 1 - 2
utic-traf-server/src/main/java/com/utic/center/utic/traf/server/service/LinkTrafPrcsDebugService.java

@@ -1,6 +1,5 @@
 package com.utic.center.utic.traf.server.service;
 
-import com.utic.center.common.annotation.ProcessingElapsed;
 import com.utic.center.common.service.AbstractProcessService;
 import com.utic.center.utic.traf.server.config.TraceConfig;
 import com.utic.center.utic.traf.server.dto.LinkDto;
@@ -24,7 +23,7 @@ public class LinkTrafPrcsDebugService implements AbstractProcessService {
     private final LinkService linkService;
     private final LinkTrafFusionService fusionService;
 
-    @ProcessingElapsed(type="PRCS", name="교통정보 가공 후 작업", starting = false)
+//    @ProcessingElapsed(type="PRCS", name="교통정보 디버그 출력", starting = false)
     @Override
     public boolean processing() {
 

+ 1 - 1
utic-traf-server/src/main/java/com/utic/center/utic/traf/server/service/LinkTrafPrcsPrepareService.java

@@ -24,7 +24,7 @@ public class LinkTrafPrcsPrepareService implements AbstractProcessService {
     private final LinkPatternService patternService;
     private final LinkTrafCollectService collectService;
 
-    @ProcessingElapsed(type="PRCS", name="교통정보 가공 전처리", starting = false)
+    @ProcessingElapsed(type="PRCS", name="교통정보 가공 전처리", starting = false, endLine = true)
     @Override
     public boolean processing() {
         // 가공정보 완료후 기본정보/파라미터정보/패턴정보를 미리 로딩해 놓는다.

+ 5 - 2
utic-traf-server/src/main/java/com/utic/center/utic/traf/server/service/LinkTrafSaveDwdbService.java

@@ -127,9 +127,12 @@ public class LinkTrafSaveDwdbService implements AbstractProcessService {
             log.warn("[WAN] insertTrafficCenterHist: getValidTrafLinkList no data, job return: [{}].", jobTable);
             return;
         }
-        final ExecutorService executorService = Executors.newFixedThreadPool(threadPoolSize);
 
+        log.info("[INF] {}: Links({}), PoolSize({})", LogUtils.elapsedLog("DWDB BATCH SAVE"), this.linkService.getValidTrafLinkList().size(), threadPoolSize);
+
+        final ExecutorService executorService = Executors.newFixedThreadPool(threadPoolSize);
         mapData.forEach((key, dbmsJobResult) -> {
+//            log.info("[INF] {}: Job({}), Link({})", LogUtils.elapsedLog("BatchThread"), dbmsJobResult.getJobIndex(), dbmsJobResult.getLinkIds().size());
             executorService.execute(() -> batchTrafficCenterHist(this.sqlSessionFactory, dbmsJobResult, this.linkService, jobTable));
         });
 
@@ -165,7 +168,7 @@ public class LinkTrafSaveDwdbService implements AbstractProcessService {
         log.info("[INF] {}", LogUtils.elapsedLog(jobTable, resultCount, System.currentTimeMillis() - start));
     }
 
-    @ProcessingElapsed(type="DWDB", name="교통정보 DWDB 저장", starting = false)
+    @ProcessingElapsed(type="DWDB", name="교통정보 DWDB 저장", starting = false, endLine = true)
     @Override
     public boolean processing() {
         this.histMonth = ApplicationRepository.trafPrcsTime.getPrcsTime().substring(4, 6);

+ 9 - 6
utic-traf-server/src/main/java/com/utic/center/utic/traf/server/service/LinkTrafSaveUticService.java

@@ -34,7 +34,7 @@ public class LinkTrafSaveUticService implements AbstractProcessService {
             .effects(0).elapsedTime(0).build();
 
     private void initialize() {
-
+        final long start = System.currentTimeMillis();
         log.info("[INF] {}: Current, Active({}), Next({})", LogUtils.elapsedLog("TRAFFIC_CENTER(VIEW)"), ApplicationRepository.currTrafficCenter, ApplicationRepository.nextTrafficCenter);
         this.jobResult.setTableName(ApplicationRepository.nextTrafficCenter);//        final long start = System.currentTimeMillis();
         this.jobResult.setEffects(0);
@@ -51,10 +51,10 @@ public class LinkTrafSaveUticService implements AbstractProcessService {
         // 모든 링크에 대해 센터 소통정보 생성
         this.linkService.makeTrafficCenterDto(ApplicationRepository.trafPrcsTime.getPrcsTime());
         this.linkService.makeValidTrafLink();   // 유효한 교통정보 링크 목록 생성
-//        log.info("[INF] {}", LogUtils.elapsedLog("교통정보데이터 가공", System.currentTimeMillis() - start));
+        log.info("[INF] {}", LogUtils.elapsedLog("교통정보 데이터 가공", System.currentTimeMillis() - start));
     }
 
-    @ProcessingElapsed(type="TRAFFIC", name="교통정보 저장", starting = true)
+    @ProcessingElapsed(type="TRAFFIC", name="교통정보 UTIC 저장", endLine = true)
     @Override
     public boolean processing() {
         final long start = System.currentTimeMillis();
@@ -65,9 +65,6 @@ public class LinkTrafSaveUticService implements AbstractProcessService {
         // 데이터 초기화
         initialize();
 
-        // 센터 교통정보 캐시 테이블 초기화
-//        this.uticRepo.truncateTrafficCenterCache();
-
         ExecutorService executorService = Executors.newFixedThreadPool(THREAD_POOL_SIZE);
         executorService.execute(new LinkTrafSaveUticWorker(ApplicationRepository.nextTrafficCenter, this.linkService, this.jobResult, this.trace.isDebug()));
 
@@ -81,6 +78,12 @@ public class LinkTrafSaveUticService implements AbstractProcessService {
             executorService.shutdownNow();
         }
 
+        log.info("[INF] {}", LogUtils.elapsedLog(jobTable, this.jobResult.getEffects(), System.currentTimeMillis() - start));
+
+        this.uticRepo.rebuildIndexes(ApplicationRepository.nextTrafficCenter, "1");
+        this.uticRepo.rebuildIndexes(ApplicationRepository.nextTrafficCenter, "2");
+        this.uticRepo.enablePrimaryKey(ApplicationRepository.nextTrafficCenter);
+
         // VIEW 의 source table을 변경한다.
         this.uticRepo.swapTrafficCenterView(ApplicationRepository.currTrafficCenter, ApplicationRepository.nextTrafficCenter);
 

+ 4 - 1
utic-traf-server/src/main/java/com/utic/center/utic/traf/server/service/worker/LinkTrafSaveUticWorker.java

@@ -55,9 +55,12 @@ public class LinkTrafSaveUticWorker implements Runnable {
             log.warn("[WAN] LinkTrafSaveUticWorker.run: getValidTrafLinkList no data, job return: [{}].", jobTable);
             return;
         }
-        final ExecutorService executorService = Executors.newFixedThreadPool(threadPoolSize);
 
+        log.info("[INF] {}: Links({}), PoolSize({})", LogUtils.elapsedLog("UTIC BATCH SAVE"), this.linkService.getValidTrafLinkList().size(), threadPoolSize);
+
+        final ExecutorService executorService = Executors.newFixedThreadPool(threadPoolSize);
         mapData.forEach((key, dbmsJobResult) -> {
+//            log.info("[INF] {}: Job({}), Link({})", LogUtils.elapsedLog("BatchThread"), dbmsJobResult.getJobIndex(), dbmsJobResult.getLinkIds().size());
             executorService.execute(() -> processBatch(sqlSessionFactory, dbmsJobResult, this.linkService, jobTable));
         });
 

+ 5 - 7
utic-traf-server/src/main/resources/mybatis/mapper/utic/UticTrafficMapper.xml

@@ -58,29 +58,27 @@
 
     <!-- 1. Disable Indexes -->
     <update id="disableIndexes">
-        ALTER INDEX ${tableName}_IDX1 UNUSABLE;
-        ALTER INDEX ${tableName}_IDX2 UNUSABLE;
+        ALTER INDEX ${tableName}_IDX${index} UNUSABLE
     </update>
 
     <!-- 2. Disable Primary Key Constraint -->
     <update id="disablePrimaryKey">
-        ALTER TABLE ${tableName} DISABLE CONSTRAINT PK_${tableName};
+        ALTER TABLE ${tableName} DISABLE CONSTRAINT PK_${tableName}
     </update>
 
     <!-- 4. Rebuild Indexes -->
     <update id="rebuildIndexes">
-        ALTER INDEX ${tableName}_IDX1 REBUILD PARALLEL 4 NOLOGGING;
-        ALTER INDEX ${tableName}_IDX2 REBUILD PARALLEL 4 NOLOGGING;
+        ALTER INDEX ${tableName}_IDX${index} REBUILD PARALLEL 4 NOLOGGING
     </update>
 
     <!-- 5. Enable Primary Key Constraint -->
     <update id="enablePrimaryKey">
-        ALTER TABLE ${tableName} ENABLE CONSTRAINT PK_${tableName};
+        ALTER TABLE ${tableName} ENABLE CONSTRAINT PK_${tableName}
     </update>
 
     <insert id="insertTrafficCenter">
         <![CDATA[
-        INSERT /*+ APPEND PARALLEL(${tableName}, 6) */ INTO ${tableName} NOLOGGING (
+        INSERT /*+ APPEND PARALLEL(${tableName}, 2) */ INTO ${tableName} NOLOGGING (
             LINKID,
             MISSVALUEYN,
             REGDATE,