Index: ../../ignite/incubator-ignite/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/top/GridTopologyCommandHandler.java IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- ../../ignite/incubator-ignite/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/top/GridTopologyCommandHandler.java (revision f20f5c5b6c126d11245ad026c4431e6ed80ae1f4) +++ ../../ignite/incubator-ignite/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/top/GridTopologyCommandHandler.java (revision ) @@ -173,23 +173,27 @@ nodeBean.setTcpAddresses(nonEmptyList(node.>attribute(ATTR_REST_TCP_ADDRS))); nodeBean.setTcpHostNames(nonEmptyList(node.>attribute(ATTR_REST_TCP_HOST_NAMES))); - GridCacheAttributes[] caches = node.attribute(ATTR_CACHE); + Collection cacheNames = ctx.discovery().nodeCaches(node); - if (!F.isEmpty(caches)) { - Map cacheMap = new HashMap<>(); + Map cacheMap = U.newHashMap(cacheNames.size()); - for (GridCacheAttributes cacheAttr : caches) { - if (ctx.cache().systemCache(cacheAttr.cacheName())) + GridCacheProcessor cacheProc = ctx.cache(); + + for (String cacheName : cacheNames) { + IgniteInternalCache cache = cacheProc.cache(cacheName); + + if (cacheProc.systemCache(cache.name())) - continue; + continue; - if (cacheAttr.cacheName() != null) - cacheMap.put(cacheAttr.cacheName(), cacheAttr.cacheMode().toString()); + String mode = cache.configuration().getCacheMode().toString(); + + if (cache.name() != null) + cacheMap.put(cache.name(), mode); - else + else - nodeBean.setDefaultCacheMode(cacheAttr.cacheMode().toString()); + nodeBean.setDefaultCacheMode(mode); - } + } - nodeBean.setCaches(cacheMap); + nodeBean.setCaches(cacheMap); - } if (mtr) { ClusterMetrics metrics = node.metrics(); Index: ../../ignite/incubator-ignite/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- ../../ignite/incubator-ignite/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java (revision f20f5c5b6c126d11245ad026c4431e6ed80ae1f4) +++ ../../ignite/incubator-ignite/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java (revision ) @@ -1512,6 +1512,25 @@ } /** + * @param node Node to check. + * @return Cache names accessible on the given node. + */ + public Collection nodeCaches(ClusterNode node) { + Collection cacheNames = new ArrayList<>(registeredCaches.size()); + + for (Map.Entry entry : registeredCaches.entrySet()) { + String cacheName = entry.getKey(); + + CachePredicate filter = entry.getValue(); + + if (filter != null && filter.cacheNode(node)) + cacheNames.add(cacheName); + } + + return cacheNames; + } + + /** * Checks if cache with given name has at least one node with near cache enabled. * * @param cacheName Cache name.