oleg-vlsk commented on code in PR #12760:
URL: https://github.com/apache/ignite/pull/12760#discussion_r2836704073
##########
modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentLocalStore.java:
##########
@@ -296,23 +299,49 @@ private GridDeployment deploy(
try {
Deque<GridDeployment> cachedDeps = null;
- // Find existing class loader info.
- for (Deque<GridDeployment> deps : cache.values()) {
- for (GridDeployment d : deps) {
- if (d.classLoader() == ldr) {
- // Cache class and alias.
- fireEvt = d.addDeployedClass(cls, alias);
+ Deque<GridDeployment> depsByLdr = cacheByLdr.get(ldr);
Review Comment:
Not necessarily. In `GridDeploymentLocalStore#cache` we can have several
deployments with the same classloader associated with one alias/class name (see
attached screenshots).
But it seems that for lookup purposes it's better to use the 1-to-1 relation
between classloaders and deployments. That's why I additionally introduced
`Map<ClassLoader, GridDeployment> depsByLdr`.
At the same time I kept the `Map<ClassLoader, Deque<GridDeployment>>
cacheByLdr` field in order to preserve the existing contract of `cache`, where
each alias/class is mapped to a colleciton of associated deployments.
<img width="1203" height="852" alt="local deployments cache - 1"
src="https://github.com/user-attachments/assets/d9435325-bb3b-412e-be71-59ddf391cca1"
/>
<img width="1175" height="862" alt="local deployments cache - 2"
src="https://github.com/user-attachments/assets/0d7877ae-72cd-4540-ba02-e2705eb3d5c3"
/>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]