ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agoncha...@apache.org
Subject [15/17] ignite git commit: ignite-1.4.2 - review and minor changes.
Date Mon, 12 Oct 2015 17:15:19 GMT
ignite-1.4.2 - review and minor changes.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/94f549f2
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/94f549f2
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/94f549f2

Branch: refs/heads/master
Commit: 94f549f2ff03c5f1f3eca29eb337eabf7d566cad
Parents: 155edd8
Author: Alexey Goncharuk <alexey.goncharuk@gmail.com>
Authored: Mon Oct 12 13:32:36 2015 +0300
Committer: Alexey Goncharuk <alexey.goncharuk@gmail.com>
Committed: Mon Oct 12 13:32:36 2015 +0300

----------------------------------------------------------------------
 .../discovery/GridDiscoveryManager.java         | 479 +------------------
 .../processors/cache/GridCacheProcessor.java    |  40 --
 .../cache/query/GridCacheQueryManager.java      |  41 --
 .../processors/rest/GridRestProcessor.java      |  47 --
 .../top/GridTopologyCommandHandler.java         | 129 -----
 5 files changed, 1 insertion(+), 735 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/94f549f2/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
index 9e54f6f..6aba211 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
@@ -2842,484 +2842,7 @@ public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi>
{
         }
     }
 
-    /** Cache for discovery collections. */
-    private class DiscoCache {
-        /** Remote nodes. */
-        private final List<ClusterNode> rmtNodes;
-
-        /** All nodes. */
-        private final List<ClusterNode> allNodes;
-
-        /** All nodes with at least one cache configured. */
-        @GridToStringInclude
-        private final Collection<ClusterNode> allNodesWithCaches;
-
-        /** All nodes with at least one cache configured. */
-        @GridToStringInclude
-        private final Collection<ClusterNode> rmtNodesWithCaches;
-
-        /** Cache nodes by cache name. */
-        @GridToStringInclude
-        private final Map<String, Collection<ClusterNode>> allCacheNodes;
-
-        /** Remote cache nodes by cache name. */
-        @GridToStringInclude
-        private final Map<String, Collection<ClusterNode>> rmtCacheNodes;
-
-        /** Cache nodes by cache name. */
-        @GridToStringInclude
-        private final Map<String, Collection<ClusterNode>> affCacheNodes;
-
-        /** Caches where at least one node has near cache enabled. */
-        @GridToStringInclude
-        private final Set<String> nearEnabledCaches;
-
-        /** Nodes grouped by version. */
-        private final NavigableMap<IgniteProductVersion, Collection<ClusterNode>>
nodesByVer;
-
-        /** Daemon nodes. */
-        private final List<ClusterNode> daemonNodes;
-
-        /** Node map. */
-        private final Map<UUID, ClusterNode> nodeMap;
-
-        /** Local node. */
-        private final ClusterNode loc;
-
-        /** Highest node order. */
-        private final long maxOrder;
-
-        /**
-         * Cached alive nodes list. As long as this collection doesn't accept {@code null}s
use {@link
-         * #maskNull(String)} before passing raw cache names to it.
-         */
-        private final ConcurrentMap<String, Collection<ClusterNode>> aliveCacheNodes;
-
-        /**
-         * Cached alive remote nodes list. As long as this collection doesn't accept {@code
null}s use {@link
-         * #maskNull(String)} before passing raw cache names to it.
-         */
-        private final ConcurrentMap<String, Collection<ClusterNode>> aliveRmtCacheNodes;
-
-        /**
-         * Cached alive remote nodes with caches.
-         */
-        private final Collection<ClusterNode> aliveNodesWithCaches;
-
-        /**
-         * Cached alive server remote nodes with caches.
-         */
-        private final Collection<ClusterNode> aliveSrvNodesWithCaches;
-
-        /**
-         * Cached alive remote server nodes with caches.
-         */
-        private final Collection<ClusterNode> aliveRmtSrvNodesWithCaches;
-
-        /**
-         * @param loc Local node.
-         * @param rmts Remote nodes.
-         */
-        private DiscoCache(ClusterNode loc, Collection<ClusterNode> rmts) {
-            this.loc = loc;
-
-            rmtNodes = Collections.unmodifiableList(new ArrayList<>(F.view(rmts, daemonFilter)));
-
-            assert !rmtNodes.contains(loc) : "Remote nodes collection shouldn't contain local
node" +
-                " [rmtNodes=" + rmtNodes + ", loc=" + loc + ']';
-
-            List<ClusterNode> all = new ArrayList<>(rmtNodes.size() + 1);
-
-            if (!loc.isDaemon())
-                all.add(loc);
-
-            all.addAll(rmtNodes);
-
-            Collections.sort(all, GridNodeOrderComparator.INSTANCE);
-
-            allNodes = Collections.unmodifiableList(all);
-
-            Map<String, Collection<ClusterNode>> cacheMap = new HashMap<>(allNodes.size(),
1.0f);
-            Map<String, Collection<ClusterNode>> rmtCacheMap = new HashMap<>(allNodes.size(),
1.0f);
-            Map<String, Collection<ClusterNode>> dhtNodesMap = new HashMap<>(allNodes.size(),
1.0f);
-            Collection<ClusterNode> nodesWithCaches = new HashSet<>(allNodes.size());
-            Collection<ClusterNode> rmtNodesWithCaches = new HashSet<>(allNodes.size());
-
-            aliveCacheNodes = new ConcurrentHashMap8<>(allNodes.size(), 1.0f);
-            aliveRmtCacheNodes = new ConcurrentHashMap8<>(allNodes.size(), 1.0f);
-            aliveNodesWithCaches = new ConcurrentSkipListSet<>();
-            aliveSrvNodesWithCaches = new ConcurrentSkipListSet<>();
-            aliveRmtSrvNodesWithCaches = new ConcurrentSkipListSet<>();
-            nodesByVer = new TreeMap<>();
-
-            long maxOrder0 = 0;
-
-            Set<String> nearEnabledSet = new HashSet<>();
-
-            for (ClusterNode node : allNodes) {
-                assert node.order() != 0 : "Invalid node order [locNode=" + loc + ", node="
+ node + ']';
-
-                if (node.order() > maxOrder0)
-                    maxOrder0 = node.order();
-
-                boolean hasCaches = false;
-
-                for (Map.Entry<String, CachePredicate> entry : registeredCaches.entrySet())
{
-                    String cacheName = entry.getKey();
-
-                    CachePredicate filter = entry.getValue();
-
-                    if (filter.cacheNode(node)) {
-                        nodesWithCaches.add(node);
-
-                        if (!loc.id().equals(node.id()))
-                            rmtNodesWithCaches.add(node);
-
-                        addToMap(cacheMap, cacheName, node);
-
-                        if (alive(node.id()))
-                            addToMap(aliveCacheNodes, maskNull(cacheName), node);
-
-                        if (filter.dataNode(node))
-                            addToMap(dhtNodesMap, cacheName, node);
-
-                        if (filter.nearNode(node))
-                            nearEnabledSet.add(cacheName);
-
-                        if (!loc.id().equals(node.id())) {
-                            addToMap(rmtCacheMap, cacheName, node);
-
-                            if (alive(node.id()))
-                                addToMap(aliveRmtCacheNodes, maskNull(cacheName), node);
-                        }
-
-                        hasCaches = true;
-                    }
-                }
-
-                if (hasCaches) {
-                    if (alive(node.id())) {
-                        aliveNodesWithCaches.add(node);
-
-                        if (!CU.clientNode(node)) {
-                            aliveSrvNodesWithCaches.add(node);
-
-                            if (!loc.id().equals(node.id()))
-                                aliveRmtSrvNodesWithCaches.add(node);
-                        }
-                    }
-                }
-
-                IgniteProductVersion nodeVer = U.productVersion(node);
-
-                // Create collection for this version if it does not exist.
-                Collection<ClusterNode> nodes = nodesByVer.get(nodeVer);
-
-                if (nodes == null) {
-                    nodes = new ArrayList<>(allNodes.size());
-
-                    nodesByVer.put(nodeVer, nodes);
-                }
-
-                nodes.add(node);
-            }
-
-            // Need second iteration to add this node to all previous node versions.
-            for (ClusterNode node : allNodes) {
-                IgniteProductVersion nodeVer = U.productVersion(node);
-
-                // Get all versions lower or equal node's version.
-                NavigableMap<IgniteProductVersion, Collection<ClusterNode>> updateView
=
-                    nodesByVer.headMap(nodeVer, false);
-
-                for (Collection<ClusterNode> prevVersions : updateView.values())
-                    prevVersions.add(node);
-            }
-
-            maxOrder = maxOrder0;
-
-            allCacheNodes = Collections.unmodifiableMap(cacheMap);
-            rmtCacheNodes = Collections.unmodifiableMap(rmtCacheMap);
-            affCacheNodes = Collections.unmodifiableMap(dhtNodesMap);
-            allNodesWithCaches = Collections.unmodifiableCollection(nodesWithCaches);
-            this.rmtNodesWithCaches = Collections.unmodifiableCollection(rmtNodesWithCaches);
-            nearEnabledCaches = Collections.unmodifiableSet(nearEnabledSet);
-
-            daemonNodes = Collections.unmodifiableList(new ArrayList<>(
-                F.view(F.concat(false, loc, rmts), F0.not(daemonFilter))));
-
-            Map<UUID, ClusterNode> nodeMap = new HashMap<>(allNodes().size()
+ daemonNodes.size(), 1.0f);
-
-            for (ClusterNode n : F.concat(false, allNodes(), daemonNodes()))
-                nodeMap.put(n.id(), n);
-
-            this.nodeMap = nodeMap;
-        }
-
-        /**
-         * Adds node to map.
-         *
-         * @param cacheMap Map to add to.
-         * @param cacheName Cache name.
-         * @param rich Node to add
-         */
-        private void addToMap(Map<String, Collection<ClusterNode>> cacheMap,
String cacheName, ClusterNode rich) {
-            Collection<ClusterNode> cacheNodes = cacheMap.get(cacheName);
-
-            if (cacheNodes == null) {
-                cacheNodes = new ArrayList<>(allNodes.size());
-
-                cacheMap.put(cacheName, cacheNodes);
-            }
-
-            cacheNodes.add(rich);
-        }
-
-        /** @return Local node. */
-        ClusterNode localNode() {
-            return loc;
-        }
-
-        /** @return Remote nodes. */
-        Collection<ClusterNode> remoteNodes() {
-            return rmtNodes;
-        }
-
-        /** @return All nodes. */
-        Collection<ClusterNode> allNodes() {
-            return allNodes;
-        }
-
-        /**
-         * Gets collection of nodes which have version equal or greater than {@code ver}.
-         *
-         * @param ver Version to check.
-         * @return Collection of nodes with version equal or greater than {@code ver}.
-         */
-        Collection<ClusterNode> elderNodes(IgniteProductVersion ver) {
-            Map.Entry<IgniteProductVersion, Collection<ClusterNode>> entry =
nodesByVer.ceilingEntry(ver);
-
-            if (entry == null)
-                return Collections.emptyList();
-
-            return entry.getValue();
-        }
-
-        /**
-         * @return Versions map.
-         */
-        NavigableMap<IgniteProductVersion, Collection<ClusterNode>> versionsMap()
{
-            return nodesByVer;
-        }
-
-        /**
-         * Gets collection of nodes with at least one cache configured.
-         *
-         * @param topVer Topology version (maximum allowed node order).
-         * @return Collection of nodes.
-         */
-        Collection<ClusterNode> allNodesWithCaches(final long topVer) {
-            return filter(topVer, allNodesWithCaches);
-        }
-
-        /**
-         * Gets all nodes that have cache with given name.
-         *
-         * @param cacheName Cache name.
-         * @param topVer Topology version.
-         * @return Collection of nodes.
-         */
-        Collection<ClusterNode> cacheNodes(@Nullable String cacheName, final long topVer)
{
-            return filter(topVer, allCacheNodes.get(cacheName));
-        }
-
-        /**
-         * Gets all remote nodes that have cache with given name.
-         *
-         * @param cacheName Cache name.
-         * @param topVer Topology version.
-         * @return Collection of nodes.
-         */
-        Collection<ClusterNode> remoteCacheNodes(@Nullable String cacheName, final
long topVer) {
-            return filter(topVer, rmtCacheNodes.get(cacheName));
-        }
-
-        /**
-         * Gets all remote nodes that have at least one cache configured.
-         *
-         * @param topVer Topology version.
-         * @return Collection of nodes.
-         */
-        Collection<ClusterNode> remoteCacheNodes(final long topVer) {
-            return filter(topVer, rmtNodesWithCaches);
-        }
-
-        /**
-         * Gets all nodes that have cache with given name and should participate in affinity
calculation. With
-         * partitioned cache nodes with near-only cache do not participate in affinity node
calculation.
-         *
-         * @param cacheName Cache name.
-         * @param topVer Topology version.
-         * @return Collection of nodes.
-         */
-        Collection<ClusterNode> cacheAffinityNodes(@Nullable String cacheName, final
long topVer) {
-            return filter(topVer, affCacheNodes.get(cacheName));
-        }
-
-        /**
-         * Gets all alive nodes that have cache with given name.
-         *
-         * @param cacheName Cache name.
-         * @param topVer Topology version.
-         * @return Collection of nodes.
-         */
-        Collection<ClusterNode> aliveCacheNodes(@Nullable String cacheName, final long
topVer) {
-            return filter(topVer, aliveCacheNodes.get(maskNull(cacheName)));
-        }
-
-        /**
-         * Gets all alive remote nodes that have cache with given name.
-         *
-         * @param cacheName Cache name.
-         * @param topVer Topology version.
-         * @return Collection of nodes.
-         */
-        Collection<ClusterNode> aliveRemoteCacheNodes(@Nullable String cacheName, final
long topVer) {
-            return filter(topVer, aliveRmtCacheNodes.get(maskNull(cacheName)));
-        }
-
-        /**
-         * Gets all alive remote server nodes with at least one cache configured.
-         *
-         * @param topVer Topology version.
-         * @return Collection of nodes.
-         */
-        Collection<ClusterNode> aliveRemoteServerNodesWithCaches(final long topVer)
{
-            return filter(topVer, aliveRmtSrvNodesWithCaches);
-        }
-
-        /**
-         * Gets all alive server nodes with at least one cache configured.
-         *
-         * @param topVer Topology version.
-         * @return Collection of nodes.
-         */
-        Collection<ClusterNode> aliveServerNodesWithCaches(final long topVer) {
-            return filter(topVer, aliveSrvNodesWithCaches);
-        }
-
-        /**
-         * Gets all alive remote nodes with at least one cache configured.
-         *
-         * @param topVer Topology version.
-         * @return Collection of nodes.
-         */
-        Collection<ClusterNode> aliveNodesWithCaches(final long topVer) {
-            return filter(topVer, aliveNodesWithCaches);
-        }
-
-        /**
-         * Checks if cache with given name has at least one node with near cache enabled.
-         *
-         * @param cacheName Cache name.
-         * @return {@code True} if cache with given name has at least one node with near
cache enabled.
-         */
-        boolean hasNearCache(@Nullable String cacheName) {
-            return nearEnabledCaches.contains(cacheName);
-        }
-
-        /**
-         * Removes left node from cached alives lists.
-         *
-         * @param leftNode Left node.
-         */
-        void updateAlives(ClusterNode leftNode) {
-            if (leftNode.order() > maxOrder)
-                return;
-
-            filterNodeMap(aliveCacheNodes, leftNode);
-
-            filterNodeMap(aliveRmtCacheNodes, leftNode);
-
-            aliveNodesWithCaches.remove(leftNode);
-            aliveSrvNodesWithCaches.remove(leftNode);
-            aliveRmtSrvNodesWithCaches.remove(leftNode);
-        }
-
-        /**
-         * Creates a copy of nodes map without the given node.
-         *
-         * @param map Map to copy.
-         * @param exclNode Node to exclude.
-         */
-        private void filterNodeMap(ConcurrentMap<String, Collection<ClusterNode>>
map, final ClusterNode exclNode) {
-            for (String cacheName : registeredCaches.keySet()) {
-                String maskedName = maskNull(cacheName);
-
-                while (true) {
-                    Collection<ClusterNode> oldNodes = map.get(maskedName);
-
-                    if (oldNodes == null || oldNodes.isEmpty())
-                        break;
-
-                    Collection<ClusterNode> newNodes = new ArrayList<>(oldNodes);
-
-                    if (!newNodes.remove(exclNode))
-                        break;
-
-                    if (map.replace(maskedName, oldNodes, newNodes))
-                        break;
-                }
-            }
-        }
-
-        /**
-         * Replaces {@code null} with {@code NULL_CACHE_NAME}.
-         *
-         * @param cacheName Cache name.
-         * @return Masked name.
-         */
-        private String maskNull(@Nullable String cacheName) {
-            return cacheName == null ? NULL_CACHE_NAME : cacheName;
-        }
-
-        /**
-         * @param topVer Topology version.
-         * @param nodes Nodes.
-         * @return Filtered collection (potentially empty, but never {@code null}).
-         */
-        private Collection<ClusterNode> filter(final long topVer, @Nullable Collection<ClusterNode>
nodes) {
-            if (nodes == null)
-                return Collections.emptyList();
-
-            // If no filtering needed, return original collection.
-            return nodes.isEmpty() || topVer < 0 || topVer >= maxOrder ?
-                nodes :
-                F.view(nodes, new P1<ClusterNode>() {
-                    @Override public boolean apply(ClusterNode node) {
-                        return node.order() <= topVer;
-                    }
-                });
-        }
-
-        /** @return Daemon nodes. */
-        Collection<ClusterNode> daemonNodes() {
-            return daemonNodes;
-        }
-
-        /**
-         * @param id Node ID.
-         * @return Node.
-         */
-        @Nullable ClusterNode node(UUID id) {
-            return nodeMap.get(id);
-        }
-
-        /** {@inheritDoc} */
-        @Override public String toString() {
-            return S.toString(DiscoCache.class, this, "allNodesWithDaemons", U.toShortString(allNodes));
-        }
-    }    /**
+    /**
      * Cache predicate.
      */
     private static class CachePredicate {

http://git-wip-us.apache.org/repos/asf/ignite/blob/94f549f2/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
index 736e630..8c96c0c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
@@ -3482,46 +3482,6 @@ public class GridCacheProcessor extends GridProcessorAdapter {
     /**
      *
      */
-    @SuppressWarnings("ExternalizableWithoutPublicNoArgConstructor")
-    private class TemplateConfigurationFuture extends GridFutureAdapter<Object> {
-        /** Start ID. */
-        @GridToStringInclude
-        private IgniteUuid deploymentId;
-
-        /** Cache name. */
-        private String cacheName;
-
-        /**
-         * @param cacheName Cache name.
-         * @param deploymentId Deployment ID.
-         */
-        private TemplateConfigurationFuture(String cacheName, IgniteUuid deploymentId) {
-            this.deploymentId = deploymentId;
-            this.cacheName = cacheName;
-        }
-
-        /**
-         * @return Start ID.
-         */
-        public IgniteUuid deploymentId() {
-            return deploymentId;
-        }
-
-        /** {@inheritDoc} */
-        @Override public boolean onDone(@Nullable Object res, @Nullable Throwable err) {
-            // Make sure to remove future before completion.
-            pendingTemplateFuts.remove(maskNull(cacheName), this);
-
-            return super.onDone(res, err);
-        }
-
-        /** {@inheritDoc} */
-        @Override public String toString() {
-            return S.toString(TemplateConfigurationFuture.class, this);
-        }
-    }    /**
-     *
-     */
     private static class LocalAffinityFunction implements AffinityFunction {
         /** */
         private static final long serialVersionUID = 0L;

http://git-wip-us.apache.org/repos/asf/ignite/blob/94f549f2/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
index 698b035..1c8107e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
@@ -3082,47 +3082,6 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
     }
 
     /**
-     *
-     */
-    private class OffheapIteratorClosure
-        extends CX2<T2<Long, Integer>, T2<Long, Integer>, IgniteBiTuple<K,
V>> {
-        /** */
-        private static final long serialVersionUID = 7410163202728985912L;
-
-        /** */
-        private IgniteBiPredicate<K, V> filter;
-
-        /** */
-        private boolean keepPortable;
-
-        /**
-         * @param filter Filter.
-         * @param keepPortable Keep portable flag.
-         */
-        private OffheapIteratorClosure(
-            @Nullable IgniteBiPredicate<K, V> filter,
-            boolean keepPortable) {
-            assert filter != null;
-
-            this.filter = filter;
-            this.keepPortable = keepPortable;
-        }
-
-        /** {@inheritDoc} */
-        @Nullable @Override public IgniteBiTuple<K, V> applyx(T2<Long, Integer>
keyPtr,
-            T2<Long, Integer> valPtr)
-            throws IgniteCheckedException {
-            LazyOffheapEntry e = new LazyOffheapEntry(keyPtr, valPtr);
-
-            K key = (K)cctx.unwrapPortableIfNeeded(e.key(), keepPortable);
-            V val = (V)cctx.unwrapPortableIfNeeded(e.value(), keepPortable);
-
-            if (!filter.apply(key, val))
-                return null;
-
-            return new IgniteBiTuple<>(e.key(), (V)cctx.unwrapTemporary(e.value()));
-        }
-    }    /**
      * Creates user's SQL fields query for given clause. For more information refer to {@link
CacheQuery}
      * documentation.
      *

http://git-wip-us.apache.org/repos/asf/ignite/blob/94f549f2/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/GridRestProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/GridRestProcessor.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/GridRestProcessor.java
index df79232..4bb02c4 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/GridRestProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/GridRestProcessor.java
@@ -565,53 +565,6 @@ public class GridRestProcessor extends GridProcessorAdapter {
     }
 
     /**
-     * Applies {@link ConnectorMessageInterceptor}
-     * from {@link ConnectorConfiguration#getMessageInterceptor()} ()}
-     * to all user parameters in the request.
-     *
-     * @param req Client request.
-     */
-    private void interceptRequest(GridRestRequest req) {
-        ConnectorMessageInterceptor interceptor = config().getMessageInterceptor();
-
-        if (interceptor == null)
-            return;
-
-        if (req instanceof GridRestCacheRequest) {
-            GridRestCacheRequest req0 = (GridRestCacheRequest) req;
-
-            req0.key(interceptor.onReceive(req0.key()));
-            req0.value(interceptor.onReceive(req0.value()));
-            req0.value2(interceptor.onReceive(req0.value2()));
-
-            Map<Object, Object> oldVals = req0.values();
-
-            if (oldVals != null) {
-                Map<Object, Object> newVals = U.newHashMap(oldVals.size());
-
-                for (Map.Entry<Object, Object> e : oldVals.entrySet())
-                    newVals.put(interceptor.onReceive(e.getKey()), interceptor.onReceive(e.getValue()));
-
-                req0.values(U.sealMap(newVals));
-            }
-        }
-        else if (req instanceof GridRestTaskRequest) {
-            GridRestTaskRequest req0 = (GridRestTaskRequest) req;
-
-            List<Object> oldParams = req0.params();
-
-            if (oldParams != null) {
-                Collection<Object> newParams = new ArrayList<>(oldParams.size());
-
-                for (Object o : oldParams)
-                    newParams.add(interceptor.onReceive(o));
-
-                req0.params(U.sealList(newParams));
-            }
-        }
-    }
-
-    /**
      * Applies {@link ConnectorMessageInterceptor} from
      * {@link ConnectorConfiguration#getMessageInterceptor()}
      * to all user objects in the response.

http://git-wip-us.apache.org/repos/asf/ignite/blob/94f549f2/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/top/GridTopologyCommandHandler.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/top/GridTopologyCommandHandler.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/top/GridTopologyCommandHandler.java
index 3b36c6a..eea29d2 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/top/GridTopologyCommandHandler.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/top/GridTopologyCommandHandler.java
@@ -307,135 +307,6 @@ public class GridTopologyCommandHandler extends GridRestCommandHandlerAdapter
{
     }
 
     /**
-     * Creates node bean out of grid node. Notice that cache attribute is handled separately.
-     *
-     * @param node Grid node.
-     * @param mtr {@code true} to add metrics.
-     * @param attr {@code true} to add attributes.
-     * @return Grid Node bean.
-     */
-    private GridClientNodeBean createNodeBean(ClusterNode node, boolean mtr, boolean attr)
{
-        assert node != null;
-
-        GridClientNodeBean nodeBean = new GridClientNodeBean();
-
-        nodeBean.setNodeId(node.id());
-        nodeBean.setConsistentId(node.consistentId());
-        nodeBean.setTcpPort(attribute(node, ATTR_REST_TCP_PORT, 0));
-
-        nodeBean.setTcpAddresses(nonEmptyList(node.<Collection<String>>attribute(ATTR_REST_TCP_ADDRS)));
-        nodeBean.setTcpHostNames(nonEmptyList(node.<Collection<String>>attribute(ATTR_REST_TCP_HOST_NAMES)));
-
-        Map<String, CacheMode> nodeCaches = ctx.discovery().nodeCaches(node);
-
-        Map<String, String> cacheMap = U.newHashMap(nodeCaches.size());
-
-        for (Map.Entry<String, CacheMode> cache : nodeCaches.entrySet()) {
-            String cacheName = cache.getKey();
-
-            if (CU.isSystemCache(cacheName) || CU.isIgfsCache(ctx.config(), cacheName))
-                continue;
-
-            String mode = cache.getValue().toString();
-
-            if (cacheName != null)
-                cacheMap.put(cacheName, mode);
-            else
-                nodeBean.setDefaultCacheMode(mode);
-        }
-
-        nodeBean.setCaches(cacheMap);
-
-        if (mtr) {
-            ClusterMetrics metrics = node.metrics();
-
-            GridClientNodeMetricsBean metricsBean = new GridClientNodeMetricsBean();
-
-            metricsBean.setStartTime(metrics.getStartTime());
-            metricsBean.setAverageActiveJobs(metrics.getAverageActiveJobs());
-            metricsBean.setAverageCancelledJobs(metrics.getAverageCancelledJobs());
-            metricsBean.setAverageCpuLoad(metrics.getAverageCpuLoad());
-            metricsBean.setAverageJobExecuteTime(metrics.getAverageJobExecuteTime());
-            metricsBean.setAverageJobWaitTime(metrics.getAverageJobWaitTime());
-            metricsBean.setAverageRejectedJobs(metrics.getAverageRejectedJobs());
-            metricsBean.setAverageWaitingJobs(metrics.getAverageWaitingJobs());
-            metricsBean.setCurrentActiveJobs(metrics.getCurrentActiveJobs());
-            metricsBean.setCurrentCancelledJobs(metrics.getCurrentCancelledJobs());
-            metricsBean.setCurrentCpuLoad(metrics.getCurrentCpuLoad());
-            metricsBean.setCurrentGcCpuLoad(metrics.getCurrentGcCpuLoad());
-            metricsBean.setCurrentDaemonThreadCount(metrics.getCurrentDaemonThreadCount());
-            metricsBean.setCurrentIdleTime(metrics.getCurrentIdleTime());
-            metricsBean.setCurrentJobExecuteTime(metrics.getCurrentJobExecuteTime());
-            metricsBean.setCurrentJobWaitTime(metrics.getCurrentJobWaitTime());
-            metricsBean.setCurrentRejectedJobs(metrics.getCurrentRejectedJobs());
-            metricsBean.setCurrentThreadCount(metrics.getCurrentThreadCount());
-            metricsBean.setCurrentWaitingJobs(metrics.getCurrentWaitingJobs());
-            metricsBean.setHeapMemoryCommitted(metrics.getHeapMemoryCommitted());
-            metricsBean.setHeapMemoryInitialized(metrics.getHeapMemoryInitialized());
-            metricsBean.setHeapMemoryMaximum(metrics.getHeapMemoryMaximum());
-            metricsBean.setHeapMemoryUsed(metrics.getHeapMemoryUsed());
-            metricsBean.setLastDataVersion(metrics.getLastDataVersion());
-            metricsBean.setLastUpdateTime(metrics.getLastUpdateTime());
-            metricsBean.setMaximumActiveJobs(metrics.getMaximumActiveJobs());
-            metricsBean.setMaximumCancelledJobs(metrics.getMaximumCancelledJobs());
-            metricsBean.setMaximumJobExecuteTime(metrics.getMaximumJobExecuteTime());
-            metricsBean.setMaximumJobWaitTime(metrics.getMaximumJobWaitTime());
-            metricsBean.setMaximumRejectedJobs(metrics.getMaximumRejectedJobs());
-            metricsBean.setMaximumThreadCount(metrics.getMaximumThreadCount());
-            metricsBean.setMaximumWaitingJobs(metrics.getMaximumWaitingJobs());
-            metricsBean.setNodeStartTime(metrics.getNodeStartTime());
-            metricsBean.setNonHeapMemoryCommitted(metrics.getNonHeapMemoryCommitted());
-            metricsBean.setNonHeapMemoryInitialized(metrics.getNonHeapMemoryInitialized());
-            metricsBean.setNonHeapMemoryMaximum(metrics.getNonHeapMemoryMaximum());
-            metricsBean.setNonHeapMemoryUsed(metrics.getNonHeapMemoryUsed());
-            metricsBean.setStartTime(metrics.getStartTime());
-            metricsBean.setTotalCancelledJobs(metrics.getTotalCancelledJobs());
-            metricsBean.setTotalCpus(metrics.getTotalCpus());
-            metricsBean.setTotalExecutedJobs(metrics.getTotalExecutedJobs());
-            metricsBean.setTotalIdleTime(metrics.getTotalIdleTime());
-            metricsBean.setTotalRejectedJobs(metrics.getTotalRejectedJobs());
-            metricsBean.setTotalStartedThreadCount(metrics.getTotalStartedThreadCount());
-            metricsBean.setTotalExecutedTasks(metrics.getTotalExecutedTasks());
-            metricsBean.setSentMessagesCount(metrics.getSentMessagesCount());
-            metricsBean.setSentBytesCount(metrics.getSentBytesCount());
-            metricsBean.setReceivedMessagesCount(metrics.getReceivedMessagesCount());
-            metricsBean.setReceivedBytesCount(metrics.getReceivedBytesCount());
-            metricsBean.setUpTime(metrics.getUpTime());
-
-            nodeBean.setMetrics(metricsBean);
-        }
-
-        if (attr) {
-            Map<String, Object> attrs = new HashMap<>(node.attributes());
-
-            attrs.remove(ATTR_CACHE);
-            attrs.remove(ATTR_TX_CONFIG);
-            attrs.remove(ATTR_SECURITY_SUBJECT);
-            attrs.remove(ATTR_SECURITY_CREDENTIALS);
-
-            for (Iterator<Map.Entry<String, Object>> i = attrs.entrySet().iterator();
i.hasNext();) {
-                Map.Entry<String, Object> e = i.next();
-
-                if (!e.getKey().startsWith("org.apache.ignite.") && !e.getKey().startsWith("plugins.")
&&
-                    System.getProperty(e.getKey()) == null) {
-                    i.remove();
-
-                    continue;
-                }
-
-                if (e.getValue() != null) {
-                  if (e.getValue().getClass().isEnum() || e.getValue() instanceof InetAddress)
-                      e.setValue(e.getValue().toString());
-                  else if (e.getValue().getClass().isArray())
-                      i.remove();
-                }
-            }
-
-            nodeBean.setAttributes(attrs);
-        }
-
-        return nodeBean;
-    }    /**
      * @param col Collection;
      * @return Non-empty list.
      */


Mime
View raw message