You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2021/02/17 15:53:49 UTC

[GitHub] [ignite] alex-plekhanov commented on a change in pull request #8802: IGNITE-12508: Fix GridCacheProcessor#cacheDescriptor's Time Complexity

alex-plekhanov commented on a change in pull request #8802:
URL: https://github.com/apache/ignite/pull/8802#discussion_r577718329



##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClusterCachesInfo.java
##########
@@ -127,6 +127,8 @@
     /** Dynamic caches. */
     private final ConcurrentMap<String, DynamicCacheDescriptor> registeredCaches = new ConcurrentHashMap<>();
 
+    private final ConcurrentMap<Integer, String> cacheIdToNameMapping = new ConcurrentHashMap<>();

Review comment:
       Why we can't use `id` to `cache descriptor` mapping? Why do we need `id` to `name` mapping and map `name` to `cache descriptor` later?

##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
##########
@@ -4568,6 +4568,13 @@ public DynamicCacheDescriptor cacheDescriptor(String name) {
         return cachesInfo.registeredCaches();
     }
 
+    /**
+     * @return Cache ID to Name Mapping
+     */
+    public Map<Integer, String> cacheIdToNameMapping() {

Review comment:
       Please don't expose internal data structures until it's required by anyone. 




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org