|
@@ -36,6 +36,7 @@ public class GgitsEtlpService {
|
|
|
private final GgitsMapper gitsMapper;
|
|
|
private final SigMapper sigMapper;
|
|
|
private final SigDao dao;
|
|
|
+ private final int MAX_PAGE_COUNT = 50000;
|
|
|
private List<String> centerList;
|
|
|
|
|
|
@PostConstruct
|
|
@@ -65,30 +66,37 @@ public class GgitsEtlpService {
|
|
|
|
|
|
public void run() {
|
|
|
Elapsed elapsed = new Elapsed();
|
|
|
- log.info("================================================================================================>");
|
|
|
- log.info("GGITS DBASE ETLP START.");
|
|
|
+ log.info("************************************************************************************************>");
|
|
|
+ log.info("GGITS DBASE ETLP TO SIG START.");
|
|
|
|
|
|
initEtlp();
|
|
|
|
|
|
-// //교차로구성_연계, SCS_T_CON_INTLC
|
|
|
+ //교차로구성_연계, SCS_T_CON_INTLC
|
|
|
etlpIntLc();
|
|
|
+
|
|
|
//교차로이동류_연계, SCS_T_CON_INTFLOW
|
|
|
etlpIntFlow();
|
|
|
+
|
|
|
//교차로일계획_연계, SCS_T_CON_INTDPLAN
|
|
|
etlpIntDPlan();
|
|
|
-// //교차로주간계획_연계, SCS_T_CON_INTWEEK
|
|
|
+
|
|
|
+ //교차로주간계획_연계, SCS_T_CON_INTWEEK
|
|
|
etlpIntWeek();
|
|
|
-// //교차로예약계획_연계, SCS_T_CON_INTFPLAN
|
|
|
+
|
|
|
+ //교차로예약계획_연계, SCS_T_CON_INTFPLAN
|
|
|
etlpIntFPlan();
|
|
|
-// //교차로시그널맵_연계, SCS_T_CON_INTSIGMAP
|
|
|
+
|
|
|
+ //교차로시그널맵_연계, SCS_T_CON_INTSIGMAP
|
|
|
etlpIntSigmap();
|
|
|
- log.info("GGITS DBASE ETLP ..END: {}", elapsed.elapsedTimeStr());
|
|
|
- log.info("<================================================================================================");
|
|
|
+
|
|
|
+ log.info("GGITS DBASE ETLP TO SIG ..END: {}", elapsed.elapsedTimeStr());
|
|
|
+ log.info("<************************************************************************************************");
|
|
|
}
|
|
|
|
|
|
//교차로구성_연계, SCS_T_CON_INTLC
|
|
|
private void etlpIntLc() {
|
|
|
Elapsed elapsed = new Elapsed();
|
|
|
+ Elapsed totElapsed = new Elapsed();
|
|
|
log.info("TB_INT, SCS_T_CON_INTLC START.");
|
|
|
List<HashMap<String, Object>> lists = new ArrayList<>();
|
|
|
|
|
@@ -97,6 +105,8 @@ public class GgitsEtlpService {
|
|
|
if (center == null) {
|
|
|
continue;
|
|
|
}
|
|
|
+ TimeUtils.sleep(500);
|
|
|
+
|
|
|
int writeCount = 0;
|
|
|
Elapsed job = new Elapsed();
|
|
|
EtlpInfo etlp = center.getEtlpIntLc();
|
|
@@ -117,8 +127,9 @@ public class GgitsEtlpService {
|
|
|
|
|
|
List<TbScsTConIntLc> jobLists = this.gitsMapper.selectScsTConIntLc(center);
|
|
|
|
|
|
- log.info("TB_INT, SCS_T_CON_INTLC START. {}, {}, SIG: {} EA, GGITS: {} EA.",
|
|
|
- center.getRegionCd(), center.getRegionNm(), intLists.size(), jobLists.size());
|
|
|
+ log.info("TB_INT, SCS_T_CON_INTLC .READ. {}, {}, SIG: {} EA, GGITS: {} EA. {}",
|
|
|
+ center.getRegionCd(), center.getRegionNm(), intLists.size(), jobLists.size(), job.elapsedTimeStr());
|
|
|
+ job.reset();
|
|
|
|
|
|
center.getEtlpIntLc().setReadCount(jobLists.size());
|
|
|
|
|
@@ -146,26 +157,27 @@ public class GgitsEtlpService {
|
|
|
}
|
|
|
etlp.setWriteCount(writeCount);
|
|
|
etlp.setSuccess(true);
|
|
|
- log.info("TB_INT, SCS_T_CON_INTLC ..END. {}, {}, JOB: {}, WRITE: {} EA. {} ms.",
|
|
|
- center.getRegionCd(), center.getRegionNm(), jobLists.size(), writeCount, job.milliSeconds());
|
|
|
+ log.info("TB_INT, SCS_T_CON_INTLC WRITE. {}, {}, {} EA. {}",
|
|
|
+ center.getRegionCd(), center.getRegionNm(), writeCount, elapsed.elapsedTimeStr());
|
|
|
+ log.info("-------------------------------------------------------------------------------------------------");
|
|
|
}
|
|
|
catch (Exception e) {
|
|
|
etlp.setSuccess(false);
|
|
|
- log.error("{}", lists.get(0));
|
|
|
log.error("TB_INT, SCS_T_CON_INTLC: {}, {}, Exceptions: {}", center.getRegionCd(), center.getRegionNm(), e.getMessage());
|
|
|
}
|
|
|
finally {
|
|
|
- center.setElapsed(center.getElapsed() + job.milliSeconds());
|
|
|
+ center.setElapsed(center.getElapsed() + elapsed.milliSeconds());
|
|
|
MDC.remove(center.getLogKey());
|
|
|
MDC.clear();
|
|
|
}
|
|
|
}
|
|
|
- log.info("TB_INT, SCS_T_CON_INTLC ..END: {}", elapsed.elapsedTimeStr());
|
|
|
+ log.info("TB_INT, SCS_T_CON_INTLC ..END: {}", totElapsed.elapsedTimeStr());
|
|
|
}
|
|
|
|
|
|
//교차로이동류_연계, SCS_T_CON_INTFLOW
|
|
|
private void etlpIntFlow() {
|
|
|
Elapsed elapsed = new Elapsed();
|
|
|
+ Elapsed totElapsed = new Elapsed();
|
|
|
log.info("TB_INT_FLOW, SCS_T_CON_INTFLOW START.");
|
|
|
List<HashMap<String, Object>> lists = new ArrayList<>();
|
|
|
|
|
@@ -174,7 +186,11 @@ public class GgitsEtlpService {
|
|
|
if (center == null) {
|
|
|
continue;
|
|
|
}
|
|
|
+ TimeUtils.sleep(500);
|
|
|
+ elapsed.reset();
|
|
|
+
|
|
|
int writeCount = 0;
|
|
|
+ int currWriteCount = 0;
|
|
|
Elapsed job = new Elapsed();
|
|
|
EtlpInfo etlp = center.getEtlpFlow();
|
|
|
etlp.setSuccess(false);
|
|
@@ -183,42 +199,69 @@ public class GgitsEtlpService {
|
|
|
MDC.put("id", center.getLogKey());
|
|
|
log.info("TB_INT_FLOW, SCS_T_CON_INTFLOW START. {}, {}, {}, {}",
|
|
|
center.getRegionCd(), center.getRegionNm(), center.getMinNodeId(), center.getMaxNodeId());
|
|
|
- List<TbScsTConIntFlow> result = this.gitsMapper.selectScsTConIntFlow(center);
|
|
|
- etlp.setReadCount(result.size());
|
|
|
|
|
|
- lists = new ArrayList<>();
|
|
|
- for(TbScsTConIntFlow obj: result) {
|
|
|
- HashMap<String, Object> param = obj.toSig(center.getRegionCd());
|
|
|
- lists.add(param);
|
|
|
- if (lists.size() >= BatchDaoService.MAX_BATCH_SIZE) {
|
|
|
- writeCount += this.dao.updateTbIntFlow(lists);
|
|
|
+ Integer dataCount = this.gitsMapper.selectScsTConIntFlowCount(center);
|
|
|
+ etlp.setReadCount(dataCount);
|
|
|
+ log.info("TB_INT_FLOW, SCS_T_CON_INTFLOW .READ. {}, {}, {} EA. {}",
|
|
|
+ center.getRegionCd(), center.getRegionNm(), dataCount, job.elapsedTimeStr());
|
|
|
+
|
|
|
+ if (dataCount > 0) {
|
|
|
+ int fromSeq, toSeq;
|
|
|
+ int pageCount = (dataCount / MAX_PAGE_COUNT) + 1;
|
|
|
+ if (0 == (dataCount % MAX_PAGE_COUNT)) {
|
|
|
+ pageCount--;
|
|
|
+ }
|
|
|
+ for (int ii = 0; ii < pageCount; ii++) {
|
|
|
+ fromSeq = (ii * MAX_PAGE_COUNT);
|
|
|
+ toSeq = fromSeq + MAX_PAGE_COUNT;
|
|
|
+ fromSeq++;
|
|
|
+ List<TbScsTConIntFlow> result = this.gitsMapper.selectScsTConIntFlow(center, fromSeq, toSeq);
|
|
|
+ log.info("TB_INT_FLOW, SCS_T_CON_INTFLOW .READ. {}, {}, {}. {}",
|
|
|
+ center.getRegionCd(), center.getRegionNm(), String.format("%6d ~ %6d, %6d EA", fromSeq, toSeq, result.size()), job.elapsedTimeStr());
|
|
|
+ TimeUtils.sleep(500);
|
|
|
+ job.reset();
|
|
|
+
|
|
|
lists = new ArrayList<>();
|
|
|
+ currWriteCount = 0;
|
|
|
+ for(TbScsTConIntFlow obj: result) {
|
|
|
+ HashMap<String, Object> param = obj.toSig(center.getRegionCd());
|
|
|
+ lists.add(param);
|
|
|
+ if (lists.size() >= BatchDaoService.MAX_BATCH_SIZE) {
|
|
|
+ currWriteCount += this.dao.updateTbIntFlow(lists);
|
|
|
+ lists = new ArrayList<>();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!lists.isEmpty()) {
|
|
|
+ currWriteCount += this.dao.updateTbIntFlow(lists);
|
|
|
+ }
|
|
|
+ writeCount += currWriteCount;
|
|
|
+ log.info("TB_INT_FLOW, SCS_T_CON_INTFLOW WRITE. {}, {}, {}. {}",
|
|
|
+ center.getRegionCd(), center.getRegionNm(), String.format("%6d ~ %6d, %6d EA", fromSeq, toSeq, currWriteCount), job.elapsedTimeStr());
|
|
|
}
|
|
|
}
|
|
|
- if (!lists.isEmpty()) {
|
|
|
- writeCount += this.dao.updateTbIntFlow(lists);
|
|
|
- }
|
|
|
etlp.setWriteCount(writeCount);
|
|
|
etlp.setSuccess(true);
|
|
|
- log.info("TB_INT_FLOW, SCS_T_CON_INTFLOW ..END. {}, {}, JOB: {}, WRITE: {} EA. {} ms.",
|
|
|
- center.getRegionCd(), center.getRegionNm(), result.size(), writeCount, job.milliSeconds());
|
|
|
+ log.info("TB_INT_FLOW, SCS_T_CON_INTFLOW WRITE. {}, {}, {} EA. {}",
|
|
|
+ center.getRegionCd(), center.getRegionNm(), writeCount, elapsed.elapsedTimeStr());
|
|
|
+ log.info("-------------------------------------------------------------------------------------------------");
|
|
|
}
|
|
|
catch (Exception e) {
|
|
|
etlp.setSuccess(false);
|
|
|
- log.error("{}", lists.get(0));
|
|
|
log.error("TB_INT_FLOW, SCS_T_CON_INTFLOW: {}, {}, Exceptions: {}", center.getRegionCd(), center.getRegionNm(), e.getMessage());
|
|
|
}
|
|
|
finally {
|
|
|
- center.setElapsed(center.getElapsed() + job.milliSeconds());
|
|
|
+ center.setElapsed(center.getElapsed() + elapsed.milliSeconds());
|
|
|
MDC.remove(center.getLogKey());
|
|
|
MDC.clear();
|
|
|
}
|
|
|
}
|
|
|
- log.info("TB_INT_FLOW, SCS_T_CON_INTFLOW ..END: {}", elapsed.elapsedTimeStr());
|
|
|
+ log.info("TB_INT_FLOW, SCS_T_CON_INTFLOW ..END: {}", totElapsed.elapsedTimeStr());
|
|
|
}
|
|
|
+
|
|
|
//교차로일계획_연계, SCS_T_CON_INTDPLAN
|
|
|
private void etlpIntDPlan() {
|
|
|
Elapsed elapsed = new Elapsed();
|
|
|
+ Elapsed totElapsed = new Elapsed();
|
|
|
log.info("TB_INT_OPER_PLAN, SCS_T_CON_INTDPLAN START.");
|
|
|
List<HashMap<String, Object>> lists = new ArrayList<>();
|
|
|
|
|
@@ -227,7 +270,11 @@ public class GgitsEtlpService {
|
|
|
if (center == null) {
|
|
|
continue;
|
|
|
}
|
|
|
+ TimeUtils.sleep(500);
|
|
|
+ elapsed.reset();
|
|
|
+
|
|
|
int writeCount = 0;
|
|
|
+ int currWriteCount = 0;
|
|
|
Elapsed job = new Elapsed();
|
|
|
EtlpInfo etlp = center.getEtlpDPlan();
|
|
|
etlp.setSuccess(false);
|
|
@@ -236,42 +283,69 @@ public class GgitsEtlpService {
|
|
|
MDC.put("id", center.getLogKey());
|
|
|
log.info("TB_INT_OPER_PLAN, SCS_T_CON_INTDPLAN START. {}, {}, {}, {}",
|
|
|
center.getRegionCd(), center.getRegionNm(), center.getMinNodeId(), center.getMaxNodeId());
|
|
|
- List<TbScsTConIntDPlan> result = this.gitsMapper.selectScsTConIntDPlan(center);
|
|
|
- etlp.setReadCount(result.size());
|
|
|
|
|
|
- lists = new ArrayList<>();
|
|
|
- for(TbScsTConIntDPlan obj: result) {
|
|
|
- HashMap<String, Object> param = obj.toSig(center.getRegionCd());
|
|
|
- lists.add(param);
|
|
|
- if (lists.size() >= BatchDaoService.MAX_BATCH_SIZE) {
|
|
|
- writeCount += this.dao.updateTbIntOperPlan(lists);
|
|
|
+ Integer dataCount = this.gitsMapper.selectScsTConIntDPlanCount(center);
|
|
|
+ etlp.setReadCount(dataCount);
|
|
|
+ log.info("TB_INT_OPER_PLAN, SCS_T_CON_INTDPLAN .READ. {}, {}, {} EA. {}",
|
|
|
+ center.getRegionCd(), center.getRegionNm(), dataCount, job.elapsedTimeStr());
|
|
|
+
|
|
|
+ if (dataCount > 0) {
|
|
|
+ int fromSeq, toSeq;
|
|
|
+ int pageCount = (dataCount / MAX_PAGE_COUNT) + 1;
|
|
|
+ if (0 == (dataCount % MAX_PAGE_COUNT)) {
|
|
|
+ pageCount--;
|
|
|
+ }
|
|
|
+ for (int ii = 0; ii < pageCount; ii++) {
|
|
|
+ fromSeq = (ii * MAX_PAGE_COUNT);
|
|
|
+ toSeq = fromSeq + MAX_PAGE_COUNT;
|
|
|
+ fromSeq++;
|
|
|
+ List<TbScsTConIntDPlan> result = this.gitsMapper.selectScsTConIntDPlan(center, fromSeq, toSeq);
|
|
|
+ log.info("TB_INT_OPER_PLAN, SCS_T_CON_INTDPLAN .READ. {}, {}, {}. {}",
|
|
|
+ center.getRegionCd(), center.getRegionNm(), String.format("%6d ~ %6d, %6d EA", fromSeq, toSeq, result.size()), job.elapsedTimeStr());
|
|
|
+ TimeUtils.sleep(500);
|
|
|
+ job.reset();
|
|
|
+
|
|
|
lists = new ArrayList<>();
|
|
|
+ currWriteCount = 0;
|
|
|
+ for(TbScsTConIntDPlan obj: result) {
|
|
|
+ HashMap<String, Object> param = obj.toSig(center.getRegionCd());
|
|
|
+ lists.add(param);
|
|
|
+ if (lists.size() >= BatchDaoService.MAX_BATCH_SIZE) {
|
|
|
+ currWriteCount += this.dao.updateTbIntOperPlan(lists);
|
|
|
+ lists = new ArrayList<>();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!lists.isEmpty()) {
|
|
|
+ currWriteCount += this.dao.updateTbIntOperPlan(lists);
|
|
|
+ }
|
|
|
+ writeCount += currWriteCount;
|
|
|
+ log.info("TB_INT_OPER_PLAN, SCS_T_CON_INTDPLAN WRITE. {}, {}, {}. {}",
|
|
|
+ center.getRegionCd(), center.getRegionNm(), String.format("%6d ~ %6d, %6d EA", fromSeq, toSeq, currWriteCount), job.elapsedTimeStr());
|
|
|
}
|
|
|
}
|
|
|
- if (!lists.isEmpty()) {
|
|
|
- writeCount += this.dao.updateTbIntOperPlan(lists);
|
|
|
- }
|
|
|
etlp.setWriteCount(writeCount);
|
|
|
etlp.setSuccess(true);
|
|
|
- log.info("TB_INT_OPER_PLAN, SCS_T_CON_INTDPLAN ..END. {}, {}, JOB: {}, WRITE: {} EA. {} ms.",
|
|
|
- center.getRegionCd(), center.getRegionNm(), result.size(), writeCount, job.milliSeconds());
|
|
|
+ log.info("TB_INT_OPER_PLAN, SCS_T_CON_INTDPLAN WRITE. {}, {}, {} EA. {}",
|
|
|
+ center.getRegionCd(), center.getRegionNm(), writeCount, elapsed.elapsedTimeStr());
|
|
|
+ log.info("-------------------------------------------------------------------------------------------------");
|
|
|
}
|
|
|
catch (Exception e) {
|
|
|
etlp.setSuccess(false);
|
|
|
- log.error("{}", lists.get(0));
|
|
|
log.error("TB_INT_OPER_PLAN, SCS_T_CON_INTDPLAN: {}, {}, Exceptions: {}", center.getRegionCd(), center.getRegionNm(), e.getMessage());
|
|
|
}
|
|
|
finally {
|
|
|
- center.setElapsed(center.getElapsed() + job.milliSeconds());
|
|
|
+ center.setElapsed(center.getElapsed() + elapsed.milliSeconds());
|
|
|
MDC.remove(center.getLogKey());
|
|
|
MDC.clear();
|
|
|
}
|
|
|
}
|
|
|
- log.info("TB_INT_OPER_PLAN, SCS_T_CON_INTDPLAN ..END: {}", elapsed.elapsedTimeStr());
|
|
|
+ log.info("TB_INT_OPER_PLAN, SCS_T_CON_INTDPLAN ..END: {}", totElapsed.elapsedTimeStr());
|
|
|
}
|
|
|
+
|
|
|
//교차로주간계획_연계, SCS_T_CON_INTWEEK
|
|
|
private void etlpIntWeek() {
|
|
|
Elapsed elapsed = new Elapsed();
|
|
|
+ Elapsed totElapsed = new Elapsed();
|
|
|
log.info("TB_INT_DY_PLAN, SCS_T_CON_INTWEEK START.");
|
|
|
List<HashMap<String, Object>> lists = new ArrayList<>();
|
|
|
|
|
@@ -280,7 +354,11 @@ public class GgitsEtlpService {
|
|
|
if (center == null) {
|
|
|
continue;
|
|
|
}
|
|
|
+ TimeUtils.sleep(500);
|
|
|
+ elapsed.reset();
|
|
|
+
|
|
|
int writeCount = 0;
|
|
|
+ int currWriteCount = 0;
|
|
|
Elapsed job = new Elapsed();
|
|
|
EtlpInfo etlp = center.getEtlpWeek();
|
|
|
etlp.setSuccess(false);
|
|
@@ -289,42 +367,69 @@ public class GgitsEtlpService {
|
|
|
MDC.put("id", center.getLogKey());
|
|
|
log.info("TB_INT_DY_PLAN, SCS_T_CON_INTWEEK START. {}, {}, {}, {}",
|
|
|
center.getRegionCd(), center.getRegionNm(), center.getMinNodeId(), center.getMaxNodeId());
|
|
|
- List<TbScsTConIntWeek> result = this.gitsMapper.selectScsTConIntWeek(center);
|
|
|
- etlp.setReadCount(result.size());
|
|
|
|
|
|
- lists = new ArrayList<>();
|
|
|
- for(TbScsTConIntWeek obj: result) {
|
|
|
- HashMap<String, Object> param = obj.toSig(center.getRegionCd());
|
|
|
- lists.add(param);
|
|
|
- if (lists.size() >= BatchDaoService.MAX_BATCH_SIZE) {
|
|
|
- writeCount += this.dao.updateTbIntDyPlan(lists);
|
|
|
+ Integer dataCount = this.gitsMapper.selectScsTConIntWeekCount(center);
|
|
|
+ etlp.setReadCount(dataCount);
|
|
|
+ log.info("TB_INT_DY_PLAN, SCS_T_CON_INTWEEK .READ. {}, {}, {} EA. {}",
|
|
|
+ center.getRegionCd(), center.getRegionNm(), dataCount, job.elapsedTimeStr());
|
|
|
+
|
|
|
+ if (dataCount > 0) {
|
|
|
+ int fromSeq, toSeq;
|
|
|
+ int pageCount = (dataCount / MAX_PAGE_COUNT) + 1;
|
|
|
+ if (0 == (dataCount % MAX_PAGE_COUNT)) {
|
|
|
+ pageCount--;
|
|
|
+ }
|
|
|
+ for (int ii = 0; ii < pageCount; ii++) {
|
|
|
+ fromSeq = (ii * MAX_PAGE_COUNT);
|
|
|
+ toSeq = fromSeq + MAX_PAGE_COUNT;
|
|
|
+ fromSeq++;
|
|
|
+ List<TbScsTConIntWeek> result = this.gitsMapper.selectScsTConIntWeek(center, fromSeq, toSeq);
|
|
|
+ log.info("TB_INT_DY_PLAN, SCS_T_CON_INTWEEK .READ. {}, {}, {}. {}",
|
|
|
+ center.getRegionCd(), center.getRegionNm(), String.format("%6d ~ %6d, %6d EA", fromSeq, toSeq, result.size()), job.elapsedTimeStr());
|
|
|
+ TimeUtils.sleep(500);
|
|
|
+ job.reset();
|
|
|
+
|
|
|
lists = new ArrayList<>();
|
|
|
+ currWriteCount = 0;
|
|
|
+ for(TbScsTConIntWeek obj: result) {
|
|
|
+ HashMap<String, Object> param = obj.toSig(center.getRegionCd());
|
|
|
+ lists.add(param);
|
|
|
+ if (lists.size() >= BatchDaoService.MAX_BATCH_SIZE) {
|
|
|
+ currWriteCount += this.dao.updateTbIntDyPlan(lists);
|
|
|
+ lists = new ArrayList<>();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!lists.isEmpty()) {
|
|
|
+ currWriteCount += this.dao.updateTbIntDyPlan(lists);
|
|
|
+ }
|
|
|
+ writeCount += currWriteCount;
|
|
|
+ log.info("TB_INT_DY_PLAN, SCS_T_CON_INTWEEK WRITE. {}, {}, {}. {}",
|
|
|
+ center.getRegionCd(), center.getRegionNm(), String.format("%6d ~ %6d, %6d EA", fromSeq, toSeq, currWriteCount), job.elapsedTimeStr());
|
|
|
}
|
|
|
}
|
|
|
- if (!lists.isEmpty()) {
|
|
|
- writeCount += this.dao.updateTbIntDyPlan(lists);
|
|
|
- }
|
|
|
etlp.setWriteCount(writeCount);
|
|
|
etlp.setSuccess(true);
|
|
|
- log.info("TB_INT_DY_PLAN, SCS_T_CON_INTWEEK ..END. {}, {}, JOB: {}, WRITE: {} EA. {} ms.",
|
|
|
- center.getRegionCd(), center.getRegionNm(), result.size(), writeCount, job.milliSeconds());
|
|
|
+ log.info("TB_INT_DY_PLAN, SCS_T_CON_INTWEEK WRITE. {}, {}, {} EA. {}",
|
|
|
+ center.getRegionCd(), center.getRegionNm(), writeCount, elapsed.elapsedTimeStr());
|
|
|
+ log.info("-------------------------------------------------------------------------------------------------");
|
|
|
}
|
|
|
catch (Exception e) {
|
|
|
etlp.setSuccess(false);
|
|
|
- log.error("{}", lists.get(0));
|
|
|
log.error("TB_INT_DY_PLAN, SCS_T_CON_INTWEEK: {}, {}, Exceptions: {}", center.getRegionCd(), center.getRegionNm(), e.getMessage());
|
|
|
}
|
|
|
finally {
|
|
|
- center.setElapsed(center.getElapsed() + job.milliSeconds());
|
|
|
+ center.setElapsed(center.getElapsed() + elapsed.milliSeconds());
|
|
|
MDC.remove(center.getLogKey());
|
|
|
MDC.clear();
|
|
|
}
|
|
|
}
|
|
|
- log.info("TB_INT_DY_PLAN, SCS_T_CON_INTWEEK ..END: {}", elapsed.elapsedTimeStr());
|
|
|
+ log.info("TB_INT_DY_PLAN, SCS_T_CON_INTWEEK ..END: {}", totElapsed.elapsedTimeStr());
|
|
|
}
|
|
|
+
|
|
|
//교차로예약계획_연계, SCS_T_CON_INTFPLAN
|
|
|
private void etlpIntFPlan() {
|
|
|
Elapsed elapsed = new Elapsed();
|
|
|
+ Elapsed totElapsed = new Elapsed();
|
|
|
log.info("TB_INT_RESRV_PLAN, SCS_T_CON_INTFPLAN START.");
|
|
|
List<HashMap<String, Object>> lists = new ArrayList<>();
|
|
|
|
|
@@ -333,7 +438,11 @@ public class GgitsEtlpService {
|
|
|
if (center == null) {
|
|
|
continue;
|
|
|
}
|
|
|
+ TimeUtils.sleep(500);
|
|
|
+ elapsed.reset();
|
|
|
+
|
|
|
int writeCount = 0;
|
|
|
+ int currWriteCount = 0;
|
|
|
Elapsed job = new Elapsed();
|
|
|
EtlpInfo etlp = center.getEtlpFPlan();
|
|
|
etlp.setSuccess(false);
|
|
@@ -342,42 +451,69 @@ public class GgitsEtlpService {
|
|
|
MDC.put("id", center.getLogKey());
|
|
|
log.info("TB_INT_RESRV_PLAN, SCS_T_CON_INTFPLAN START. {}, {}, {}, {}",
|
|
|
center.getRegionCd(), center.getRegionNm(), center.getMinNodeId(), center.getMaxNodeId());
|
|
|
- List<TbScsTConIntFPlan> result = this.gitsMapper.selectScsTConIntFPlan(center);
|
|
|
- etlp.setReadCount(result.size());
|
|
|
|
|
|
- lists = new ArrayList<>();
|
|
|
- for(TbScsTConIntFPlan obj: result) {
|
|
|
- HashMap<String, Object> param = obj.toSig(center.getRegionCd());
|
|
|
- lists.add(param);
|
|
|
- if (lists.size() >= BatchDaoService.MAX_BATCH_SIZE) {
|
|
|
- writeCount += this.dao.updateTbIntResrvPlan(lists);
|
|
|
+ Integer dataCount = this.gitsMapper.selectScsTConIntFPlanCount(center);
|
|
|
+ etlp.setReadCount(dataCount);
|
|
|
+ log.info("TB_INT_RESRV_PLAN, SCS_T_CON_INTFPLAN .READ. {}, {}, {} EA. {}",
|
|
|
+ center.getRegionCd(), center.getRegionNm(), dataCount, job.elapsedTimeStr());
|
|
|
+
|
|
|
+ if (dataCount > 0) {
|
|
|
+ int fromSeq, toSeq;
|
|
|
+ int pageCount = (dataCount / MAX_PAGE_COUNT) + 1;
|
|
|
+ if (0 == (dataCount % MAX_PAGE_COUNT)) {
|
|
|
+ pageCount--;
|
|
|
+ }
|
|
|
+ for (int ii = 0; ii < pageCount; ii++) {
|
|
|
+ fromSeq = (ii * MAX_PAGE_COUNT);
|
|
|
+ toSeq = fromSeq + MAX_PAGE_COUNT;
|
|
|
+ fromSeq++;
|
|
|
+ List<TbScsTConIntFPlan> result = this.gitsMapper.selectScsTConIntFPlan(center, fromSeq, toSeq);
|
|
|
+ log.info("TB_INT_RESRV_PLAN, SCS_T_CON_INTFPLAN .READ. {}, {}, {}. {}",
|
|
|
+ center.getRegionCd(), center.getRegionNm(), String.format("%6d ~ %6d, %6d EA", fromSeq, toSeq, result.size()), job.elapsedTimeStr());
|
|
|
+ TimeUtils.sleep(500);
|
|
|
+ job.reset();
|
|
|
+
|
|
|
lists = new ArrayList<>();
|
|
|
+ currWriteCount = 0;
|
|
|
+ for(TbScsTConIntFPlan obj: result) {
|
|
|
+ HashMap<String, Object> param = obj.toSig(center.getRegionCd());
|
|
|
+ lists.add(param);
|
|
|
+ if (lists.size() >= BatchDaoService.MAX_BATCH_SIZE) {
|
|
|
+ currWriteCount += this.dao.updateTbIntResrvPlan(lists);
|
|
|
+ lists = new ArrayList<>();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!lists.isEmpty()) {
|
|
|
+ currWriteCount += this.dao.updateTbIntResrvPlan(lists);
|
|
|
+ }
|
|
|
+ writeCount += currWriteCount;
|
|
|
+ log.info("TB_INT_RESRV_PLAN, SCS_T_CON_INTFPLAN WRITE. {}, {}, {}. {}",
|
|
|
+ center.getRegionCd(), center.getRegionNm(), String.format("%6d ~ %6d, %6d EA", fromSeq, toSeq, currWriteCount), job.elapsedTimeStr());
|
|
|
}
|
|
|
}
|
|
|
- if (!lists.isEmpty()) {
|
|
|
- writeCount += this.dao.updateTbIntResrvPlan(lists);
|
|
|
- }
|
|
|
etlp.setWriteCount(writeCount);
|
|
|
etlp.setSuccess(true);
|
|
|
- log.info("TB_INT_RESRV_PLAN, SCS_T_CON_INTFPLAN ..END. {}, {}, JOB: {}, WRITE: {} EA. {} ms.",
|
|
|
- center.getRegionCd(), center.getRegionNm(), result.size(), writeCount, job.milliSeconds());
|
|
|
+ log.info("TB_INT_RESRV_PLAN, SCS_T_CON_INTFPLAN WRITE. {}, {}, {} EA. {}",
|
|
|
+ center.getRegionCd(), center.getRegionNm(), writeCount, elapsed.elapsedTimeStr());
|
|
|
+ log.info("-------------------------------------------------------------------------------------------------");
|
|
|
}
|
|
|
catch (Exception e) {
|
|
|
etlp.setSuccess(false);
|
|
|
- log.error("{}", lists.get(0));
|
|
|
log.error("TB_INT_RESRV_PLAN, SCS_T_CON_INTFPLAN: {}, {}, Exceptions: {}", center.getRegionCd(), center.getRegionNm(), e.getMessage());
|
|
|
}
|
|
|
finally {
|
|
|
- center.setElapsed(center.getElapsed() + job.milliSeconds());
|
|
|
+ center.setElapsed(center.getElapsed() + elapsed.milliSeconds());
|
|
|
MDC.remove(center.getLogKey());
|
|
|
MDC.clear();
|
|
|
}
|
|
|
}
|
|
|
- log.info("TB_INT_RESRV_PLAN, SCS_T_CON_INTFPLAN ..END: {}", elapsed.elapsedTimeStr());
|
|
|
+ log.info("TB_INT_RESRV_PLAN, SCS_T_CON_INTFPLAN ..END: {}", totElapsed.elapsedTimeStr());
|
|
|
}
|
|
|
+
|
|
|
//교차로시그널맵_연계, SCS_T_CON_INTSIGMAP
|
|
|
private void etlpIntSigmap() {
|
|
|
Elapsed elapsed = new Elapsed();
|
|
|
+ Elapsed totElapsed = new Elapsed();
|
|
|
log.info("TB_INT_SIGNALMAP, SCS_T_CON_INTSIGMAP START.");
|
|
|
List<HashMap<String, Object>> lists = new ArrayList<>();
|
|
|
|
|
@@ -386,7 +522,11 @@ public class GgitsEtlpService {
|
|
|
if (center == null) {
|
|
|
continue;
|
|
|
}
|
|
|
+ TimeUtils.sleep(500);
|
|
|
+ elapsed.reset();
|
|
|
+
|
|
|
int writeCount = 0;
|
|
|
+ int currWriteCount = 0;
|
|
|
Elapsed job = new Elapsed();
|
|
|
EtlpInfo etlp = center.getEtlpSigmap();
|
|
|
etlp.setSuccess(false);
|
|
@@ -395,38 +535,62 @@ public class GgitsEtlpService {
|
|
|
MDC.put("id", center.getLogKey());
|
|
|
log.info("TB_INT_SIGNALMAP, SCS_T_CON_INTSIGMAP START. {}, {}, {}, {}",
|
|
|
center.getRegionCd(), center.getRegionNm(), center.getMinNodeId(), center.getMaxNodeId());
|
|
|
- List<TbScsTConIntSigmap> result = this.gitsMapper.selectScsTConIntSigmap(center);
|
|
|
- etlp.setReadCount(result.size());
|
|
|
|
|
|
- lists = new ArrayList<>();
|
|
|
- for(TbScsTConIntSigmap obj: result) {
|
|
|
- HashMap<String, Object> param = obj.toSig(center.getRegionCd());
|
|
|
- lists.add(param);
|
|
|
- if (lists.size() >= BatchDaoService.MAX_BATCH_SIZE) {
|
|
|
- writeCount += this.dao.updateTbIntSignalMap(lists);
|
|
|
+ Integer dataCount = this.gitsMapper.selectScsTConIntSigmapCount(center);
|
|
|
+ etlp.setReadCount(dataCount);
|
|
|
+ log.info("TB_INT_SIGNALMAP, SCS_T_CON_INTSIGMAP .READ. {}, {}, {} EA. {}",
|
|
|
+ center.getRegionCd(), center.getRegionNm(), dataCount, job.elapsedTimeStr());
|
|
|
+
|
|
|
+ if (dataCount > 0) {
|
|
|
+ int fromSeq, toSeq;
|
|
|
+ int pageCount = (dataCount / MAX_PAGE_COUNT) + 1;
|
|
|
+ if (0 == (dataCount % MAX_PAGE_COUNT)) {
|
|
|
+ pageCount--;
|
|
|
+ }
|
|
|
+ for (int ii = 0; ii < pageCount; ii++) {
|
|
|
+ fromSeq = (ii * MAX_PAGE_COUNT);
|
|
|
+ toSeq = fromSeq + MAX_PAGE_COUNT;
|
|
|
+ fromSeq++;
|
|
|
+ List<TbScsTConIntSigmap> result = this.gitsMapper.selectScsTConIntSigmap(center, fromSeq, toSeq);
|
|
|
+ log.info("TB_INT_SIGNALMAP, SCS_T_CON_INTSIGMAP .READ. {}, {}, {}. {}",
|
|
|
+ center.getRegionCd(), center.getRegionNm(), String.format("%6d ~ %6d, %6d EA", fromSeq, toSeq, result.size()), job.elapsedTimeStr());
|
|
|
+ TimeUtils.sleep(500);
|
|
|
+ job.reset();
|
|
|
+
|
|
|
lists = new ArrayList<>();
|
|
|
+ currWriteCount = 0;
|
|
|
+ for(TbScsTConIntSigmap obj: result) {
|
|
|
+ HashMap<String, Object> param = obj.toSig(center.getRegionCd());
|
|
|
+ lists.add(param);
|
|
|
+ if (lists.size() >= BatchDaoService.MAX_BATCH_SIZE) {
|
|
|
+ currWriteCount += this.dao.updateTbIntSignalMap(lists);
|
|
|
+ lists = new ArrayList<>();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!lists.isEmpty()) {
|
|
|
+ currWriteCount += this.dao.updateTbIntSignalMap(lists);
|
|
|
+ }
|
|
|
+ writeCount += currWriteCount;
|
|
|
+ log.info("TB_INT_SIGNALMAP, SCS_T_CON_INTSIGMAP WRITE. {}, {}, {}. {}",
|
|
|
+ center.getRegionCd(), center.getRegionNm(), String.format("%6d ~ %6d, %6d EA", fromSeq, toSeq, currWriteCount), job.elapsedTimeStr());
|
|
|
}
|
|
|
}
|
|
|
- if (!lists.isEmpty()) {
|
|
|
- writeCount += this.dao.updateTbIntSignalMap(lists);
|
|
|
- }
|
|
|
etlp.setWriteCount(writeCount);
|
|
|
etlp.setSuccess(true);
|
|
|
- log.info("TB_INT_SIGNALMAP, SCS_T_CON_INTSIGMAP ..END. {}, {}, JOB: {}, WRITE: {} EA. {} ms.",
|
|
|
- center.getRegionCd(), center.getRegionNm(), result.size(), writeCount, job.milliSeconds());
|
|
|
+ log.info("TB_INT_SIGNALMAP, SCS_T_CON_INTSIGMAP WRITE. {}, {}, {} EA. {}",
|
|
|
+ center.getRegionCd(), center.getRegionNm(), writeCount, elapsed.elapsedTimeStr());
|
|
|
log.info("<================================================================================================");
|
|
|
}
|
|
|
catch (Exception e) {
|
|
|
etlp.setSuccess(false);
|
|
|
- log.error("{}", lists.get(0));
|
|
|
log.error("TB_INT_SIGNALMAP, SCS_T_CON_INTSIGMAP: {}, {}, Exceptions: {}", center.getRegionCd(), center.getRegionNm(), e.getMessage());
|
|
|
}
|
|
|
finally {
|
|
|
- center.setElapsed(center.getElapsed() + job.milliSeconds());
|
|
|
+ center.setElapsed(center.getElapsed() + elapsed.milliSeconds());
|
|
|
MDC.remove(center.getLogKey());
|
|
|
MDC.clear();
|
|
|
}
|
|
|
}
|
|
|
- log.info("TB_INT_SIGNALMAP, SCS_T_CON_INTSIGMAP ..END: {}", elapsed.elapsedTimeStr());
|
|
|
+ log.info("TB_INT_SIGNALMAP, SCS_T_CON_INTSIGMAP ..END: {}", totElapsed.elapsedTimeStr());
|
|
|
}
|
|
|
}
|