[KC-103] spot less 적용
This commit is contained in:
@@ -23,9 +23,7 @@ import org.springframework.data.domain.Pageable;
|
|||||||
|
|
||||||
public class InferenceResultDto {
|
public class InferenceResultDto {
|
||||||
|
|
||||||
/**
|
/** 목록조회 dto */
|
||||||
* 목록조회 dto
|
|
||||||
*/
|
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@@ -37,15 +35,11 @@ public class InferenceResultDto {
|
|||||||
private String status;
|
private String status;
|
||||||
private String mapSheetCnt;
|
private String mapSheetCnt;
|
||||||
private Long detectingCnt;
|
private Long detectingCnt;
|
||||||
@JsonFormatDttm
|
@JsonFormatDttm private ZonedDateTime startTime;
|
||||||
private ZonedDateTime startTime;
|
@JsonFormatDttm private ZonedDateTime endTime;
|
||||||
@JsonFormatDttm
|
@JsonFormatDttm private ZonedDateTime elapsedTime;
|
||||||
private ZonedDateTime endTime;
|
|
||||||
@JsonFormatDttm
|
|
||||||
private ZonedDateTime elapsedTime;
|
|
||||||
private Boolean applyYn;
|
private Boolean applyYn;
|
||||||
@JsonFormatDttm
|
@JsonFormatDttm private ZonedDateTime applyDttm;
|
||||||
private ZonedDateTime applyDttm;
|
|
||||||
|
|
||||||
@JsonProperty("statusName")
|
@JsonProperty("statusName")
|
||||||
public String statusName() {
|
public String statusName() {
|
||||||
@@ -53,9 +47,7 @@ public class InferenceResultDto {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** 목록조회 검색 조건 dto */
|
||||||
* 목록조회 검색 조건 dto
|
|
||||||
*/
|
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@@ -77,9 +69,7 @@ public class InferenceResultDto {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** 탐지 데이터 옵션 dto */
|
||||||
* 탐지 데이터 옵션 dto
|
|
||||||
*/
|
|
||||||
@Getter
|
@Getter
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public enum MapSheetScope implements EnumType {
|
public enum MapSheetScope implements EnumType {
|
||||||
@@ -100,9 +90,7 @@ public class InferenceResultDto {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** 분석대상 도엽 enum */
|
||||||
* 분석대상 도엽 enum
|
|
||||||
*/
|
|
||||||
@Getter
|
@Getter
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public enum DetectOption implements EnumType {
|
public enum DetectOption implements EnumType {
|
||||||
@@ -150,9 +138,7 @@ public class InferenceResultDto {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** 변화탐지 실행 정보 저장 요청 정보 */
|
||||||
* 변화탐지 실행 정보 저장 요청 정보
|
|
||||||
*/
|
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@@ -219,25 +205,17 @@ public class InferenceResultDto {
|
|||||||
private Integer targetYyyy;
|
private Integer targetYyyy;
|
||||||
private String detectOption;
|
private String detectOption;
|
||||||
private String mapSheetScope;
|
private String mapSheetScope;
|
||||||
@JsonFormatDttm
|
@JsonFormatDttm private ZonedDateTime inferStartDttm;
|
||||||
private ZonedDateTime inferStartDttm;
|
@JsonFormatDttm private ZonedDateTime inferEndDttm;
|
||||||
@JsonFormatDttm
|
|
||||||
private ZonedDateTime inferEndDttm;
|
|
||||||
private Long detectingCnt = 0L;
|
private Long detectingCnt = 0L;
|
||||||
private Long detectingEndCnt = 0L;
|
private Long detectingEndCnt = 0L;
|
||||||
|
|
||||||
@JsonFormatDttm
|
@JsonFormatDttm private ZonedDateTime m1ModelStartDttm;
|
||||||
private ZonedDateTime m1ModelStartDttm;
|
@JsonFormatDttm private ZonedDateTime m1ModelEndDttm;
|
||||||
@JsonFormatDttm
|
@JsonFormatDttm private ZonedDateTime m2ModelStartDttm;
|
||||||
private ZonedDateTime m1ModelEndDttm;
|
@JsonFormatDttm private ZonedDateTime m2ModelEndDttm;
|
||||||
@JsonFormatDttm
|
@JsonFormatDttm private ZonedDateTime m3ModelStartDttm;
|
||||||
private ZonedDateTime m2ModelStartDttm;
|
@JsonFormatDttm private ZonedDateTime m3ModelEndDttm;
|
||||||
@JsonFormatDttm
|
|
||||||
private ZonedDateTime m2ModelEndDttm;
|
|
||||||
@JsonFormatDttm
|
|
||||||
private ZonedDateTime m3ModelStartDttm;
|
|
||||||
@JsonFormatDttm
|
|
||||||
private ZonedDateTime m3ModelEndDttm;
|
|
||||||
|
|
||||||
private String model1Ver;
|
private String model1Ver;
|
||||||
private String model2Ver;
|
private String model2Ver;
|
||||||
@@ -364,12 +342,9 @@ public class InferenceResultDto {
|
|||||||
public static class InferenceServerStatusDto {
|
public static class InferenceServerStatusDto {
|
||||||
|
|
||||||
private String serverName;
|
private String serverName;
|
||||||
@JsonIgnore
|
@JsonIgnore private float cpu_user;
|
||||||
private float cpu_user;
|
@JsonIgnore private float cpu_system;
|
||||||
@JsonIgnore
|
@JsonIgnore private float memused;
|
||||||
private float cpu_system;
|
|
||||||
@JsonIgnore
|
|
||||||
private float memused;
|
|
||||||
private Long kbmemused;
|
private Long kbmemused;
|
||||||
private float gpuUtil;
|
private float gpuUtil;
|
||||||
|
|
||||||
|
|||||||
@@ -305,8 +305,7 @@ public class InferenceResultService {
|
|||||||
// 4) 응답 파싱
|
// 4) 응답 파싱
|
||||||
try {
|
try {
|
||||||
List<Map<String, Object>> list =
|
List<Map<String, Object>> list =
|
||||||
objectMapper.readValue(result.body(), new TypeReference<>() {
|
objectMapper.readValue(result.body(), new TypeReference<>() {});
|
||||||
});
|
|
||||||
|
|
||||||
if (list.isEmpty()) {
|
if (list.isEmpty()) {
|
||||||
throw new IllegalStateException("Inference response is empty");
|
throw new IllegalStateException("Inference response is empty");
|
||||||
|
|||||||
@@ -243,7 +243,8 @@ public class InferenceResultCoreService {
|
|||||||
*/
|
*/
|
||||||
public void update(SaveInferenceAiDto request) {
|
public void update(SaveInferenceAiDto request) {
|
||||||
MapSheetLearnEntity entity =
|
MapSheetLearnEntity entity =
|
||||||
mapSheetLearnRepository.getInferenceResultByUuid(request.getUuid())
|
mapSheetLearnRepository
|
||||||
|
.getInferenceResultByUuid(request.getUuid())
|
||||||
.orElseThrow(EntityNotFoundException::new);
|
.orElseThrow(EntityNotFoundException::new);
|
||||||
|
|
||||||
// M1/M2/M3 영역 업데이트
|
// M1/M2/M3 영역 업데이트
|
||||||
@@ -266,7 +267,8 @@ public class InferenceResultCoreService {
|
|||||||
|
|
||||||
private void applyModelUpdate(MapSheetLearnEntity entity, SaveInferenceAiDto request) {
|
private void applyModelUpdate(MapSheetLearnEntity entity, SaveInferenceAiDto request) {
|
||||||
switch (request.getType()) {
|
switch (request.getType()) {
|
||||||
case "M1" -> applyModelFields(
|
case "M1" ->
|
||||||
|
applyModelFields(
|
||||||
request,
|
request,
|
||||||
entity::setM1ModelBatchId,
|
entity::setM1ModelBatchId,
|
||||||
entity::setM1ModelStartDttm,
|
entity::setM1ModelStartDttm,
|
||||||
@@ -274,9 +276,9 @@ public class InferenceResultCoreService {
|
|||||||
entity::setM1PendingJobs,
|
entity::setM1PendingJobs,
|
||||||
entity::setM1RunningJobs,
|
entity::setM1RunningJobs,
|
||||||
entity::setM1CompletedJobs,
|
entity::setM1CompletedJobs,
|
||||||
entity::setM1FailedJobs
|
entity::setM1FailedJobs);
|
||||||
);
|
case "M2" ->
|
||||||
case "M2" -> applyModelFields(
|
applyModelFields(
|
||||||
request,
|
request,
|
||||||
entity::setM2ModelBatchId,
|
entity::setM2ModelBatchId,
|
||||||
entity::setM2ModelStartDttm,
|
entity::setM2ModelStartDttm,
|
||||||
@@ -284,9 +286,9 @@ public class InferenceResultCoreService {
|
|||||||
entity::setM2PendingJobs,
|
entity::setM2PendingJobs,
|
||||||
entity::setM2RunningJobs,
|
entity::setM2RunningJobs,
|
||||||
entity::setM2CompletedJobs,
|
entity::setM2CompletedJobs,
|
||||||
entity::setM2FailedJobs
|
entity::setM2FailedJobs);
|
||||||
);
|
case "M3" ->
|
||||||
case "M3" -> applyModelFields(
|
applyModelFields(
|
||||||
request,
|
request,
|
||||||
entity::setM3ModelBatchId,
|
entity::setM3ModelBatchId,
|
||||||
entity::setM3ModelStartDttm,
|
entity::setM3ModelStartDttm,
|
||||||
@@ -294,8 +296,7 @@ public class InferenceResultCoreService {
|
|||||||
entity::setM3PendingJobs,
|
entity::setM3PendingJobs,
|
||||||
entity::setM3RunningJobs,
|
entity::setM3RunningJobs,
|
||||||
entity::setM3CompletedJobs,
|
entity::setM3CompletedJobs,
|
||||||
entity::setM3FailedJobs
|
entity::setM3FailedJobs);
|
||||||
);
|
|
||||||
default -> throw new IllegalArgumentException("Unknown type: " + request.getType());
|
default -> throw new IllegalArgumentException("Unknown type: " + request.getType());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -308,8 +309,7 @@ public class InferenceResultCoreService {
|
|||||||
Consumer<Integer> setPending,
|
Consumer<Integer> setPending,
|
||||||
Consumer<Integer> setRunning,
|
Consumer<Integer> setRunning,
|
||||||
Consumer<Integer> setCompleted,
|
Consumer<Integer> setCompleted,
|
||||||
Consumer<Integer> setFailed
|
Consumer<Integer> setFailed) {
|
||||||
) {
|
|
||||||
applyIfNotNull(request.getBatchId(), setBatchId);
|
applyIfNotNull(request.getBatchId(), setBatchId);
|
||||||
applyIfNotNull(request.getModelStartDttm(), setStart);
|
applyIfNotNull(request.getModelStartDttm(), setStart);
|
||||||
applyIfNotNull(request.getModelEndDttm(), setEnd);
|
applyIfNotNull(request.getModelEndDttm(), setEnd);
|
||||||
|
|||||||
@@ -47,9 +47,7 @@ public class MapSheetInferenceJobService {
|
|||||||
@Value("${inference.url}")
|
@Value("${inference.url}")
|
||||||
private String inferenceUrl;
|
private String inferenceUrl;
|
||||||
|
|
||||||
/**
|
/** 추론 진행 배치 1분 */
|
||||||
* 추론 진행 배치 1분
|
|
||||||
*/
|
|
||||||
@Scheduled(fixedDelay = 60_000)
|
@Scheduled(fixedDelay = 60_000)
|
||||||
@Transactional
|
@Transactional
|
||||||
public void runBatch() {
|
public void runBatch() {
|
||||||
@@ -271,18 +269,23 @@ public class MapSheetInferenceJobService {
|
|||||||
// ai 에 맞는 모델 명으로 변경
|
// ai 에 맞는 모델 명으로 변경
|
||||||
String inferenceType = modelToInferenceType(type);
|
String inferenceType = modelToInferenceType(type);
|
||||||
|
|
||||||
InferenceSendDto.pred_requests_areas predRequestsAreas = new InferenceSendDto.pred_requests_areas();
|
InferenceSendDto.pred_requests_areas predRequestsAreas =
|
||||||
|
new InferenceSendDto.pred_requests_areas();
|
||||||
predRequestsAreas.setInput1_year(progressDto.getPred_requests_areas().getInput1_year());
|
predRequestsAreas.setInput1_year(progressDto.getPred_requests_areas().getInput1_year());
|
||||||
predRequestsAreas.setInput2_year(progressDto.getPred_requests_areas().getInput2_year());
|
predRequestsAreas.setInput2_year(progressDto.getPred_requests_areas().getInput2_year());
|
||||||
predRequestsAreas.setInput1_scene_path(progressDto.getPred_requests_areas().getInput1_scene_path());
|
predRequestsAreas.setInput1_scene_path(
|
||||||
predRequestsAreas.setInput2_scene_path(progressDto.getPred_requests_areas().getInput2_scene_path());
|
progressDto.getPred_requests_areas().getInput1_scene_path());
|
||||||
|
predRequestsAreas.setInput2_scene_path(
|
||||||
|
progressDto.getPred_requests_areas().getInput2_scene_path());
|
||||||
|
|
||||||
InferenceSendDto m = new InferenceSendDto();
|
InferenceSendDto m = new InferenceSendDto();
|
||||||
m.setPred_requests_areas(predRequestsAreas);
|
m.setPred_requests_areas(predRequestsAreas);
|
||||||
m.setModel_version(progressDto.getModelVersion());
|
m.setModel_version(progressDto.getModelVersion());
|
||||||
m.setCd_model_path(progressDto.getCdModelPath() + "/" + progressDto.getCdModelFileName());
|
m.setCd_model_path(progressDto.getCdModelPath() + "/" + progressDto.getCdModelFileName());
|
||||||
m.setCd_model_config(progressDto.getCdModelConfigPath() + "/" + progressDto.getCdModelConfigFileName());
|
m.setCd_model_config(
|
||||||
m.setCls_model_path(progressDto.getCdModelClsPath() + "/" + progressDto.getCdModelClsFileName());
|
progressDto.getCdModelConfigPath() + "/" + progressDto.getCdModelConfigFileName());
|
||||||
|
m.setCls_model_path(
|
||||||
|
progressDto.getCdModelClsPath() + "/" + progressDto.getCdModelClsFileName());
|
||||||
m.setCls_model_version(progressDto.getClsModelVersion());
|
m.setCls_model_version(progressDto.getClsModelVersion());
|
||||||
m.setCd_model_type(inferenceType);
|
m.setCd_model_type(inferenceType);
|
||||||
m.setPriority(progressDto.getPriority());
|
m.setPriority(progressDto.getPriority());
|
||||||
@@ -363,8 +366,7 @@ public class MapSheetInferenceJobService {
|
|||||||
// 4) 응답 파싱
|
// 4) 응답 파싱
|
||||||
try {
|
try {
|
||||||
List<Map<String, Object>> list =
|
List<Map<String, Object>> list =
|
||||||
objectMapper.readValue(result.body(), new TypeReference<>() {
|
objectMapper.readValue(result.body(), new TypeReference<>() {});
|
||||||
});
|
|
||||||
|
|
||||||
if (list.isEmpty()) {
|
if (list.isEmpty()) {
|
||||||
throw new IllegalStateException("Inference response is empty");
|
throw new IllegalStateException("Inference response is empty");
|
||||||
@@ -392,10 +394,9 @@ public class MapSheetInferenceJobService {
|
|||||||
return "local".equalsIgnoreCase(profile);
|
return "local".equalsIgnoreCase(profile);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** 모델별 추론 종료 update */
|
||||||
* 모델별 추론 종료 update
|
private void updateProcessingEndTimeByModel(
|
||||||
*/
|
JobStatusDto dto, UUID uuid, ZonedDateTime dateTime, String type) {
|
||||||
private void updateProcessingEndTimeByModel(JobStatusDto dto, UUID uuid, ZonedDateTime dateTime, String type) {
|
|
||||||
SaveInferenceAiDto saveInferenceAiDto = new SaveInferenceAiDto();
|
SaveInferenceAiDto saveInferenceAiDto = new SaveInferenceAiDto();
|
||||||
saveInferenceAiDto.setUuid(uuid);
|
saveInferenceAiDto.setUuid(uuid);
|
||||||
saveInferenceAiDto.setUpdateUid(0L);
|
saveInferenceAiDto.setUpdateUid(0L);
|
||||||
|
|||||||
Reference in New Issue
Block a user