ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [20/22] incubator-ignite git commit: #ignite-738: Remove rebuildIndexes() method from CacheQueries.
Date Mon, 13 Apr 2015 17:34:07 GMT
#ignite-738: Remove rebuildIndexes() method from CacheQueries.


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

Branch: refs/heads/ignite-738
Commit: 9fdcf9e4aa6c69fad2cb8da563b93f7dc4028eb2
Parents: 761c6cd
Author: ivasilinets <ivasilinets@gridgain.com>
Authored: Mon Apr 13 19:57:19 2015 +0300
Committer: ivasilinets <ivasilinets@gridgain.com>
Committed: Mon Apr 13 19:57:19 2015 +0300

----------------------------------------------------------------------
 .../processors/cache/query/CacheQueries.java    | 26 --------------------
 .../cache/query/GridCacheQueriesImpl.java       | 15 -----------
 .../cache/query/GridCacheQueriesProxy.java      | 24 ------------------
 .../cache/GridCacheQueryCommandHandler.java     |  2 +-
 .../query/h2/GridH2IndexRebuildTest.java        | 10 ++++----
 5 files changed, 6 insertions(+), 71 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9fdcf9e4/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/CacheQueries.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/CacheQueries.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/CacheQueries.java
index 25b98ef..f8c38ad 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/CacheQueries.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/CacheQueries.java
@@ -63,32 +63,6 @@ public interface CacheQueries<K, V> {
     public CacheQuery<Map.Entry<K, V>> createScanQuery(@Nullable IgniteBiPredicate<K,
V> filter);
 
     /**
-     * Forces this cache to rebuild all search indexes of given value type. Sometimes indexes
-     * may hold references to objects that have already been removed from cache. Although
-     * not affecting query results, these objects may consume extra memory. Rebuilding
-     * indexes will remove any redundant references that may have temporarily got stuck
-     * inside in-memory index.
-     *
-     * @param cls Value type to rebuild indexes for.
-     *
-     * @return Future that will be completed when rebuilding of all indexes is finished.
-     */
-    public IgniteInternalFuture<?> rebuildIndexes(Class<?> cls);
-
-    /**
-     * Forces this cache to rebuild all search indexes of given value type. Sometimes indexes
-     * may hold references to objects that have already been removed from cache. Although
-     * not affecting query results, these objects may consume extra memory. Rebuilding
-     * indexes will remove any redundant references that may have temporarily got stuck
-     * inside in-memory index.
-     *
-     * @param typeName Value type name to rebuild indexes for.
-     *
-     * @return Future that will be completed when rebuilding of all indexes is finished.
-     */
-    public IgniteInternalFuture<?> rebuildIndexes(String typeName);
-
-    /**
      * Accumulated metrics for all queries executed for this cache.
      *
      * @return Cache query metrics.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9fdcf9e4/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueriesImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueriesImpl.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueriesImpl.java
index c456498..22fa43a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueriesImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueriesImpl.java
@@ -19,7 +19,6 @@ package org.apache.ignite.internal.processors.cache.query;
 
 import org.apache.ignite.*;
 import org.apache.ignite.cache.query.*;
-import org.apache.ignite.internal.*;
 import org.apache.ignite.internal.processors.cache.*;
 import org.apache.ignite.internal.util.typedef.internal.*;
 import org.apache.ignite.lang.*;
@@ -127,20 +126,6 @@ public class GridCacheQueriesImpl<K, V> implements GridCacheQueriesEx<K,
V> {
     }
 
     /** {@inheritDoc} */
-    @Override public IgniteInternalFuture<?> rebuildIndexes(Class<?> cls) {
-        A.notNull(cls, "cls");
-
-        return ctx.queries().rebuildIndexes(cls);
-    }
-
-    /** {@inheritDoc} */
-    @Override public IgniteInternalFuture<?> rebuildIndexes(String typeName) {
-        A.notNull("typeName", typeName);
-
-        return ctx.queries().rebuildIndexes(typeName);
-    }
-
-    /** {@inheritDoc} */
     @Override public QueryMetrics metrics() {
         return ctx.queries().metrics();
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9fdcf9e4/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueriesProxy.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueriesProxy.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueriesProxy.java
index 8b39ef2..da34602 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueriesProxy.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueriesProxy.java
@@ -150,30 +150,6 @@ public class GridCacheQueriesProxy<K, V> implements GridCacheQueriesEx<K,
V>, Ex
     }
 
     /** {@inheritDoc} */
-    @Override public IgniteInternalFuture<?> rebuildIndexes(Class<?> cls) {
-        GridCacheProjectionImpl<K, V> prev = gate.enter(prj);
-
-        try {
-            return delegate.rebuildIndexes(cls);
-        }
-        finally {
-            gate.leave(prev);
-        }
-    }
-
-    /** {@inheritDoc} */
-    @Override public IgniteInternalFuture<?> rebuildIndexes(String typeName) {
-        GridCacheProjectionImpl<K, V> prev = gate.enter(prj);
-
-        try {
-            return delegate.rebuildIndexes(typeName);
-        }
-        finally {
-            gate.leave(prev);
-        }
-    }
-
-    /** {@inheritDoc} */
     @Override public QueryMetrics metrics() {
         GridCacheProjectionImpl<K, V> prev = gate.enter(prj);
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9fdcf9e4/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/cache/GridCacheQueryCommandHandler.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/cache/GridCacheQueryCommandHandler.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/cache/GridCacheQueryCommandHandler.java
index f223328..f32efc3 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/cache/GridCacheQueryCommandHandler.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/cache/GridCacheQueryCommandHandler.java
@@ -373,7 +373,7 @@ public class GridCacheQueryCommandHandler extends GridRestCommandHandlerAdapter
             if (clsName == null)
                 ((IgniteKernal)g).context().query().rebuildAllIndexes();
             else
-                ((IgniteKernal)g).getCache(cacheName).queries().rebuildIndexes(clsName);
+                ((IgniteKernal)g).context().query().rebuildIndexes(cacheName, clsName);
 
             return null;
         }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9fdcf9e4/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/GridH2IndexRebuildTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/GridH2IndexRebuildTest.java
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/GridH2IndexRebuildTest.java
index feab20a..b8f1987 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/GridH2IndexRebuildTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/GridH2IndexRebuildTest.java
@@ -153,7 +153,7 @@ public class GridH2IndexRebuildTest extends GridCacheAbstractSelfTest
{
      * @throws Exception if failed.
      */
     public void testRebuildIndexes() throws Exception {
-        ((IgniteKernal)grid(0)).internalCache(null).queries().rebuildIndexes(ArrayList.class).get();
+        grid(0).context().query().rebuildIndexes(null, ArrayList.class.getName()).get();
 
         grid(0).context().query().rebuildAllIndexes().get();
 
@@ -186,8 +186,8 @@ public class GridH2IndexRebuildTest extends GridCacheAbstractSelfTest
{
             cache2.remove(ENTRY_CNT * 2 + i);
         }
 
-        ((IgniteKernal)grid(0)).internalCache(null).queries().rebuildIndexes(TestValue1.class).get();
-        ((IgniteKernal)grid(0)).internalCache(null).queries().rebuildIndexes(TestValue2.class).get();
+        grid(0).context().query().rebuildIndexes(null, TestValue1.class.getName()).get();
+        grid(0).context().query().rebuildIndexes(null, TestValue2.class.getName()).get();
 
         assertEquals(1, cache1.query(qry1).getAll().size());
         assertEquals(1, cache1.query(qry2).getAll().size());
@@ -216,13 +216,13 @@ public class GridH2IndexRebuildTest extends GridCacheAbstractSelfTest
{
         cache1.put(0, new TestValue1(0, "val0", 0 ,0));
         cache2.put(1, new TestValue2(0, "val0"));
 
-        checkCancel(((IgniteKernal)grid(0)).getCache(null).queries().rebuildIndexes("TestValue1"));
+        checkCancel(grid(0).context().query().rebuildIndexes(null, "TestValue1"));
 
         checkCancel(grid(0).context().query().rebuildAllIndexes());
 
         spi.sleepInRebuild = false;
 
-        final IgniteInternalFuture<?> fut1 = ((IgniteKernal)grid(0)).getCache(null).queries().rebuildIndexes(TestValue1.class);
+        final IgniteInternalFuture<?> fut1 = grid(0).context().query().rebuildIndexes(null,
TestValue1.class.getName());
 
         assertFalse(fut1.isCancelled());
 


Mime
View raw message