ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vkuliche...@apache.org
Subject [19/30] incubator-ignite git commit: ignite-sql-old - rename
Date Sun, 15 Feb 2015 08:03:00 GMT
ignite-sql-old - rename


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

Branch: refs/heads/ignite-nio
Commit: d026ccf6870542351be898e2eff0b32951cf8497
Parents: 8bc3518
Author: S.Vladykin <svladykin@gridgain.com>
Authored: Sat Feb 14 14:35:51 2015 +0300
Committer: S.Vladykin <svladykin@gridgain.com>
Committed: Sat Feb 14 14:35:51 2015 +0300

----------------------------------------------------------------------
 .../managers/indexing/GridIndexingManager.java  |  2 +-
 .../cache/query/GridCacheQueryManager.java      | 16 ++++-----
 .../processors/query/GridQueryIndexing.java     | 15 ++++++---
 .../processors/query/GridQueryProcessor.java    |  6 ++--
 .../spi/indexing/GridIndexingQueryFilter.java   | 34 --------------------
 .../ignite/spi/indexing/GridIndexingSpi.java    |  2 +-
 .../spi/indexing/GridNoopIndexingSpi.java       |  2 +-
 .../spi/indexing/IndexingQueryFilter.java       | 34 ++++++++++++++++++++
 .../IgniteTxExceptionAbstractSelfTest.java      |  3 +-
 .../processors/query/h2/IgniteH2Indexing.java   | 29 +++++++++++++----
 .../query/h2/opt/GridH2IndexBase.java           |  6 ++--
 .../query/h2/opt/GridH2TreeIndex.java           |  2 +-
 .../query/h2/opt/GridLuceneIndex.java           |  2 +-
 .../query/h2/twostep/GridMapQueryExecutor.java  |  2 +-
 14 files changed, 89 insertions(+), 66 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d026ccf6/modules/core/src/main/java/org/apache/ignite/internal/managers/indexing/GridIndexingManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/indexing/GridIndexingManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/managers/indexing/GridIndexingManager.java
index 4f674b5..f8caa9f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/indexing/GridIndexingManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/indexing/GridIndexingManager.java
@@ -140,7 +140,7 @@ public class GridIndexingManager extends GridManagerAdapter<GridIndexingSpi>
{
      * @throws IgniteCheckedException If failed.
      */
     @SuppressWarnings("unchecked")
-    public IgniteSpiCloseableIterator<?> query(String space, Collection<Object>
params, GridIndexingQueryFilter filters)
+    public IgniteSpiCloseableIterator<?> query(String space, Collection<Object>
params, IndexingQueryFilter filters)
         throws IgniteCheckedException {
         if (!enabled())
             throw new IgniteCheckedException("Indexing SPI is not configured.");

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d026ccf6/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 42a8aae..67c1208 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
@@ -1818,7 +1818,7 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
      * @return Filter.
      */
     @SuppressWarnings("unchecked")
-    @Nullable private GridIndexingQueryFilter projectionFilter(GridCacheQueryAdapter<?>
qry) {
+    @Nullable private IndexingQueryFilter projectionFilter(GridCacheQueryAdapter<?>
qry) {
         assert qry != null;
 
         final IgnitePredicate<Cache.Entry<Object, Object>> prjFilter = qry.projectionFilter();
@@ -1826,7 +1826,7 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
         if (prjFilter == null || F.isAlwaysTrue(prjFilter))
             return null;
 
-        return new GridIndexingQueryFilter() {
+        return new IndexingQueryFilter() {
             @Nullable @Override public IgniteBiPredicate<K, V> forSpace(String spaceName)
{
                 if (!F.eq(space, spaceName))
                     return null;
@@ -1854,11 +1854,11 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
      * @param includeBackups Include backups.
      */
     @SuppressWarnings("unchecked")
-    @Nullable public <K, V> GridIndexingQueryFilter backupsFilter(boolean includeBackups)
{
+    @Nullable public <K, V> IndexingQueryFilter backupsFilter(boolean includeBackups)
{
         if (includeBackups)
             return null;
 
-        return new GridIndexingQueryFilter() {
+        return new IndexingQueryFilter() {
             @Nullable @Override public IgniteBiPredicate<K, V> forSpace(final String
spaceName) {
                 final GridKernalContext ctx = cctx.kernalContext();
 
@@ -1880,7 +1880,7 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
      * @param qry Query.
      * @return Filter.
      */
-    private GridIndexingQueryFilter filter(GridCacheQueryAdapter<?> qry) {
+    private IndexingQueryFilter filter(GridCacheQueryAdapter<?> qry) {
         return and(backupsFilter(qry.includeBackups()), projectionFilter(qry));
     }
 
@@ -1889,15 +1889,15 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
      * @param f2 Second filter.
      * @return And filter of the given two.
      */
-    @Nullable private static GridIndexingQueryFilter and(@Nullable final GridIndexingQueryFilter
f1,
-        @Nullable final GridIndexingQueryFilter f2) {
+    @Nullable private static IndexingQueryFilter and(@Nullable final IndexingQueryFilter
f1,
+        @Nullable final IndexingQueryFilter f2) {
         if (f1 == null)
             return f2;
 
         if (f2 == null)
             return f1;
 
-        return new GridIndexingQueryFilter() {
+        return new IndexingQueryFilter() {
             @Nullable @Override public <K, V> IgniteBiPredicate<K, V> forSpace(String
spaceName) {
                 final IgniteBiPredicate<K, V> fltr1 = f1.forSpace(spaceName);
                 final IgniteBiPredicate<K, V> fltr2 = f2.forSpace(spaceName);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d026ccf6/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryIndexing.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryIndexing.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryIndexing.java
index 86b2869..6ec2f00 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryIndexing.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryIndexing.java
@@ -75,7 +75,7 @@ public interface GridQueryIndexing {
      * @throws IgniteCheckedException If failed.
      */
     public <K, V> GridQueryFieldsResult queryFields(@Nullable String spaceName, String
qry,
-        Collection<Object> params, GridIndexingQueryFilter filters) throws IgniteCheckedException;
+        Collection<Object> params, IndexingQueryFilter filters) throws IgniteCheckedException;
 
     /**
      * Executes regular query.
@@ -89,7 +89,7 @@ public interface GridQueryIndexing {
      * @throws IgniteCheckedException If failed.
      */
     public <K, V> GridCloseableIterator<IgniteBiTuple<K, V>> query(@Nullable
String spaceName, String qry,
-        Collection<Object> params, GridQueryTypeDescriptor type, GridIndexingQueryFilter
filters) throws IgniteCheckedException;
+        Collection<Object> params, GridQueryTypeDescriptor type, IndexingQueryFilter
filters) throws IgniteCheckedException;
 
     /**
      * Executes text query.
@@ -102,7 +102,7 @@ public interface GridQueryIndexing {
      * @throws IgniteCheckedException If failed.
      */
     public <K, V> GridCloseableIterator<IgniteBiTuple<K, V>> queryText(@Nullable
String spaceName, String qry,
-        GridQueryTypeDescriptor type, GridIndexingQueryFilter filters) throws IgniteCheckedException;
+        GridQueryTypeDescriptor type, IndexingQueryFilter filters) throws IgniteCheckedException;
 
     /**
      * Gets size of index for given type or -1 if it is a unknown type.
@@ -113,7 +113,7 @@ public interface GridQueryIndexing {
      * @return Objects number.
      * @throws IgniteCheckedException If failed.
      */
-    public long size(@Nullable String spaceName, GridQueryTypeDescriptor desc, GridIndexingQueryFilter
filters)
+    public long size(@Nullable String spaceName, GridQueryTypeDescriptor desc, IndexingQueryFilter
filters)
         throws IgniteCheckedException;
 
     /**
@@ -186,4 +186,11 @@ public interface GridQueryIndexing {
      * @param type Type descriptor.
      */
     public void rebuildIndexes(@Nullable String spaceName, GridQueryTypeDescriptor type);
+
+    /**
+     * Returns backup filter.
+     *
+     * @return Backup filter.
+     */
+    public IndexingQueryFilter backupFilter();
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d026ccf6/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 603ee8c..415f76d 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
@@ -419,7 +419,7 @@ public class GridQueryProcessor extends GridProcessorAdapter {
      */
     @SuppressWarnings("unchecked")
     public <K, V> GridCloseableIterator<IgniteBiTuple<K, V>> query(String
space, String clause,
-        Collection<Object> params, String resType, GridIndexingQueryFilter filters)
+        Collection<Object> params, String resType, IndexingQueryFilter filters)
         throws IgniteCheckedException {
         checkEnabled();
 
@@ -709,7 +709,7 @@ public class GridQueryProcessor extends GridProcessorAdapter {
      */
     @SuppressWarnings("unchecked")
     public <K, V> GridCloseableIterator<IgniteBiTuple<K, V>> queryText(String
space, String clause, String resType,
-        GridIndexingQueryFilter filters) throws IgniteCheckedException {
+        IndexingQueryFilter filters) throws IgniteCheckedException {
         checkEnabled();
 
         if (!busyLock.enterBusy())
@@ -737,7 +737,7 @@ public class GridQueryProcessor extends GridProcessorAdapter {
      * @throws IgniteCheckedException If failed.
      */
     public <K, V> GridQueryFieldsResult queryFields(@Nullable String space, String
clause, Collection<Object> params,
-        GridIndexingQueryFilter filters) throws IgniteCheckedException {
+        IndexingQueryFilter filters) throws IgniteCheckedException {
         checkEnabled();
 
         if (!busyLock.enterBusy())

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d026ccf6/modules/core/src/main/java/org/apache/ignite/spi/indexing/GridIndexingQueryFilter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/indexing/GridIndexingQueryFilter.java
b/modules/core/src/main/java/org/apache/ignite/spi/indexing/GridIndexingQueryFilter.java
deleted file mode 100644
index e8b4ed1..0000000
--- a/modules/core/src/main/java/org/apache/ignite/spi/indexing/GridIndexingQueryFilter.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.spi.indexing;
-
-import org.apache.ignite.lang.*;
-import org.jetbrains.annotations.*;
-
-/**
- * Cache entry filter.
- */
-public interface GridIndexingQueryFilter {
-    /**
-     * Creates optional predicate for space.
-     *
-     * @param spaceName Space name.
-     * @return Predicate or {@code null} if no filtering is needed.
-     */
-    @Nullable public <K, V> IgniteBiPredicate<K, V> forSpace(String spaceName);
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d026ccf6/modules/core/src/main/java/org/apache/ignite/spi/indexing/GridIndexingSpi.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/indexing/GridIndexingSpi.java
b/modules/core/src/main/java/org/apache/ignite/spi/indexing/GridIndexingSpi.java
index a02c51e..a508baf 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/indexing/GridIndexingSpi.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/indexing/GridIndexingSpi.java
@@ -68,7 +68,7 @@ public interface GridIndexingSpi extends IgniteSpi {
      * @throws IgniteSpiException If failed.
      */
     public Iterator<?> query(@Nullable String spaceName, Collection<Object> params,
-        @Nullable GridIndexingQueryFilter filters) throws IgniteSpiException;
+        @Nullable IndexingQueryFilter filters) throws IgniteSpiException;
 
     /**
      * Updates index. Note that key is unique for space, so if space contains multiple indexes

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d026ccf6/modules/core/src/main/java/org/apache/ignite/spi/indexing/GridNoopIndexingSpi.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/indexing/GridNoopIndexingSpi.java
b/modules/core/src/main/java/org/apache/ignite/spi/indexing/GridNoopIndexingSpi.java
index 7136cb2..760173f 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/indexing/GridNoopIndexingSpi.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/indexing/GridNoopIndexingSpi.java
@@ -29,7 +29,7 @@ import java.util.*;
 public class GridNoopIndexingSpi extends IgniteSpiAdapter implements GridIndexingSpi {
     /** {@inheritDoc} */
     @Override public Iterator<?> query(@Nullable String spaceName, Collection<Object>
params,
-        @Nullable GridIndexingQueryFilter filters) throws IgniteSpiException {
+        @Nullable IndexingQueryFilter filters) throws IgniteSpiException {
         throw new IgniteSpiException("You have to configure custom GridIndexingSpi implementation.");
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d026ccf6/modules/core/src/main/java/org/apache/ignite/spi/indexing/IndexingQueryFilter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/indexing/IndexingQueryFilter.java
b/modules/core/src/main/java/org/apache/ignite/spi/indexing/IndexingQueryFilter.java
new file mode 100644
index 0000000..9db8c20
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/spi/indexing/IndexingQueryFilter.java
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.spi.indexing;
+
+import org.apache.ignite.lang.*;
+import org.jetbrains.annotations.*;
+
+/**
+ * Cache entry filter.
+ */
+public interface IndexingQueryFilter {
+    /**
+     * Creates optional predicate for space.
+     *
+     * @param spaceName Space name.
+     * @return Predicate or {@code null} if no filtering is needed.
+     */
+    @Nullable public <K, V> IgniteBiPredicate<K, V> forSpace(String spaceName);
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d026ccf6/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteTxExceptionAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteTxExceptionAbstractSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteTxExceptionAbstractSelfTest.java
index 3d4cc56..c2d27d9 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteTxExceptionAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteTxExceptionAbstractSelfTest.java
@@ -22,7 +22,6 @@ import org.apache.ignite.cluster.*;
 import org.apache.ignite.configuration.*;
 import org.apache.ignite.internal.*;
 import org.apache.ignite.internal.processors.cache.distributed.near.*;
-import org.apache.ignite.internal.transactions.*;
 import org.apache.ignite.spi.*;
 import org.apache.ignite.spi.indexing.*;
 import org.apache.ignite.testframework.*;
@@ -601,7 +600,7 @@ public abstract class IgniteTxExceptionAbstractSelfTest extends GridCacheAbstrac
         }
 
         /** {@inheritDoc} */
-        @Override public Iterator<?> query(@Nullable String spaceName, Collection<Object>
params, @Nullable GridIndexingQueryFilter filters) throws IgniteSpiException {
+        @Override public Iterator<?> query(@Nullable String spaceName, Collection<Object>
params, @Nullable IndexingQueryFilter filters) throws IgniteSpiException {
             throw new UnsupportedOperationException();
         }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d026ccf6/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
index 7c9da55..069e10c 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
@@ -19,7 +19,6 @@ package org.apache.ignite.internal.processors.query.h2;
 
 import org.apache.ignite.*;
 import org.apache.ignite.cache.*;
-import org.apache.ignite.cache.query.*;
 import org.apache.ignite.cache.query.annotations.*;
 import org.apache.ignite.configuration.*;
 import org.apache.ignite.internal.*;
@@ -512,7 +511,7 @@ public class IgniteH2Indexing implements GridQueryIndexing {
     @SuppressWarnings("unchecked")
     @Override public <K, V> GridCloseableIterator<IgniteBiTuple<K, V>>
queryText(
         @Nullable String spaceName, String qry, GridQueryTypeDescriptor type,
-        GridIndexingQueryFilter filters) throws IgniteCheckedException {
+        IndexingQueryFilter filters) throws IgniteCheckedException {
         TableDescriptor tbl = tableDescriptor(spaceName, type);
 
         if (tbl != null && tbl.luceneIdx != null)
@@ -533,7 +532,7 @@ public class IgniteH2Indexing implements GridQueryIndexing {
     /** {@inheritDoc} */
     @SuppressWarnings("unchecked")
     @Override public <K, V> GridQueryFieldsResult queryFields(@Nullable final String
spaceName, final String qry,
-        @Nullable final Collection<Object> params, final GridIndexingQueryFilter filters)
+        @Nullable final Collection<Object> params, final IndexingQueryFilter filters)
         throws IgniteCheckedException {
         setFilters(filters);
 
@@ -734,7 +733,7 @@ public class IgniteH2Indexing implements GridQueryIndexing {
     @SuppressWarnings("unchecked")
     @Override public <K, V> GridCloseableIterator<IgniteBiTuple<K, V>>
query(@Nullable String spaceName,
         final String qry, @Nullable final Collection<Object> params, GridQueryTypeDescriptor
type,
-        final GridIndexingQueryFilter filters) throws IgniteCheckedException {
+        final IndexingQueryFilter filters) throws IgniteCheckedException {
         final TableDescriptor tbl = tableDescriptor(spaceName, type);
 
         if (tbl == null)
@@ -778,7 +777,7 @@ public class IgniteH2Indexing implements GridQueryIndexing {
      *
      * @param filters Filters.
      */
-    public void setFilters(@Nullable GridIndexingQueryFilter filters) {
+    public void setFilters(@Nullable IndexingQueryFilter filters) {
         GridH2IndexBase.setFiltersForThread(filters);
     }
 
@@ -1093,7 +1092,7 @@ public class IgniteH2Indexing implements GridQueryIndexing {
 
     /** {@inheritDoc} */
     @Override public long size(@Nullable String spaceName, GridQueryTypeDescriptor type,
-        GridIndexingQueryFilter filters) throws IgniteCheckedException {
+        IndexingQueryFilter filters) throws IgniteCheckedException {
         TableDescriptor tbl = tableDescriptor(spaceName, type);
 
         if (tbl == null)
@@ -1381,6 +1380,24 @@ public class IgniteH2Indexing implements GridQueryIndexing {
         return offheap == null ? -1 : offheap.allocatedSize();
     }
 
+    /** {@inheritDoc} */
+    @Override public IndexingQueryFilter backupFilter() {
+        return new IndexingQueryFilter() {
+            @Nullable @Override public <K, V> IgniteBiPredicate<K, V> forSpace(String
spaceName) {
+                final GridCacheAdapter<Object, Object> cache = ctx.cache().internalCache(spaceName);
+
+                if (cache.context().isReplicated() || cache.configuration().getBackups()
== 0)
+                    return null;
+
+                return new IgniteBiPredicate<K, V>() {
+                    @Override public boolean apply(K k, V v) {
+                        return cache.context().affinity().primary(ctx.discovery().localNode(),
k, -1);
+                    }
+                };
+            }
+        };
+    }
+
     /**
      * @param spaceName Space name.
      */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d026ccf6/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2IndexBase.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2IndexBase.java
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2IndexBase.java
index 1c5fabf..1b076f0 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2IndexBase.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2IndexBase.java
@@ -34,7 +34,7 @@ import java.util.*;
  */
 public abstract class GridH2IndexBase extends BaseIndex {
     /** */
-    protected static final ThreadLocal<GridIndexingQueryFilter> filters = new ThreadLocal<>();
+    protected static final ThreadLocal<IndexingQueryFilter> filters = new ThreadLocal<>();
 
     /** */
     protected final int keyCol;
@@ -56,7 +56,7 @@ public abstract class GridH2IndexBase extends BaseIndex {
      *
      * @param fs Filters.
      */
-    public static void setFiltersForThread(GridIndexingQueryFilter fs) {
+    public static void setFiltersForThread(IndexingQueryFilter fs) {
         if (fs == null)
             filters.remove();
         else
@@ -115,7 +115,7 @@ public abstract class GridH2IndexBase extends BaseIndex {
     protected Iterator<GridH2Row> filter(Iterator<GridH2Row> iter) {
         IgniteBiPredicate<Object, Object> p = null;
 
-        GridIndexingQueryFilter f = filters.get();
+        IndexingQueryFilter f = filters.get();
 
         if (f != null) {
             String spaceName = ((GridH2Table)getTable()).spaceName();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d026ccf6/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2TreeIndex.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2TreeIndex.java
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2TreeIndex.java
index fb272e5..7528498 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2TreeIndex.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2TreeIndex.java
@@ -169,7 +169,7 @@ public class GridH2TreeIndex extends GridH2IndexBase implements Comparator<GridS
 
     /** {@inheritDoc} */
     @Override public long getRowCount(@Nullable Session ses) {
-        GridIndexingQueryFilter f = filters.get();
+        IndexingQueryFilter f = filters.get();
 
         // Fast path if we don't need to perform any filtering.
         if (f == null || f.forSpace(((GridH2Table)getTable()).spaceName()) == null)

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d026ccf6/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridLuceneIndex.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridLuceneIndex.java
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridLuceneIndex.java
index 740061c..559f18e 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridLuceneIndex.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridLuceneIndex.java
@@ -223,7 +223,7 @@ public class GridLuceneIndex implements Closeable {
      * @throws IgniteCheckedException If failed.
      */
     public <K, V> GridCloseableIterator<IgniteBiTuple<K, V>> query(String
qry,
-        GridIndexingQueryFilter filters) throws IgniteCheckedException {
+        IndexingQueryFilter filters) throws IgniteCheckedException {
         IndexReader reader;
 
         try {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d026ccf6/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java
index f5e19b7..6030cda 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java
@@ -105,7 +105,7 @@ public class GridMapQueryExecutor {
      * @param req Query request.
      */
     private void executeLocalQuery(ClusterNode node, GridQueryRequest req) {
-        h2.setFilters(new GridIndexingQueryFilter() {
+        h2.setFilters(new IndexingQueryFilter() {
             @Nullable @Override public <K, V> IgniteBiPredicate<K, V> forSpace(String
spaceName) {
                 final GridCacheAdapter<Object, Object> cache = ctx.cache().internalCache(spaceName);
 


Mime
View raw message