You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sb...@apache.org on 2015/09/30 13:54:36 UTC
ignite git commit: ignite-1534 Skip unnecessary exchanges
Repository: ignite
Updated Branches:
refs/heads/ignite-1534-1 [created] 638decbaf
ignite-1534 Skip unnecessary exchanges
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/638decba
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/638decba
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/638decba
Branch: refs/heads/ignite-1534-1
Commit: 638decbaf82e1892e6bb1784b55b892aab67852d
Parents: 273f291
Author: sboikov <sb...@gridgain.com>
Authored: Wed Sep 30 14:54:23 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Wed Sep 30 14:54:23 2015 +0300
----------------------------------------------------------------------
.../processors/cache/GridCacheProcessor.java | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/638decba/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 6c13399..5591fa6 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
@@ -2474,10 +2474,16 @@ public class GridCacheProcessor extends GridProcessorAdapter {
}
}
else {
- if (req.clientStartOnly()) {
- assert req.initiatingNodeId() != null : req;
+ assert req.initiatingNodeId() != null : req;
+
+ // Cache already exists, exchange is needed only if client cache should be created.
+ ClusterNode node = ctx.discovery().node(req.initiatingNodeId());
+
+ boolean clientReq = node != null &&
+ !ctx.discovery().cacheAffinityNode(node, req.cacheName());
- needExchange = ctx.discovery().addClientNode(req.cacheName(),
+ if (req.clientStartOnly()) {
+ needExchange = clientReq && ctx.discovery().addClientNode(req.cacheName(),
req.initiatingNodeId(),
req.nearCacheConfiguration() != null);
}
@@ -2488,12 +2494,6 @@ public class GridCacheProcessor extends GridProcessorAdapter {
"(a cache with the same name is already started): " + U.maskName(req.cacheName())));
}
else {
- // Cache already exists, exchange is needed only if client cache should be created.
- ClusterNode node = ctx.discovery().node(req.initiatingNodeId());
-
- boolean clientReq = node != null &&
- !ctx.discovery().cacheAffinityNode(node, req.cacheName());
-
needExchange = clientReq && ctx.discovery().addClientNode(req.cacheName(),
req.initiatingNodeId(),
req.nearCacheConfiguration() != null);