ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject [62/71] [abbrv] ignite git commit: IGNITE-4840: Removed unnecessary GridQueryProcessor.onUndeploy() method what will significantly simplify types concurrency.
Date Tue, 21 Mar 2017 09:24:53 GMT
IGNITE-4840: Removed unnecessary GridQueryProcessor.onUndeploy() method what will significantly
simplify types concurrency.


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

Branch: refs/heads/master
Commit: ea8c95ae7d7f8775b99edd61aa57c66d1b4b7f22
Parents: 09f64e5
Author: devozerov <vozerov@gridgain.com>
Authored: Mon Mar 20 13:27:03 2017 +0300
Committer: devozerov <vozerov@gridgain.com>
Committed: Mon Mar 20 13:27:03 2017 +0300

----------------------------------------------------------------------
 .../cache/GridCacheDeploymentManager.java       |  6 ---
 .../cache/query/GridCacheQueryManager.java      | 22 -----------
 .../processors/query/GridQueryProcessor.java    | 41 --------------------
 .../cache/CacheIndexingOffheapCleanupTest.java  | 21 ----------
 4 files changed, 90 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/ea8c95ae/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 30a7302..39a7b36 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
@@ -39,7 +39,6 @@ import org.apache.ignite.internal.managers.deployment.GridDeploymentInfo;
 import org.apache.ignite.internal.managers.deployment.GridDeploymentInfoBean;
 import org.apache.ignite.internal.managers.eventstorage.GridLocalEventListener;
 import org.apache.ignite.internal.processors.cache.distributed.near.GridNearCacheAdapter;
-import org.apache.ignite.internal.processors.cache.query.GridCacheQueryManager;
 import org.apache.ignite.internal.util.IgniteUtils;
 import org.apache.ignite.internal.util.lang.GridPeerDeployAware;
 import org.apache.ignite.internal.util.tostring.GridToStringInclude;
@@ -268,11 +267,6 @@ public class GridCacheDeploymentManager<K, V> extends GridCacheSharedManagerAdap
         if (cacheCtx.isNear())
             cacheCtx.near().dht().clearLocally(keys, true);
 
-        GridCacheQueryManager<K, V> qryMgr = cacheCtx.queries();
-
-        if (qryMgr != null)
-            qryMgr.onUndeploy(ldr);
-
         // Examine swap for entries to undeploy.
         int swapUndeployCnt = cacheCtx.isNear() ?
             cacheCtx.near().dht().context().swap().onUndeploy(ldr) :

http://git-wip-us.apache.org/repos/asf/ignite/blob/ea8c95ae/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
index de9cabe..546be37 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
@@ -509,28 +509,6 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
     }
 
     /**
-     * Undeploys given class loader.
-     *
-     * @param ldr Class loader to undeploy.
-     */
-    public void onUndeploy(ClassLoader ldr) {
-        if (!enterBusy())
-            return; // Ignore index update when node is stopping.
-
-        try {
-            qryProc.onUndeploy(space, ldr);
-        }
-        catch (IgniteCheckedException e) {
-            throw new IgniteException(e);
-        }
-        finally {
-            invalidateResultCache();
-
-            leaveBusy();
-        }
-    }
-
-    /**
      * Executes local query.
      *
      * @param qry Query.

http://git-wip-us.apache.org/repos/asf/ignite/blob/ea8c95ae/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
index 219373c..a58ca53 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
@@ -764,47 +764,6 @@ public class GridQueryProcessor extends GridProcessorAdapter {
     }
 
     /**
-     * Removes index tables for all classes belonging to given class loader.
-     *
-     * @param space Space name.
-     * @param ldr Class loader to undeploy.
-     * @throws IgniteCheckedException If undeploy failed.
-     */
-    public void onUndeploy(@Nullable String space, ClassLoader ldr) throws IgniteCheckedException
{
-        if (log.isDebugEnabled())
-            log.debug("Undeploy [space=" + space + "]");
-
-        if (idx == null)
-            return;
-
-        if (!busyLock.enterBusy())
-            throw new IllegalStateException("Failed to process undeploy event (grid is stopping).");
-
-        try {
-            Iterator<Map.Entry<QueryTypeIdKey, QueryTypeDescriptorImpl>> it =
types.entrySet().iterator();
-
-            while (it.hasNext()) {
-                Map.Entry<QueryTypeIdKey, QueryTypeDescriptorImpl> e = it.next();
-
-                if (!F.eq(e.getKey().space(), space))
-                    continue;
-
-                QueryTypeDescriptorImpl desc = e.getValue();
-
-                if (ldr.equals(U.detectClassLoader(desc.valueClass())) ||
-                    ldr.equals(U.detectClassLoader(desc.keyClass()))) {
-                    idx.unregisterType(e.getKey().space(), desc);
-
-                    it.remove();
-                }
-            }
-        }
-        finally {
-            busyLock.leaveBusy();
-        }
-    }
-
-    /**
      * Gets types for space.
      *
      * @param space Space name.

http://git-wip-us.apache.org/repos/asf/ignite/blob/ea8c95ae/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheIndexingOffheapCleanupTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheIndexingOffheapCleanupTest.java
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheIndexingOffheapCleanupTest.java
index 3d7e30a..70c0d49 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheIndexingOffheapCleanupTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheIndexingOffheapCleanupTest.java
@@ -26,7 +26,6 @@ import org.apache.ignite.cache.query.annotations.QueryTextField;
 import org.apache.ignite.configuration.CacheConfiguration;
 import org.apache.ignite.internal.IgniteKernal;
 import org.apache.ignite.internal.util.offheap.unsafe.GridUnsafeMemory;
-import org.apache.ignite.internal.util.typedef.internal.U;
 import org.apache.ignite.testframework.GridTestUtils;
 import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
 
@@ -93,26 +92,6 @@ public class CacheIndexingOffheapCleanupTest extends GridCommonAbstractTest
{
     }
 
     /**
-     * @throws Exception If failed.
-     */
-    public void testUndeploy() throws Exception {
-        Ignite ignite = ignite(0);
-
-        IgniteCache cache = ignite.createCache(cacheConfiguration());
-
-        for (int k = 0; k < 100; k++)
-            cache.put(k, new TestType());
-
-        GridUnsafeMemory mem = schemaMemory(ignite, cache.getName());
-
-        assertTrue(mem.allocatedSize() > 0);
-
-        ((IgniteKernal)ignite).context().query().onUndeploy("cache", U.detectClassLoader(TestType.class));
-
-        assertEquals(0, mem.allocatedSize());
-    }
-
-    /**
      * @param ignite Node.
      * @param cacheName Cache name.
      * @return Memory.


Mime
View raw message