Changes

Summary

  1. Code polishing. (details)
  2. Add the backbone code for generating and storing assignments' parquet files. (details)
  3. - Update the "WorkerInfo" model to include the "hasActiveWork" field. (details)
  4. Update the "getAssignmentsQuery" to get exactly "assignmentsLimit" results, by aggregating a subset of the whole ordered dataset, to get only one datasourceid per id-url pair. (details)
  5. - Add the new "prefillPayloads"-code for the future "DayAssignments"-logic. (details)
  6. Remove the old "prefillPayloads"-code which was run during the processing of each workerReport. (details)
  7. Add the new flag "shouldPauseRequests" and use it across endpoints and scheduled jobs. This, at times, will be set to "true", by future code. (details)
  8. - Add the "workerAssignmentsDirectoryPath" configuration and the related initialization code. (details)
  9. - Add the "hasAnyWorkerActiveWork" method. It will be used in the future to safely perform scheduled-maintenance tasks. (details)
  10. Generalize the following methods: (details)
  11. - Update configuration to have distinct "workerAssignmentLimit" and "controllerDayAssignmentLimit". (details)
  12. Move the "isControllerProcessingJobs"-code to its own method, to be used later in more places. (details)
  13. Add the top-level logic of handling the creation of "DayAssignments" on app's initialization and every day, during the nighttime. (details)
  14. Add the low-level logic of generating, storing, transforming and delivering "DayAssignments" to the workers, as well as initiating the "prefill" of payloads. (details)
  15. - Make sure the temporal assignments' remote parquet directories are deleted, after the data gets loaded to the DB-table. (details)
  16. - Code polishing. (details)
  17. Update the "getPayloadsWithPrefilledQuery" to perform the "anti-join" with the plain "assignment" table, in order to avoid prefilling id-url pairs which previously failed to be loaded to the DB and at that time they wait for re-processing. The previous use of the "day_assignment" table was a mistake, even if the anti-join with it was not enabled. (details)
  18. Optimize the "getPayloadsWithPrefilledQuery", by improving efficiency. (details)
  19. - Activate the scheduling of "getAndCacheDayAssignments", every day at 03:00 o'clock, and specify to use the "Europe/Athens" time-zone. (details)
  20. - Avoid waiting for workers to finish their active work, before running the scheduled task "getAndCacheDayAssignments", in order to avoid running the DayAssignments-refill process later in the day and potentially introduce load in the DB during the start of working-hours. (details)
  21. - Upgrade the "getPayloadsWithPrefilledQuery", making it more efficient and robust. (details)
  22. Detect when the Controller is out-of-data for at least one of the assignments'-type and provide a "Retry-After" header to those Workers, to avoid filling-up with error messages on both sides. (details)
  23. - Improve efficiency and stability when acquiring dayAssignments. (details)
  24. - Allow setting different "controllerDayAssignmentLimit", "workerAssignmentLimit" and "maxAttemptsPerRecord" for PDF and HTML processes. (details)
  25. - Fix an issue causing possible starvation of assignments' delivery to the workers. The longer the time from the app's initialization, the more permanent the starvation could become. This was due to the fact that "WorkerFileBatchCounters" could outgrow the "AssignmentsBatchCounters" leading to less and less workerFiles with their names sharing the same counters, until the file-names could start with a number which could be out-of-reach for the assignmentBatchCounters. (details)
  26. Update the "getAndCacheDayAssignments()"-logic: (details)
  27. Change the time-zone in which the scheduled "getAndCacheDayAssignments"-job is initiated, to "Central European Time (CET/CEST)", by using the city-name of "Rome" (due to IANA-db-limitations cannot use the "CET/CEST" abbreviations directly). (details)
  28. Update the "getNumOfPayloadsAggregatedByServiceThroughBulkImportQuery" and "getNumOfLegacyPayloadsQuery" in "StatsController", to account for multiple payloads per id-url pair, in the "payload_bulk_import" and the "payload_legacy" tables. (details)
The file was modifiedsrc/main/java/eu/openaire/urls_controller/services/UrlsServiceImpl.java (diff)
Commit ae4ab14649b44c95d70c4a4a884c4ceca8aa8468 by Lampros Smyrnaios
Add the backbone code for generating and storing assignments' parquet files.
The file was modifiedsrc/main/java/eu/openaire/urls_controller/models/Assignment.java (diff)
The file was modifiedsrc/main/java/eu/openaire/urls_controller/util/ParquetFileUtils.java (diff)
The file was modifiedsrc/main/java/eu/openaire/urls_controller/models/ParquetReport.java (diff)
The file was addedsrc/main/resources/schemas/assignment.avsc
Commit 939a95adcce670af9cddf251b314333dde77f0dc by Lampros Smyrnaios
- Update the "WorkerInfo" model to include the "hasActiveWork" field.
- Fix/improve some error-messages.
- Update README.md
- Code polishing.
The file was modifiedsrc/main/java/eu/openaire/urls_controller/models/WorkerInfo.java (diff)
The file was modifiedsrc/main/java/eu/openaire/urls_controller/util/FileDecompressor.java (diff)
The file was modifiedsrc/main/java/eu/openaire/urls_controller/util/FileUtils.java (diff)
The file was modifiedsrc/main/java/eu/openaire/urls_controller/util/ParquetFileUtils.java (diff)
The file was modifiedsrc/main/java/eu/openaire/urls_controller/components/ScheduledTasks.java (diff)
The file was modifiedREADME.md (diff)
The file was modifiedsrc/main/java/eu/openaire/urls_controller/services/UrlsServiceImpl.java (diff)
Commit 77c618f17680f7a7a2c89911931549b30b3b9894 by Lampros Smyrnaios
Update the "getAssignmentsQuery" to get exactly "assignmentsLimit" results, by aggregating a subset of the whole ordered dataset, to get only one datasourceid per id-url pair.
The file was modifiedsrc/main/java/eu/openaire/urls_controller/services/UrlsServiceImpl.java (diff)
Commit 0bce1fd32b28d728fc1fdd4f7efd77cf9c961a41 by Lampros Smyrnaios
- Add the new "prefillPayloads"-code for the future "DayAssignments"-logic.
- Update the "ParquetFileUtils.mergeParquetFilesOfTable" method to a) accept a complete "select"-query for creating the new table and b) show the count-difference between the initial and final table, if it is requested.
The file was modifiedsrc/main/java/eu/openaire/urls_controller/util/ParquetFileUtils.java (diff)
The file was modifiedsrc/main/java/eu/openaire/urls_controller/services/BulkImportServiceImpl.java (diff)
The file was modifiedsrc/main/java/eu/openaire/urls_controller/services/UrlsServiceImpl.java (diff)
Commit 986c733c23fc12f8fd9b77d8d14ad78b28af68f0 by Lampros Smyrnaios
Remove the old "prefillPayloads"-code which was run during the processing of each workerReport.
The file was modifiedsrc/main/java/eu/openaire/urls_controller/services/UrlsServiceImpl.java (diff)
The file was modifiedsrc/main/java/eu/openaire/urls_controller/util/FileUtils.java (diff)
The file was modifiedsrc/main/java/eu/openaire/urls_controller/util/ParquetFileUtils.java (diff)
Commit 70ec755ff12147aa82fc910420b01f3796e61621 by Lampros Smyrnaios
Add the new flag "shouldPauseRequests" and use it across endpoints and scheduled jobs. This, at times, will be set to "true", by future code.
The file was modifiedsrc/main/java/eu/openaire/urls_controller/components/ScheduledTasks.java (diff)
The file was modifiedsrc/main/java/eu/openaire/urls_controller/controllers/ShutdownController.java (diff)
The file was modifiedsrc/main/java/eu/openaire/urls_controller/services/UrlsServiceImpl.java (diff)
The file was modifiedsrc/main/java/eu/openaire/urls_controller/controllers/StatsController.java (diff)
The file was modifiedsrc/main/java/eu/openaire/urls_controller/controllers/BulkImportController.java (diff)
The file was modifiedsrc/main/java/eu/openaire/urls_controller/configuration/DatabaseConnector.java (diff)
Commit c4797c436eee498e6676c3c71304ca555ee86dd3 by Lampros Smyrnaios
- Add the "workerAssignmentsDirectoryPath" configuration and the related initialization code.
- Add missing import.
The file was modifiedsrc/main/java/eu/openaire/urls_controller/components/ScheduledTasks.java (diff)
The file was modifiedsrc/main/java/eu/openaire/urls_controller/configuration/DatabaseConnector.java (diff)
The file was modifiedsrc/main/java/eu/openaire/urls_controller/controllers/StatsController.java (diff)
The file was modifiedsrc/main/java/eu/openaire/urls_controller/services/UrlsServiceImpl.java (diff)
The file was modifiedsrc/main/resources/application.yml (diff)
Commit 2d0d33aab07f43ee4d8a035b21efce4d94fd932b by Lampros Smyrnaios
- Add the "hasAnyWorkerActiveWork" method. It will be used in the future to safely perform scheduled-maintenance tasks.
- Add the new "DayAssignment"-model and add a new constructor to the "Assignment"-class.
The file was modifiedsrc/main/java/eu/openaire/urls_controller/models/Assignment.java (diff)
The file was modifiedsrc/main/java/eu/openaire/urls_controller/components/ScheduledTasks.java (diff)
The file was addedsrc/main/java/eu/openaire/urls_controller/models/DayAssignment.java
Commit a7e77ead6efb7cf55b94b0e99943e1a1a319303b by Lampros Smyrnaios
Generalize the following methods:
a) the "createAndInitializeCurrentAssignmentsTable" into "createAndInitializeTable" and b) the "dropCurrentAssignmentTable" into "dropTable".
The file was modifiedsrc/main/java/eu/openaire/urls_controller/services/UrlsServiceImpl.java (diff)
Commit de8a2739fbb4e1cf5765f121514f46e06a5df0ee by Lampros Smyrnaios
- Update configuration to have distinct "workerAssignmentLimit" and "controllerDayAssignmentLimit".
- Fix removing the initialization of a StringBuilder.
- Code cleanup.
The file was modifiedsrc/main/java/eu/openaire/urls_controller/services/UrlsServiceImpl.java (diff)
The file was modifiedsrc/main/java/eu/openaire/urls_controller/components/ScheduledTasks.java (diff)
The file was modifiedsrc/main/java/eu/openaire/urls_controller/controllers/TestController.java (diff)
The file was modifiedsrc/main/java/eu/openaire/urls_controller/configuration/DatabaseConnector.java (diff)
The file was modifiedsrc/main/java/eu/openaire/urls_controller/controllers/UrlsController.java (diff)
The file was modifiedsrc/main/resources/application.yml (diff)
Commit b0a2b3ab4fe664685ecd48cc5e23712b087046dc by Lampros Smyrnaios
Move the "isControllerProcessingJobs"-code to its own method, to be used later in more places.
The file was modifiedsrc/main/java/eu/openaire/urls_controller/components/ScheduledTasks.java (diff)
Commit 3fd29fe22eedecfc68c987b2e82a5327487be2e1 by Lampros Smyrnaios
Add the top-level logic of handling the creation of "DayAssignments" on app's initialization and every day, during the nighttime.
The file was modifiedsrc/main/java/eu/openaire/urls_controller/configuration/DatabaseConnector.java (diff)
The file was modifiedsrc/main/java/eu/openaire/urls_controller/components/ScheduledTasks.java (diff)
Commit bfd203a1918cb672a70ed1bbec16d58efd4d8ca5 by Lampros Smyrnaios
Add the low-level logic of generating, storing, transforming and delivering "DayAssignments" to the workers, as well as initiating the "prefill" of payloads.
The file was modifiedsrc/main/java/eu/openaire/urls_controller/controllers/UrlsController.java (diff)
The file was modifiedsrc/main/java/eu/openaire/urls_controller/services/UrlsServiceImpl.java (diff)
The file was modifiedsrc/main/java/eu/openaire/urls_controller/services/UrlsService.java (diff)
Commit b74abd2c6b280b854abf874b7003dcd4d8203f42 by Lampros Smyrnaios
- Make sure the temporal assignments' remote parquet directories are deleted, after the data gets loaded to the DB-table.
- Add/Improve/Fix some log-messages.
The file was modifiedsrc/main/java/eu/openaire/urls_controller/services/UrlsServiceImpl.java (diff)
The file was modifiedsrc/main/java/eu/openaire/urls_controller/util/FilesHandler.java (diff)
The file was modifiedsrc/main/java/eu/openaire/urls_controller/services/ShutdownServiceImpl.java (diff)
Commit d9429ff26305c97c5cad1236143e4c57e5554d55 by Lampros Smyrnaios
- Code polishing.
- Fix a value in a log-message.
The file was modifiedsrc/main/java/eu/openaire/urls_controller/services/UrlsServiceImpl.java (diff)
The file was modifiedsrc/main/java/eu/openaire/urls_controller/util/FileUtils.java (diff)
Commit b845d08747100e3361565bc7ef5f4feecccce8ce by Lampros Smyrnaios
Update the "getPayloadsWithPrefilledQuery" to perform the "anti-join" with the plain "assignment" table, in order to avoid prefilling id-url pairs which previously failed to be loaded to the DB and at that time they wait for re-processing. The previous use of the "day_assignment" table was a mistake, even if the anti-join with it was not enabled.
The file was modifiedsrc/main/java/eu/openaire/urls_controller/services/UrlsServiceImpl.java (diff)
Commit 3bf3c629fcbe8bc2bd45595654c2cd5f1727948c by Lampros Smyrnaios
Optimize the "getPayloadsWithPrefilledQuery", by improving efficiency.
The file was modifiedsrc/main/java/eu/openaire/urls_controller/services/UrlsServiceImpl.java (diff)
Commit b69e5c02963b9be3cca883b030542f26b97adcdb by Lampros Smyrnaios
- Activate the scheduling of "getAndCacheDayAssignments", every day at 03:00 o'clock, and specify to use the "Europe/Athens" time-zone.
- Improve accuracy of the check for "alreadyRunAssignmentsPrefill".
- Improve reporting in logs.
- Code polishing.
The file was modifiedsrc/main/java/eu/openaire/urls_controller/services/UrlsServiceImpl.java (diff)
The file was modifiedsrc/main/java/eu/openaire/urls_controller/components/ScheduledTasks.java (diff)
Commit f89d35d9da9e281b24d13517661b5ae0b13e39c9 by Lampros Smyrnaios
- Avoid waiting for workers to finish their active work, before running the scheduled task "getAndCacheDayAssignments", in order to avoid running the DayAssignments-refill process later in the day and potentially introduce load in the DB during the start of working-hours.
- Do not accept handling of workerReports when in "shouldPauseRequests"-state, in order to avoid increasing the waiting time for "isControllerProcessingJobs()"-method to return "false" (as the new reports will refill the "futuresOfBackgroundTasks"-list, thus causing the controller to wait until the reports are processed), in case the report arrived before the Controller locks the DB and starts the dayAssignments-processing.
- Change the response code of "shouldPauseRequests"-handlers, from "409" to "503".
- Improve warn-messages on shouldPauseRequests"-cases.
The file was modifiedsrc/main/java/eu/openaire/urls_controller/controllers/BulkImportController.java (diff)
The file was modifiedsrc/main/java/eu/openaire/urls_controller/components/ScheduledTasks.java (diff)
The file was modifiedsrc/main/java/eu/openaire/urls_controller/controllers/ShutdownController.java (diff)
The file was modifiedsrc/main/java/eu/openaire/urls_controller/controllers/StatsController.java (diff)
The file was modifiedsrc/main/java/eu/openaire/urls_controller/services/UrlsServiceImpl.java (diff)
The file was modifiedsrc/main/java/eu/openaire/urls_controller/controllers/UrlsController.java (diff)
Commit 6a8ae90ccd9c3df493516dbb586e949f9c4ff016 by Lampros Smyrnaios
- Upgrade the "getPayloadsWithPrefilledQuery", making it more efficient and robust.
- Add a warn-message when the S3 times-out and the upload of a file is about to be retried.
- Code polishing.
The file was modifiedsrc/main/java/eu/openaire/urls_controller/util/S3ObjectStore.java (diff)
The file was modifiedsrc/main/java/eu/openaire/urls_controller/services/UrlsServiceImpl.java (diff)
The file was modifiedsrc/main/java/eu/openaire/urls_controller/components/ScheduledTasks.java (diff)
Commit 24edadd8d12da1738e2d7986802c76bc8451b851 by Lampros Smyrnaios
Detect when the Controller is out-of-data for at least one of the assignments'-type and provide a "Retry-After" header to those Workers, to avoid filling-up with error messages on both sides.
The file was modifiedsrc/main/java/eu/openaire/urls_controller/services/UrlsServiceImpl.java (diff)
Commit 8115f17fc364a911a6e542c9aa352ab510dc5223 by Lampros Smyrnaios
- Improve efficiency and stability when acquiring dayAssignments.
- Fix not accounting for an above-0 "remainingDayAssignmentsCount" when calculating the "handledDayAssignments"-number.
The file was modifiedsrc/main/java/eu/openaire/urls_controller/services/UrlsServiceImpl.java (diff)
The file was modifiedsrc/main/java/eu/openaire/urls_controller/models/DayAssignment.java (diff)
Commit 76fef662223b67690c5ce984ebeeaf5d7d788f3a by Lampros Smyrnaios
- Allow setting different "controllerDayAssignmentLimit", "workerAssignmentLimit" and "maxAttemptsPerRecord" for PDF and HTML processes.
- Fix not using different "maxAttemptsPerRecord"-counters for PDF and HTML assignments. Each process uses its own tables and has different progress-speed and characteristics. The starvation of PDFs should affect the HTMLs and vice versa.
- Code polishing.
The file was modifiedsrc/main/java/eu/openaire/urls_controller/controllers/TestController.java (diff)
The file was modifiedsrc/main/java/eu/openaire/urls_controller/services/UrlsServiceImpl.java (diff)
The file was modifiedsrc/main/resources/application.yml (diff)
The file was modifiedsrc/main/java/eu/openaire/urls_controller/components/ScheduledTasks.java (diff)
The file was modifiedsrc/main/java/eu/openaire/urls_controller/controllers/UrlsController.java (diff)
Commit c78109cf52d3c43ebf53de98989ff6f8b3339594 by Lampros Smyrnaios
- Fix an issue causing possible starvation of assignments' delivery to the workers. The longer the time from the app's initialization, the more permanent the starvation could become. This was due to the fact that "WorkerFileBatchCounters" could outgrow the "AssignmentsBatchCounters" leading to less and less workerFiles with their names sharing the same counters, until the file-names could start with a number which could be out-of-reach for the assignmentBatchCounters.
- Add/improve error-handling in "ScheduledTasks.getAndCacheDayAssignments()". Shutdown the app immediately when needed.
The file was modifiedsrc/main/java/eu/openaire/urls_controller/services/UrlsServiceImpl.java (diff)
The file was modifiedsrc/main/java/eu/openaire/urls_controller/components/ScheduledTasks.java (diff)
Commit 6cd7de17d2e0b4a17412582b3505b27c05892ad7 by Lampros Smyrnaios
Update the "getAndCacheDayAssignments()"-logic:
- Fix not unpausing the requests, when the Controller continues to process jobs, even after the maximum time to wait has passed.
- Limit the maximum time to wait for processing jobs to finish, to 2 hours, down from 6.
- Reduce the waiting time between checks of "jobs-in-processing" to 15 mins, down from 30.
- Improve some logs.
The file was modifiedsrc/main/java/eu/openaire/urls_controller/components/ScheduledTasks.java (diff)
Commit 2d193927c04e1f7827a6b458ab52b08217162cd0 by Lampros Smyrnaios
Change the time-zone in which the scheduled "getAndCacheDayAssignments"-job is initiated, to "Central European Time (CET/CEST)", by using the city-name of "Rome" (due to IANA-db-limitations cannot use the "CET/CEST" abbreviations directly).
The file was modifiedsrc/main/java/eu/openaire/urls_controller/components/ScheduledTasks.java (diff)
Commit 313a9d76ac0302e02b978eaafaeb1f2a9d47e8e0 by Lampros Smyrnaios
Update the "getNumOfPayloadsAggregatedByServiceThroughBulkImportQuery" and "getNumOfLegacyPayloadsQuery" in "StatsController", to account for multiple payloads per id-url pair, in the "payload_bulk_import" and the "payload_legacy" tables.
The file was modifiedsrc/main/java/eu/openaire/urls_controller/controllers/StatsController.java (diff)