From 0a9c0cd7844c6067d397dede8f4d9a0caf47b3d5 Mon Sep 17 00:00:00 2001 From: Chris Ditcher Date: Fri, 23 Aug 2024 13:45:08 -0700 Subject: [PATCH 1/3] Update update-configmap.sh --- tools/config/update-configmap.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/config/update-configmap.sh b/tools/config/update-configmap.sh index 8f28d778..840e431e 100644 --- a/tools/config/update-configmap.sh +++ b/tools/config/update-configmap.sh @@ -23,6 +23,7 @@ FLB_CONFIG="[SERVICE] Exclude_Path *.gz,*.zip Parser docker Mem_Buf_Limit 20MB + Buffer_Max_Size 1MB [FILTER] Name record_modifier Match * From 56503b0763c4b409f520f5e656132a2f17f886df Mon Sep 17 00:00:00 2001 From: githubmamatha <106563495+githubmamatha@users.noreply.github.com> Date: Mon, 16 Sep 2024 10:50:54 -0700 Subject: [PATCH 2/3] Update pom.xml --- api/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/pom.xml b/api/pom.xml index 8b32e1af..23d9ba05 100644 --- a/api/pom.xml +++ b/api/pom.xml @@ -6,7 +6,7 @@ ca.bc.gov.educ educ-grad-student-api - 1.8.63 + 1.8.64 educ-grad-student-api Student Demographics API for GRAD team From 26474b4765a4d0ed9be06c03adba4c9039ed8a4d Mon Sep 17 00:00:00 2001 From: arybakov Date: Fri, 20 Sep 2024 16:42:57 -0600 Subject: [PATCH 3/3] GRAD2-2971 Student Archive for one school needs to be able to handle > 1000 students --- .../gradstudent/service/HistoryService.java | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/api/src/main/java/ca/bc/gov/educ/api/gradstudent/service/HistoryService.java b/api/src/main/java/ca/bc/gov/educ/api/gradstudent/service/HistoryService.java index 251fc456..b3529ea1 100644 --- a/api/src/main/java/ca/bc/gov/educ/api/gradstudent/service/HistoryService.java +++ b/api/src/main/java/ca/bc/gov/educ/api/gradstudent/service/HistoryService.java @@ -26,10 +26,7 @@ import org.springframework.transaction.annotation.Transactional; import org.springframework.web.reactive.function.client.WebClient; -import java.util.List; -import java.util.Objects; -import java.util.Optional; -import java.util.UUID; +import java.util.*; @Service public class HistoryService { @@ -164,11 +161,21 @@ public Page getStudentHistoryByBatchID(Lon @Transactional public Integer updateStudentRecordHistoryDistributionRun(Long batchId, String updateUser, String activityCode, List studentGuids) { - Integer historyRecordsCreated; + Integer historyRecordsCreated = 0; if(studentGuids != null && !studentGuids.isEmpty()) { - Integer studentRecordsCreated = graduationStatusRepository.updateGraduationStudentRecordEntitiesBatchIdWhereStudentIDsIn(batchId, studentGuids); - historyRecordsCreated = graduationStudentRecordHistoryRepository.insertGraduationStudentRecordHistoryByBatchIdAndStudentIDs(batchId, studentGuids, activityCode, updateUser); - assert Objects.equals(studentRecordsCreated, historyRecordsCreated); + int partitionSize = 999; + List> partitions = new LinkedList<>(); + for (int i = 0; i < studentGuids.size(); i += partitionSize) { + partitions.add(studentGuids.subList(i, Math.min(i + partitionSize, studentGuids.size()))); + } + logger.debug("Update Student Record History partitions length {}", partitions.size()); + for (int i = 0; i < partitions.size(); i++) { + List subList = partitions.get(i); + Integer studentRecordsCreatedPartition = graduationStatusRepository.updateGraduationStudentRecordEntitiesBatchIdWhereStudentIDsIn(batchId, subList); + Integer historyRecordsCreatedPartition = graduationStudentRecordHistoryRepository.insertGraduationStudentRecordHistoryByBatchIdAndStudentIDs(batchId, subList, activityCode, updateUser); + assert Objects.equals(studentRecordsCreatedPartition, historyRecordsCreatedPartition); + historyRecordsCreated += historyRecordsCreatedPartition; + } } else if(StringUtils.equalsIgnoreCase(activityCode, "USERSTUDARC")) { historyRecordsCreated = graduationStudentRecordHistoryRepository.insertGraduationStudentRecordHistoryByBatchId(batchId, activityCode, updateUser); } else if(StringUtils.isBlank(activityCode) || StringUtils.equalsIgnoreCase(activityCode, "null")) {