ibessonov commented on code in PR #7089:
URL: https://github.com/apache/ignite-3/pull/7089#discussion_r2568463692


##########
modules/catalog/src/main/java/org/apache/ignite/internal/catalog/CatalogManagerImpl.java:
##########
@@ -79,10 +77,10 @@ public class CatalogManagerImpl extends 
AbstractEventProducer<CatalogEvent, Cata
     private static final IgniteLogger LOG = 
Loggers.forClass(CatalogManagerImpl.class);
 
     /** Versioned catalog descriptors. */
-    private final NavigableMap<Integer, Catalog> catalogByVer = new 
ConcurrentSkipListMap<>();
+    private final AtomicReference<CatalogByIndexMap> catalogByVer = new 
AtomicReference<>(new CatalogByIndexMap());

Review Comment:
   I should add a comment here. The fricking `Mockito.spy` that we use in tests 
forces us to use atomic references, otherwise tests just go crazy (`spy` copies 
all the fields into a new instance, so you don't update fields of the copy when 
you update your own fields)



-- 
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]

Reply via email to