ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akuznet...@apache.org
Subject [11/50] [abbrv] incubator-ignite git commit: #ignite-51: fix GridCacheDeploymentSelfTest.
Date Wed, 11 Mar 2015 11:07:43 GMT
#ignite-51: fix GridCacheDeploymentSelfTest.


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

Branch: refs/heads/ignite-368
Commit: 25b7c8aeac211a934488f6a4b124cb08a8d8aad2
Parents: bd83393
Author: ivasilinets <vasilinetc.ira@gmail.com>
Authored: Sun Mar 8 18:40:06 2015 +0300
Committer: ivasilinets <vasilinetc.ira@gmail.com>
Committed: Sun Mar 8 18:40:06 2015 +0300

----------------------------------------------------------------------
 .../cache/GridCacheDeploymentManager.java       | 38 ++++++--------------
 1 file changed, 11 insertions(+), 27 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/25b7c8ae/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 8485f28..23f457a 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
@@ -240,24 +240,26 @@ public class GridCacheDeploymentManager<K, V> extends GridCacheSharedManagerAdap
     private void onUndeploy0(final ClassLoader ldr, final GridCacheContext<K, V> cacheCtx)
{
         GridCacheAdapter<K, V> cache = cacheCtx.cache();
 
-        Collection<KeyCacheObject> keys = new ArrayList<>();
+        Collection<K> keys = new ArrayList<>();
 
-        for (GridCacheEntryEx e : cache.entries()) {
+        for (Cache.Entry<K, V> e : cache.entrySet()) {
             boolean undeploy = cacheCtx.isNear() ?
                 undeploy(ldr, e, cacheCtx.near()) || undeploy(ldr, e, cacheCtx.near().dht())
:
                 undeploy(ldr, e, cacheCtx.cache());
 
             if (undeploy)
-                keys.add(e.key());
+                keys.add(e.getKey());
         }
 
         if (log.isDebugEnabled())
             log.debug("Finished searching keys for undeploy [keysCnt=" + keys.size() + ']');
 
-        cache.clearLocally(keys, true);
+        for (K k : keys)
+            cache.clearLocally(k);
 
         if (cacheCtx.isNear())
-            cacheCtx.near().dht().clearLocally(keys, true);
+            for (K k : keys)
+                cacheCtx.near().dht().clearLocally(k);
 
         GridCacheQueryManager<K, V> qryMgr = cacheCtx.queries();
 
@@ -293,31 +295,13 @@ public class GridCacheDeploymentManager<K, V> extends GridCacheSharedManagerAdap
      * @param cache Cache.
      * @return {@code True} if need to undeploy.
      */
-    private boolean undeploy(ClassLoader ldr, GridCacheEntryEx e, GridCacheAdapter cache)
{
-        KeyCacheObject key = e.key();
-
-        GridCacheEntryEx entry = cache.peekEx(key);
-
-        if (entry == null)
-            return false;
-
-        CacheObject v;
-
-        try {
-            v = entry.peek(GridCachePeekMode.GLOBAL, CU.empty0());
-        }
-        catch (GridCacheEntryRemovedException ignore) {
+    private boolean undeploy(ClassLoader ldr, Cache.Entry<K, V> e, GridCacheAdapter
cache) {
+        if (e == null)
             return false;
-        }
-        catch (IgniteException ignore) {
-            // Peek can throw runtime exception if unmarshalling failed.
-            return true;
-        }
 
-        assert key != null : "Key cannot be null for cache entry: " + e;
+        K key0 = e.getKey();
 
-        Object key0 = key.value(cache.context().cacheObjectContext(), false);
-        Object val0 = CU.value(v, cache.context(), false);
+        V val0 = e.getValue();
 
         ClassLoader keyLdr = U.detectObjectClassLoader(key0);
         ClassLoader valLdr = U.detectObjectClassLoader(val0);


Mime
View raw message