ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agoncha...@apache.org
Subject [7/7] incubator-ignite git commit: IGNITE-45 - Cache manager for tests.
Date Sat, 21 Mar 2015 05:45:06 GMT
IGNITE-45 - Cache manager for tests.


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

Branch: refs/heads/ignite-45
Commit: 77ca91c1c390804f1df92ebc22feb9526cac427f
Parents: a0b4a47
Author: Alexey Goncharuk <agoncharuk@gridgain.com>
Authored: Fri Mar 20 22:44:53 2015 -0700
Committer: Alexey Goncharuk <agoncharuk@gridgain.com>
Committed: Fri Mar 20 22:44:53 2015 -0700

----------------------------------------------------------------------
 .../org/apache/ignite/IgniteSystemProperties.java     |  7 +++++++
 .../java/org/apache/ignite/cache/CacheManager.java    | 14 +++++++-------
 2 files changed, 14 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/77ca91c1/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java b/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java
index d857756..c4b30d6 100644
--- a/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java
+++ b/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java
@@ -330,6 +330,13 @@ public final class IgniteSystemProperties {
     public static final String IGNITE_CACHE_CLIENT = "IGNITE_CACHE_CLIENT";
 
     /**
+     * Property controlling whether CacheManager will start grid with isolated IP finder
when default URL
+     * is passed in. This is needed to pass TCK tests which use default URL and assume isolated
cache managers
+     * for different class loaders.
+     */
+    public static final String IGNITE_JCACHE_DEFAULT_ISOLATED = "IGNITE_CACHE_CLIENT";
+
+    /**
      * Enforces singleton.
      */
     private IgniteSystemProperties() {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/77ca91c1/modules/core/src/main/java/org/apache/ignite/cache/CacheManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/CacheManager.java b/modules/core/src/main/java/org/apache/ignite/cache/CacheManager.java
index e2284c2..35658fe 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/CacheManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/CacheManager.java
@@ -24,7 +24,6 @@ import org.apache.ignite.internal.mxbean.*;
 import org.apache.ignite.internal.processors.cache.*;
 import org.apache.ignite.internal.util.typedef.internal.*;
 import org.apache.ignite.spi.discovery.tcp.*;
-import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
 import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
 import org.jetbrains.annotations.*;
 
@@ -36,6 +35,8 @@ import java.net.*;
 import java.util.*;
 import java.util.concurrent.atomic.*;
 
+import static org.apache.ignite.IgniteSystemProperties.*;
+
 /**
  * Implementation of JSR-107 {@link CacheManager}.
  */
@@ -67,9 +68,6 @@ public class CacheManager implements javax.cache.CacheManager {
     /** */
     private final GridKernalGateway kernalGateway;
 
-    /** */
-    private final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true); // TODO
IGNITE-45.
-
     /**
      * @param uri Uri.
      * @param cachingProvider Caching provider.
@@ -86,11 +84,13 @@ public class CacheManager implements javax.cache.CacheManager {
             if (uri.equals(cachingProvider.getDefaultURI())) {
                 IgniteConfiguration cfg = new IgniteConfiguration();
 
-                TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
+                if (getBoolean(IGNITE_JCACHE_DEFAULT_ISOLATED, true)) {
+                    TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
 
-                discoSpi.setIpFinder(IP_FINDER);
+                    discoSpi.setIpFinder(new TcpDiscoveryVmIpFinder(true));
 
-                cfg.setDiscoverySpi(discoSpi);
+                    cfg.setDiscoverySpi(discoSpi);
+                }
 
                 cfg.setGridName("CacheManager_" + igniteCnt.getAndIncrement());
 


Mime
View raw message