Repository: ignite Updated Branches: refs/heads/ignite-1.4 97fe836b9 -> 5264ec738
Partial fix for ignite-1355 to avoid errors in tests setup. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/02fc057e Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/02fc057e Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/02fc057e Branch: refs/heads/ignite-1.4 Commit: 02fc057ee885ef70ed645d993d7e3cd7488d3888 Parents: bbfee45 Author: sboikov <[email protected]> Authored: Tue Sep 8 10:38:01 2015 +0300 Committer: sboikov <[email protected]> Committed: Tue Sep 8 10:38:01 2015 +0300 ---------------------------------------------------------------------- .../internal/processors/affinity/GridAffinityProcessor.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/02fc057e/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityProcessor.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityProcessor.java index 090aca0..8f66dc1 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityProcessor.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityProcessor.java @@ -296,7 +296,7 @@ public class GridAffinityProcessor extends GridProcessorAdapter { * @throws IgniteCheckedException In case of error. */ @SuppressWarnings("ErrorNotRethrown") - private AffinityInfo affinityCache(@Nullable final String cacheName, AffinityTopologyVersion topVer) + @Nullable private AffinityInfo affinityCache(@Nullable final String cacheName, AffinityTopologyVersion topVer) throws IgniteCheckedException { AffinityAssignmentKey key = new AffinityAssignmentKey(cacheName, topVer); @@ -879,7 +879,9 @@ public class GridAffinityProcessor extends GridProcessorAdapter { ctx.gateway().readLock(); try { - return cache().assignment().get(part); + AffinityInfo cache = cache(); + + return cache != null ? cache.assignment().get(part) : Collections.<ClusterNode>emptyList(); } catch (IgniteCheckedException e) { throw new IgniteException(e); @@ -893,7 +895,7 @@ public class GridAffinityProcessor extends GridProcessorAdapter { * @return Affinity info for current topology version. * @throws IgniteCheckedException If failed. */ - private AffinityInfo cache() throws IgniteCheckedException { + @Nullable private AffinityInfo cache() throws IgniteCheckedException { return affinityCache(cacheName, new AffinityTopologyVersion(topologyVersion())); }
