-
Notifications
You must be signed in to change notification settings - Fork 6
Add buffer to delete extensions #573
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Etienne LESOT <[email protected]>
Signed-off-by: Etienne LESOT <[email protected]>
Signed-off-by: Etienne LESOT <[email protected]>
network-store-client/src/main/java/com/powsybl/network/store/client/util/QuadriConsumer.java
Show resolved
Hide resolved
...-store-client/src/main/java/com/powsybl/network/store/client/BufferedNetworkStoreClient.java
Outdated
Show resolved
Hide resolved
| private static <D> void cloneExternalBuffer(NetworkCollectionIndex<ExternalAttributesCollectionBuffer<D>> buffer, UUID networkUuid, | ||
| int sourceVariantNum, int targetVariantNum) { | ||
| // clone resources from source variant collection | ||
| ExternalAttributesCollectionBuffer<D> clonedCollection = | ||
| new ExternalAttributesCollectionBuffer<>(buffer.getCollection(networkUuid, sourceVariantNum)); | ||
| buffer.addCollection(networkUuid, targetVariantNum, clonedCollection); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it a deep clone, use the same mechanism as usual buffer (a clone method in the buffer class)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sonar prefers not
...tore-client/src/test/java/com/powsybl/network/store/client/CachedNetworkStoreClientTest.java
Outdated
Show resolved
Hide resolved
...re-iidm-impl/src/main/java/com/powsybl/network/store/iidm/impl/CachedNetworkStoreClient.java
Outdated
Show resolved
Hide resolved
| private final QuadriConsumer<UUID, Integer, ResourceType, Map<String, T>> removeFct; | ||
|
|
||
| private final Map<ResourceType, Map<String, T>> removeResourcesIds = new HashMap<>(); | ||
| private final BiConsumer<Map<String, T>, Map<String, T>> addFct; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe it more of a mergeFct than a addFct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is more a putAll function isnt it ?
...rk-store-iidm-impl/src/main/java/com/powsybl/network/store/iidm/impl/NetworkStoreClient.java
Outdated
Show resolved
Hide resolved
|
I'm dubious on whether or not it works with the existing buffer implementation for identifiables as they are closely related.
Another case:
Another case:
Can you verify that all these cases work fine with your implementation? And think about other similar cases that could be tricky as the new buffer is very linked to CollectionBuffer |
Signed-off-by: Etienne LESOT <[email protected]>
Signed-off-by: Etienne LESOT <[email protected]>
Signed-off-by: Etienne LESOT <[email protected]>
Signed-off-by: Etienne LESOT <[email protected]>
Signed-off-by: Etienne LESOT <[email protected]>
Signed-off-by: Etienne LESOT <[email protected]>
Signed-off-by: Etienne LESOT <[email protected]>
Signed-off-by: Etienne LESOT <[email protected]>
Signed-off-by: Etienne LESOT <[email protected]>
Signed-off-by: Etienne LESOT <[email protected]>
|




Please check if the PR fulfills these requirements
Does this PR already have an issue describing the problem?
no
What kind of change does this PR introduce?
feature
What is the current behavior?
extension are delete one by one
What is the new behavior (if this is a feature change)?
add a buffer to delete all extension in one flush
Does this PR introduce a breaking change or deprecate an API?
If yes, please check if the following requirements are fulfilled
What changes might users need to make in their application due to this PR? (migration steps)
the method removeExtension now works with a map of identifiable ids by extension instead of one identifiable name and one extension name
Other informations
linked with powsybl/powsybl-network-store-server#146
#572 is needed before merging these one