ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vkuliche...@apache.org
Subject [15/50] [abbrv] incubator-ignite git commit: #ignite-268: onUndeploy should be called one time for each cache.
Date Wed, 04 Mar 2015 01:31:45 GMT
#ignite-268: onUndeploy should be called one time for each cache.


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

Branch: refs/heads/master
Commit: 156e0c193517d83b87ad1d38bc703c65b73fae7c
Parents: bbf5163
Author: ivasilinets <ivasilinets@gridgain.com>
Authored: Mon Feb 16 15:33:06 2015 +0300
Committer: ivasilinets <ivasilinets@gridgain.com>
Committed: Mon Feb 16 15:33:06 2015 +0300

----------------------------------------------------------------------
 .../processors/cache/GridCacheAdapter.java      |  2 +-
 .../cache/GridCacheDeploymentManager.java       | 33 +++++++++-----------
 2 files changed, 16 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/156e0c19/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
index c86eed6..0082375 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
@@ -1211,7 +1211,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K,
V>,
      * @param ldr Class loader to undeploy.
      */
     public void onUndeploy(ClassLoader ldr) {
-        ctx.deploy().onUndeploy(ldr);
+        ctx.deploy().onUndeploy(ldr, context());
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/156e0c19/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheDeploymentManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheDeploymentManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheDeploymentManager.java
index 12cd679..c9467eb 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheDeploymentManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheDeploymentManager.java
@@ -205,35 +205,32 @@ public class GridCacheDeploymentManager<K, V> extends GridCacheSharedManagerAdap
      * Undeploys given class loader.
      *
      * @param ldr Class loader to undeploy.
+     * @param ctx Grid cache context.
      */
-    public void onUndeploy(final ClassLoader ldr) {
+    public void onUndeploy(final ClassLoader ldr, final GridCacheContext<K, V> ctx)
{
         assert ldr != null;
 
         if (log.isDebugEnabled())
             log.debug("Received onUndeploy() request [ldr=" + ldr + ", cctx=" + cctx + ']');
 
         synchronized (undeploys) {
-            for (final GridCacheContext<K, V> cacheCtx : cctx.cacheContexts()) {
-                List<CA> queue = undeploys.get(cacheCtx.name());
+            List<CA> queue = undeploys.get(ctx.name());
 
-                if (queue == null)
-                    undeploys.put(cacheCtx.name(), queue = new ArrayList<>());
+            if (queue == null)
+                undeploys.put(ctx.name(), queue = new ArrayList<>());
 
-                queue.add(new CA() {
-                    @Override
-                    public void apply() {
-                        onUndeploy0(ldr, cacheCtx);
-                    }
-                });
-            }
+            queue.add(new CA() {
+                @Override
+                public void apply() {
+                    onUndeploy0(ldr, ctx);
+                }
+            });
         }
 
-        for (GridCacheContext<K, V> cacheCtx : cctx.cacheContexts()) {
-            // Unwind immediately for local and replicate caches.
-            // We go through preloader for proper synchronization.
-            if (cacheCtx.isLocal())
-                cacheCtx.preloader().unwindUndeploys();
-        }
+        // Unwind immediately for local and replicate caches.
+        // We go through preloader for proper synchronization.
+        if (ctx.isLocal())
+            ctx.preloader().unwindUndeploys();
     }
 
     /**


Mime
View raw message