Return-Path: X-Original-To: apmail-ignite-commits-archive@minotaur.apache.org Delivered-To: apmail-ignite-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C349510494 for ; Tue, 8 Sep 2015 17:08:58 +0000 (UTC) Received: (qmail 64230 invoked by uid 500); 8 Sep 2015 17:08:52 -0000 Delivered-To: apmail-ignite-commits-archive@ignite.apache.org Received: (qmail 64147 invoked by uid 500); 8 Sep 2015 17:08:52 -0000 Mailing-List: contact commits-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.apache.org Delivered-To: mailing list commits@ignite.apache.org Received: (qmail 63739 invoked by uid 99); 8 Sep 2015 17:08:52 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Sep 2015 17:08:52 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id F1883E0772; Tue, 8 Sep 2015 17:08:51 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: agoncharuk@apache.org To: commits@ignite.apache.org Date: Tue, 08 Sep 2015 17:09:01 -0000 Message-Id: <49454aa3010b4fa09001bb5aeeb8490f@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [11/45] ignite git commit: Partial fix for ignite-1355 to avoid errors in tests setup. 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-264 Commit: 02fc057ee885ef70ed645d993d7e3cd7488d3888 Parents: bbfee45 Author: sboikov Authored: Tue Sep 8 10:38:01 2015 +0300 Committer: sboikov 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.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())); }