ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agoncha...@apache.org
Subject [2/2] incubator-ignite git commit: IGNITE-45 - Fixing tests.
Date Fri, 20 Mar 2015 00:39:38 GMT
IGNITE-45 - Fixing 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/2fd6e260
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/2fd6e260
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/2fd6e260

Branch: refs/heads/ignite-45
Commit: 2fd6e2608a29c6e456909b2768fd734ad202750d
Parents: 932c606
Author: Alexey Goncharuk <agoncharuk@gridgain.com>
Authored: Thu Mar 19 17:39:32 2015 -0700
Committer: Alexey Goncharuk <agoncharuk@gridgain.com>
Committed: Thu Mar 19 17:39:32 2015 -0700

----------------------------------------------------------------------
 .../org/apache/ignite/cache/CacheManager.java     | 18 +++++++++++++++++-
 .../processors/cache/GridCacheProcessor.java      |  4 ++--
 .../continuous/CacheContinuousQueryManager.java   | 14 ++++----------
 3 files changed, 23 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2fd6e260/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 83443b3..a699229 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
@@ -23,6 +23,9 @@ import org.apache.ignite.internal.*;
 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.*;
 
 import javax.cache.*;
@@ -64,6 +67,9 @@ 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.
@@ -80,6 +86,12 @@ public class CacheManager implements javax.cache.CacheManager {
             if (uri.equals(cachingProvider.getDefaultURI())) {
                 IgniteConfiguration cfg = new IgniteConfiguration();
 
+                TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
+
+                discoSpi.setIpFinder(IP_FINDER);
+
+                cfg.setDiscoverySpi(discoSpi);
+
                 cfg.setGridName("CacheManager_" + igniteCnt.getAndIncrement());
 
                 ignite = (IgniteKernal)IgnitionEx.start(cfg);
@@ -248,8 +260,12 @@ public class CacheManager implements javax.cache.CacheManager {
         try {
             IgniteCache<?, ?> cache = getCache0(cacheName);
 
-            if (cache != null)
+            if (cache != null) {
+                unregisterCacheObject(cacheName, CACHE_CONFIGURATION);
+                unregisterCacheObject(cacheName, CACHE_STATISTICS);
+
                 cache.close();
+            }
         }
         finally {
             kernalGateway.readUnlock();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2fd6e260/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 7c0a581..024edd7 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
@@ -1322,10 +1322,10 @@ public class GridCacheProcessor extends GridProcessorAdapter {
 
             sharedCtx.addCacheContext(cacheCtx);
 
+            caches.put(maskNull(cacheCtx.name()), cacheCtx.cache());
+
             startCache(cacheCtx.cache());
             onKernalStart(cacheCtx.cache());
-
-            caches.put(maskNull(cacheCtx.name()), cacheCtx.cache());
         }
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2fd6e260/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryManager.java
index 689898d..37305d9 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryManager.java
@@ -29,7 +29,6 @@ import org.apache.ignite.plugin.security.*;
 import org.apache.ignite.resources.*;
 import org.jdk8.backport.*;
 
-import javax.cache.*;
 import javax.cache.configuration.*;
 import javax.cache.event.*;
 import java.io.*;
@@ -568,7 +567,7 @@ public class CacheContinuousQueryManager extends GridCacheManagerAdapter
{
 
             CacheEntryUpdatedListener locLsnr = new JCacheQueryLocalListener(
                 locLsnrImpl,
-                cctx.kernalContext().cache().jcache(cctx.name()));
+                log);
 
             CacheEntryEventFilter rmtFilter = new JCacheQueryRemoteFilter(
                 cfg.getCacheEntryEventFilterFactory() != null ? (CacheEntryEventFilter)cfg.getCacheEntryEventFilterFactory().create()
: null,
@@ -609,23 +608,18 @@ public class CacheContinuousQueryManager extends GridCacheManagerAdapter
{
         private final CacheEntryListener<K, V> impl;
 
         /** */
-        private final Cache<K, V> cache;
-
-        /** */
         private final IgniteLogger log;
 
         /**
          * @param impl Listener.
-         * @param cache Cache.
          */
-        JCacheQueryLocalListener(CacheEntryListener<K, V> impl, Cache<K, V> cache)
{
+        JCacheQueryLocalListener(CacheEntryListener<K, V> impl, IgniteLogger log) {
             assert impl != null;
-            assert cache != null;
+            assert log != null;
 
             this.impl = impl;
-            this.cache = cache;
 
-            log = cache.unwrap(Ignite.class).log().getLogger(CacheContinuousQueryManager.class);
+            this.log = log;
         }
 
         /** {@inheritDoc} */


Mime
View raw message