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 745F6176CB for ; Thu, 9 Apr 2015 12:34:20 +0000 (UTC) Received: (qmail 1197 invoked by uid 500); 9 Apr 2015 12:34:17 -0000 Delivered-To: apmail-ignite-commits-archive@ignite.apache.org Received: (qmail 1169 invoked by uid 500); 9 Apr 2015 12:34:17 -0000 Mailing-List: contact commits-help@ignite.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.incubator.apache.org Delivered-To: mailing list commits@ignite.incubator.apache.org Received: (qmail 1076 invoked by uid 99); 9 Apr 2015 12:34:17 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Apr 2015 12:34:17 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO mail.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with SMTP; Thu, 09 Apr 2015 12:34:16 +0000 Received: (qmail 99623 invoked by uid 99); 9 Apr 2015 12:33:53 -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; Thu, 09 Apr 2015 12:33:53 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 6AD38DFFCD; Thu, 9 Apr 2015 12:33:53 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sboikov@apache.org To: commits@ignite.incubator.apache.org Date: Thu, 09 Apr 2015 12:34:13 -0000 Message-Id: <28b381752031405fa6d3a42d4296fd37@git.apache.org> In-Reply-To: <44c6697d259e4f499b0c726d244dbe09@git.apache.org> References: <44c6697d259e4f499b0c726d244dbe09@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [22/50] [abbrv] incubator-ignite git commit: # Minor fix to cache object processor. X-Virus-Checked: Checked by ClamAV on apache.org # Minor fix to cache object processor. Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/7eef373a Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/7eef373a Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/7eef373a Branch: refs/heads/ignite-80 Commit: 7eef373aa8ba17561c9d89dfbc6c0af8bbc23ec9 Parents: 71439bc Author: vozerov-gridgain Authored: Wed Apr 8 17:54:56 2015 +0300 Committer: vozerov-gridgain Committed: Wed Apr 8 17:55:49 2015 +0300 ---------------------------------------------------------------------- .../java/org/apache/ignite/internal/IgniteKernal.java | 11 ++++++++++- .../internal/processors/cache/GridCacheProcessor.java | 11 ++++++----- 2 files changed, 16 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7eef373a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java index 88bec0f..768bbd3 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java @@ -2240,10 +2240,19 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable { /** {@inheritDoc} */ @Override public IgniteCache cache(@Nullable String name) { + return cache(name, true); + } + + /** + * @param name Cache name. + * @param failIfSys Fail if requestsed cache is system cache. + * @return Cache. + */ + public IgniteCache cache(@Nullable String name, boolean failIfSys) { guard(); try { - return ctx.cache().publicJCache(name); + return ctx.cache().publicJCache(name, true, failIfSys); } catch (IgniteCheckedException e) { throw CU.convertToCacheException(e); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7eef373a/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 fcf65b9..35cfd0c 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 @@ -1713,7 +1713,7 @@ public class GridCacheProcessor extends GridProcessorAdapter { */ public IgniteInternalFuture dynamicStartCache(String cacheName) { try { - if (publicJCache(cacheName, false) != null) // Cache with given name already started. + if (publicJCache(cacheName, false, true) != null) // Cache with given name already started. return new GridFinishedFuture<>(); CacheConfiguration cfgTemplate = null; @@ -2483,21 +2483,22 @@ public class GridCacheProcessor extends GridProcessorAdapter { * @throws IgniteCheckedException If failed. */ public IgniteCache publicJCache(@Nullable String cacheName) throws IgniteCheckedException { - return publicJCache(cacheName, true); + return publicJCache(cacheName, true, true); } /** * @param cacheName Cache name. * @param failIfNotStarted If {@code true} throws {@link IllegalArgumentException} if cache is not started, * otherwise returns {@code null} in this case. + * @param failIfSys Fail is cache is system. * @param type of keys. * @param type of values. * @return Cache instance for given name. * @throws IgniteCheckedException If failed. */ @SuppressWarnings("unchecked") - @Nullable private IgniteCache publicJCache(@Nullable String cacheName, boolean failIfNotStarted) - throws IgniteCheckedException + @Nullable public IgniteCache publicJCache(@Nullable String cacheName, boolean failIfNotStarted, + boolean failIfSys) throws IgniteCheckedException { if (log.isDebugEnabled()) log.debug("Getting public cache for name: " + cacheName); @@ -2508,7 +2509,7 @@ public class GridCacheProcessor extends GridProcessorAdapter { DynamicCacheDescriptor desc = registeredCaches.get(masked); - if (desc != null && !desc.cacheType().userCache()) + if (desc != null && !desc.cacheType().userCache() && failIfSys) throw new IllegalStateException("Failed to get cache because it is a system cache: " + cacheName); if (cache == null) {