You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by vo...@apache.org on 2016/07/27 12:22:13 UTC
[5/7] ignite git commit: Collector task do not honor node filters for
caches and IGFS.
Collector task do not honor node filters for caches and IGFS.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/4979c870
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/4979c870
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/4979c870
Branch: refs/heads/ignite-3553
Commit: 4979c870735698dc51ce2c0db350a0f35c9b8b0e
Parents: 9d07e3e
Author: Andrey Novikov <an...@apache.org>
Authored: Wed Jul 27 16:12:39 2016 +0700
Committer: Andrey Novikov <an...@apache.org>
Committed: Wed Jul 27 16:12:39 2016 +0700
----------------------------------------------------------------------
.../visor/node/VisorNodeDataCollectorJob.java | 25 +++++++++++++++++---
1 file changed, 22 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/4979c870/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodeDataCollectorJob.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodeDataCollectorJob.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodeDataCollectorJob.java
index 9a9b1cd..1404f8e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodeDataCollectorJob.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodeDataCollectorJob.java
@@ -21,8 +21,9 @@ import java.util.Collection;
import java.util.concurrent.ConcurrentMap;
import org.apache.ignite.IgniteFileSystem;
import org.apache.ignite.cluster.ClusterNode;
+import org.apache.ignite.configuration.FileSystemConfiguration;
import org.apache.ignite.configuration.IgniteConfiguration;
-import org.apache.ignite.internal.processors.cache.GridCacheProcessor;
+import org.apache.ignite.internal.managers.discovery.GridDiscoveryManager;
import org.apache.ignite.internal.processors.igfs.IgfsProcessorAdapter;
import org.apache.ignite.internal.util.ipc.IpcServerEndpoint;
import org.apache.ignite.internal.util.typedef.internal.S;
@@ -156,6 +157,18 @@ public class VisorNodeDataCollectorJob extends VisorJob<VisorNodeDataCollectorTa
}
/**
+ * @param cacheName Cache name to check.
+ * @return {@code true} if cache on local node is not a data cache or near cache disabled.
+ */
+ private boolean proxyCache(String cacheName) {
+ GridDiscoveryManager discovery = ignite.context().discovery();
+
+ ClusterNode locNode = ignite.localNode();
+
+ return !(discovery.cacheAffinityNode(locNode, cacheName) || discovery.cacheNearNode(locNode, cacheName));
+ }
+
+ /**
* Collect caches.
*
* @param res Job result.
@@ -165,9 +178,10 @@ public class VisorNodeDataCollectorJob extends VisorJob<VisorNodeDataCollectorTa
try {
IgniteConfiguration cfg = ignite.configuration();
- GridCacheProcessor cacheProc = ignite.context().cache();
+ for (String cacheName : ignite.context().cache().cacheNames()) {
+ if (proxyCache(cacheName))
+ continue;
- for (String cacheName : cacheProc.cacheNames()) {
if (arg.systemCaches() || !(isSystemCache(cacheName) || isIgfsCache(cfg, cacheName))) {
long start0 = U.currentTimeMillis();
@@ -205,6 +219,11 @@ public class VisorNodeDataCollectorJob extends VisorJob<VisorNodeDataCollectorTa
for (IgniteFileSystem igfs : igfsProc.igfss()) {
long start0 = U.currentTimeMillis();
+ FileSystemConfiguration igfsCfg = igfs.configuration();
+
+ if (proxyCache(igfsCfg.getDataCacheName()) || proxyCache(igfsCfg.getMetaCacheName()))
+ continue;
+
try {
Collection<IpcServerEndpoint> endPoints = igfsProc.endpoints(igfs.name());