Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: avoid potential unnecessary store accesses on dataset resolution #4513

Conversation

ndr-brt
Copy link
Member

@ndr-brt ndr-brt commented Sep 30, 2024

What this PR changes/adds

Refactors ContractDefinitionResolver and DatasetResolver adding a thread local cache to diminish database accesses.

Why it does that

Avoid potential multiple and unnecessary calls to PolicyDefinitionStore.findById.
In cases where access policy id is the same as contract policy id this will halve database accesses, will also provide advantages where same policies are used for different contract negotiations

Further notes

  • moved contract definition resolver from "contract" to "catalog", because it's only meant to be used in the catalog creation.

Linked Issue(s)

Closes #4499

Please be sure to take a look at the contributing guidelines and our etiquette for pull requests.

@ndr-brt ndr-brt added the refactoring Cleaning up code and dependencies label Sep 30, 2024
@ndr-brt ndr-brt force-pushed the 4499-avoid-unnecessary-policy-store-accesses branch from ca7819d to f7078b8 Compare September 30, 2024 09:33
@ndr-brt ndr-brt force-pushed the 4499-avoid-unnecessary-policy-store-accesses branch from f7078b8 to f0137f8 Compare October 2, 2024 06:40
@ndr-brt ndr-brt merged commit f688274 into eclipse-edc:main Oct 2, 2024
22 checks passed
@ndr-brt ndr-brt deleted the 4499-avoid-unnecessary-policy-store-accesses branch October 2, 2024 06:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring Cleaning up code and dependencies
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Optimize Catalog-Endpoint Performance
2 participants