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

Lazy loading of extension attributes + powsybl-ws-dependencies 2.15.0 #49

Merged
merged 12 commits into from
Sep 26, 2024

Conversation

antoinebhs
Copy link
Contributor

@antoinebhs antoinebhs commented Jul 17, 2024

Please check if the PR fulfills these requirements

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

What kind of change does this PR introduce?

Instead of loading all the extension attributes of an identifiable when fetching the identifiable, the extension attributes are lazily loaded when needed (i.e: when getExtension(), getExtensionByName(), getExtensions() or removeExtension() are called).
This evolution is reflected in network-store (powsybl/powsybl-network-store#411).

What is the current behavior?

In the current implementation, whenever the identifiable is retrieved from the store, the extension attributes are loaded with the identifiable in the extensionAttributes Map<extensionName, extensionAttributes>. This behavior implies that all the services using the network-store need to have the deserializer for all the extensions in the network. This is an important limitation as it forces us to create a lot of docker images for services that don't even need to deserialize these extensions as they don't use them.

What is the new behavior (if this is a feature change)?
The endpoints necessary for the network-store lazy loading implementation of extension attributes to work are implemented in this PR. More details in powsybl/powsybl-network-store#411. Corresponding test and queries are updated to fetch the corresponding data.

In the previous implementation, when extensions were updated, we removed all the extensions of the identifiable and replaced them with the updated ones. In the proposed implementation, we remove only extensions that were loaded in the resources to avoid removing extension attributes that need to be kept.

Signed-off-by: BOUHOURS Antoine <[email protected]>
Signed-off-by: BOUHOURS Antoine <[email protected]>
Signed-off-by: BOUHOURS Antoine <[email protected]>
Signed-off-by: BOUHOURS Antoine <[email protected]>
Signed-off-by: BOUHOURS Antoine <[email protected]>
Signed-off-by: BOUHOURS Antoine <[email protected]>
Copy link

@antoinebhs antoinebhs changed the title Lazy loading of extension attributes Lazy loading of extension attributes + powsybl-ws-dependencies 2.15.0 Sep 25, 2024
@antoinebhs antoinebhs merged commit ac3a010 into main Sep 26, 2024
4 checks passed
@antoinebhs antoinebhs deleted the lazy-loading-extension-attributes branch September 26, 2024 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants