Skip to content

VSB-TUO/Health report license summary#1135

Merged
milanmajchrak merged 3 commits intocustomer/vsb-tuofrom
vsb-tuo/health-report-license-summary
Nov 3, 2025
Merged

VSB-TUO/Health report license summary#1135
milanmajchrak merged 3 commits intocustomer/vsb-tuofrom
vsb-tuo/health-report-license-summary

Conversation

@Paurikova2
Copy link
Collaborator

Phases MP MM MB MR JM Total
ETA 0 0 0 0 0 0
Developing 1 0 0 0 0 0
Review 0 0 0 0 0 0
Total - - - - - 0
ETA est. 0
ETA cust. - - - - - 0

Problem description

Since the database had too much data, it made too many calls and got stuck in a never-ending loop.

@Paurikova2 Paurikova2 self-assigned this Oct 30, 2025
@jr-rk jr-rk requested a review from Copilot October 30, 2025 09:01
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR optimizes the LicenseCheck health check by implementing batch database queries instead of individual N+1 queries, reducing the number of database calls from one per item to a single batch query. This significantly improves performance for large repositories.

Key changes:

  • Added batch query method findByBitstreamUUIDs() to fetch all license mappings in a single database call
  • Refactored LicenseCheck to collect bitstream UUIDs first, then batch fetch all mappings, then process results in memory
  • Removed unused AWS SDK dependency (com.amazonaws.util.CollectionUtils)

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
LicenseCheck.java Refactored to use batch queries and process results in memory; removed AWS dependency
ClarinLicenseResourceMappingService.java Added batch query method signature
ClarinLicenseResourceMappingServiceImpl.java Implemented batch query service method with duplicate import
ClarinLicenseResourceMappingDAO.java Added batch query DAO interface method
ClarinLicenseResourceMappingDAOImpl.java Implemented batch query with IN clause for multiple UUIDs
Comments suppressed due to low confidence (1)

dspace-api/src/main/java/org/dspace/health/LicenseCheck.java:46

  • The contents of this container are never accessed.
        Map<UUID, Item> bitstreamToItem = new HashMap<>();

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@milanmajchrak milanmajchrak merged commit a4beb63 into customer/vsb-tuo Nov 3, 2025
23 of 24 checks passed
Paurikova2 added a commit that referenced this pull request Nov 5, 2025
* added select get bitstreams based on uuids, improved speed of run

* incorrect indentation, removed unused map, checkstyle

* removed continue
milanmajchrak pushed a commit that referenced this pull request Nov 12, 2025
* VSB-TUO/Health report license summary (#1135)

* added select get bitstreams based on uuids, improved speed of run

* incorrect indentation, removed unused map, checkstyle

* VSB-TUO/Fix bitstreamuuid query (#1140)

* revent PostgreSQL parameter limit error by batching bitstream UUID queries in findByBitstreamUUIDs

* BATCH_SIZE as configurable constant
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants