ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject [26/45] incubator-ignite git commit: #ignite-738: rename GridCacheQueriesEx to CacheQueries.
Date Thu, 16 Apr 2015 12:33:47 GMT
#ignite-738: rename GridCacheQueriesEx to 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/0920bcfe
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/0920bcfe
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/0920bcfe

Branch: refs/heads/ignite-gg-9613
Commit: 0920bcfeda1dc49a50f20fb889af280e2d552c0c
Parents: 540299b
Author: ivasilinets <ivasilinets@gridgain.com>
Authored: Tue Apr 14 10:23:56 2015 +0300
Committer: ivasilinets <ivasilinets@gridgain.com>
Committed: Tue Apr 14 10:23:56 2015 +0300

----------------------------------------------------------------------
 .../apache/ignite/cache/query/QueryMetrics.java |   2 +-
 .../processors/cache/CacheProjection.java       |   2 +-
 .../processors/cache/GridCacheAdapter.java      |   6 +-
 .../cache/GridCacheProjectionImpl.java          |   8 +-
 .../processors/cache/GridCacheProxyImpl.java    |   8 +-
 .../processors/cache/IgniteCacheProxy.java      |   2 +-
 .../processors/cache/query/CacheQueries.java    | 103 ++++++++++
 .../cache/query/CacheQueriesImpl.java           | 150 ++++++++++++++
 .../cache/query/CacheQueriesProxy.java          | 200 ++++++++++++++++++
 .../processors/cache/query/CacheQuery.java      |   4 +-
 .../cache/query/GridCacheQueriesEx.java         | 103 ----------
 .../cache/query/GridCacheQueriesImpl.java       | 150 --------------
 .../cache/query/GridCacheQueriesProxy.java      | 201 -------------------
 .../jdbc/GridCacheQueryJdbcMetadataTask.java    |   2 +-
 .../visor/cache/VisorCacheMetadataTask.java     |   2 +-
 .../GridCacheAbstractFieldsQuerySelfTest.java   |  14 +-
 .../cache/GridCacheCrossCacheQuerySelfTest.java |  10 +-
 17 files changed, 482 insertions(+), 485 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0920bcfe/modules/core/src/main/java/org/apache/ignite/cache/query/QueryMetrics.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/query/QueryMetrics.java b/modules/core/src/main/java/org/apache/ignite/cache/query/QueryMetrics.java
index e7518bf..d178fe0 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/query/QueryMetrics.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/query/QueryMetrics.java
@@ -22,7 +22,7 @@ import org.apache.ignite.internal.processors.cache.query.*;
 /**
  * Cache query metrics used to obtain statistics on query. You can get metrics for
  * particular query via {@link CacheQuery#metrics()} method or accumulated metrics
- * for all queries via {@link GridCacheQueriesEx#metrics()}.
+ * for all queries via {@link CacheQueries#metrics()}.
  */
 public interface QueryMetrics {
     /**

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0920bcfe/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheProjection.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheProjection.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheProjection.java
index 4499281..87af7fa 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheProjection.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheProjection.java
@@ -205,7 +205,7 @@ public interface CacheProjection<K, V> extends Iterable<Cache.Entry<K, V>> {
 
      * @return Queries facade responsible for creating various SQL, TEXT, or SCAN queries.
      */
-    public GridCacheQueriesEx<K, V> queries();
+    public CacheQueries<K, V> queries();
 
     /**
      * @param skipStore Skip store flag.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0920bcfe/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 19513ae..71d3c0d 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
@@ -170,7 +170,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>,
     protected IgniteLogger log;
 
     /** Queries impl. */
-    private GridCacheQueriesEx<K, V> qry;
+    private CacheQueries<K, V> qry;
 
     /** Affinity impl. */
     private Affinity<K> aff;
@@ -275,7 +275,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>,
 
         init();
 
-        qry = new GridCacheQueriesImpl<>(ctx, null);
+        qry = new CacheQueriesImpl<>(ctx, null);
         aff = new GridCacheAffinityImpl<>(ctx);
     }
 
@@ -356,7 +356,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>,
     public abstract GridCachePreloader<K, V> preloader();
 
     /** {@inheritDoc} */
-    @Override public GridCacheQueriesEx<K, V> queries() {
+    @Override public CacheQueries<K, V> queries() {
         return qry;
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0920bcfe/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProjectionImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProjectionImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProjectionImpl.java
index d8b554a..52fc8e6 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProjectionImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProjectionImpl.java
@@ -53,7 +53,7 @@ public class GridCacheProjectionImpl<K, V> implements GridCacheProjectionEx<K, V
     private GridCacheContext<K, V> cctx;
 
     /** Queries impl. */
-    private GridCacheQueriesEx<K, V> qry;
+    private CacheQueries<K, V> qry;
 
     /** Skip store. */
     @GridToStringInclude
@@ -101,7 +101,7 @@ public class GridCacheProjectionImpl<K, V> implements GridCacheProjectionEx<K, V
 
         cache = cctx.cache();
 
-        qry = new GridCacheQueriesImpl<>(cctx, this);
+        qry = new CacheQueriesImpl<>(cctx, this);
 
         this.keepPortable = keepPortable;
 
@@ -138,7 +138,7 @@ public class GridCacheProjectionImpl<K, V> implements GridCacheProjectionEx<K, V
     }
 
     /** {@inheritDoc} */
-    @Override public GridCacheQueriesEx<K, V> queries() {
+    @Override public CacheQueries<K, V> queries() {
         return qry;
     }
 
@@ -754,7 +754,7 @@ public class GridCacheProjectionImpl<K, V> implements GridCacheProjectionEx<K, V
 
         cache = cctx.cache();
 
-        qry = new GridCacheQueriesImpl<>(cctx, this);
+        qry = new CacheQueriesImpl<>(cctx, this);
 
         keepPortable = in.readBoolean();
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0920bcfe/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java
index 84053ee..2b968bd 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java
@@ -66,7 +66,7 @@ public class GridCacheProxyImpl<K, V> implements GridCacheProxy<K, V>, Externali
     private GridCacheProjectionImpl<K, V> prj;
 
     /** Cache queries. */
-    private GridCacheQueriesEx<K, V> qry;
+    private CacheQueries<K, V> qry;
 
     /** Affinity. */
     private Affinity<K> aff;
@@ -95,7 +95,7 @@ public class GridCacheProxyImpl<K, V> implements GridCacheProxy<K, V>, Externali
         gate = ctx.gate();
         cache = ctx.cache();
 
-        qry = new GridCacheQueriesProxy<>(ctx, prj, (GridCacheQueriesEx<K, V>)delegate.queries());
+        qry = new CacheQueriesProxy<>(ctx, prj, delegate.queries());
         aff = new GridCacheAffinityProxy<>(ctx, ctx.cache().affinity());
     }
 
@@ -143,7 +143,7 @@ public class GridCacheProxyImpl<K, V> implements GridCacheProxy<K, V>, Externali
     }
 
     /** {@inheritDoc} */
-    @Override public GridCacheQueriesEx<K, V> queries() {
+    @Override public CacheQueries<K, V> queries() {
         return qry;
     }
 
@@ -1577,7 +1577,7 @@ public class GridCacheProxyImpl<K, V> implements GridCacheProxy<K, V>, Externali
         gate = ctx.gate();
         cache = ctx.cache();
 
-        qry = new GridCacheQueriesProxy<>(ctx, prj, (GridCacheQueriesEx<K, V>)delegate.queries());
+        qry = new CacheQueriesProxy<>(ctx, prj, delegate.queries());
         aff = new GridCacheAffinityProxy<>(ctx, ctx.cache().affinity());
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0920bcfe/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
index f1c2614..b890407 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
@@ -335,7 +335,7 @@ public class IgniteCacheProxy<K, V> extends AsyncSupportAdapter<IgniteCache<K, V
             fut = qry.execute();
         }
         else if (filter instanceof SpiQuery) {
-            qry = ((GridCacheQueriesEx)delegate.queries()).createSpiQuery();
+            qry = delegate.queries().createSpiQuery();
 
             if (grp != null)
                 qry.projection(grp);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0920bcfe/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
new file mode 100644
index 0000000..3d0460e
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/CacheQueries.java
@@ -0,0 +1,103 @@
+/*
+ * 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.internal.processors.cache.query;
+
+import org.apache.ignite.*;
+import org.apache.ignite.cache.query.*;
+import org.apache.ignite.lang.*;
+import org.jetbrains.annotations.*;
+
+import java.util.*;
+
+/**
+ * Extended queries interface.
+ */
+public interface CacheQueries<K, V> {
+    /**
+     * Creates user's SQL fields query for given clause. For more information refer to
+     * {@link CacheQuery} documentation.
+     *
+     * @param qry Query.
+     * @return Created query.
+     */
+    public CacheQuery<List<?>> createSqlFieldsQuery(String qry);
+
+    /**
+     * Creates user's full text query, queried class, and query clause.
+     * For more information refer to {@link CacheQuery} documentation.
+     *
+     * @param clsName Query class name.
+     * @param search Search clause.
+     * @return Created query.
+     */
+    public CacheQuery<Map.Entry<K, V>> createFullTextQuery(String clsName, String search);
+
+    /**
+     * Creates user's predicate based scan query.
+     *
+     * @param filter Scan filter.
+     * @return Created query.
+     */
+    public CacheQuery<Map.Entry<K, V>> createScanQuery(@Nullable IgniteBiPredicate<K, V> filter);
+
+    /**
+     * Accumulated metrics for all queries executed for this cache.
+     *
+     * @return Cache query metrics.
+     */
+    public QueryMetrics metrics();
+
+    /**
+     * Gets SQL metadata.
+     *
+     * @return SQL metadata.
+     * @throws IgniteCheckedException In case of error.
+     */
+    public Collection<GridCacheSqlMetadata> sqlMetadata() throws IgniteCheckedException;
+
+    /**
+     * Creates SQL fields query which will include results metadata if needed.
+     *
+     * @param qry SQL query.
+     * @param incMeta Whether to include results metadata.
+     * @return Created query.
+     */
+    public CacheQuery<List<?>> createSqlFieldsQuery(String qry, boolean incMeta);
+
+    /**
+     * Creates SPI query.
+     *
+     * @return Query.
+     */
+    public <R> CacheQuery<R> createSpiQuery();
+
+    /**
+     * @param space Space name.
+     * @param qry Query.
+     * @return Cursor.
+     */
+    public QueryCursor<List<?>> execute(String space, GridCacheTwoStepQuery qry);
+
+    /**
+     * @param space Space.
+     * @param sqlQry Query.
+     * @param params Parameters.
+     * @return Cursor.
+     */
+    public QueryCursor<List<?>> executeTwoStepQuery(String space, String sqlQry, Object... params);
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0920bcfe/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/CacheQueriesImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/CacheQueriesImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/CacheQueriesImpl.java
new file mode 100644
index 0000000..7abd97d
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/CacheQueriesImpl.java
@@ -0,0 +1,150 @@
+/*
+ * 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.internal.processors.cache.query;
+
+import org.apache.ignite.*;
+import org.apache.ignite.cache.query.*;
+import org.apache.ignite.internal.processors.cache.*;
+import org.apache.ignite.internal.util.typedef.internal.*;
+import org.apache.ignite.lang.*;
+import org.apache.ignite.spi.indexing.*;
+import org.jetbrains.annotations.*;
+
+import java.io.*;
+import java.util.*;
+
+import static org.apache.ignite.internal.processors.cache.query.GridCacheQueryType.*;
+
+/**
+ * {@link CacheQueries} implementation.
+ */
+public class CacheQueriesImpl<K, V> implements CacheQueries<K, V> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** */
+    private GridCacheContext<K, V> ctx;
+
+    /** */
+    private GridCacheProjectionImpl<K, V> prj;
+
+    /**
+     * Required by {@link Externalizable}.
+     */
+    public CacheQueriesImpl() {
+        // No-op.
+    }
+
+    /**
+     * @param ctx Context.
+     * @param prj Projection.
+     */
+    public CacheQueriesImpl(GridCacheContext<K, V> ctx, @Nullable GridCacheProjectionImpl<K, V> prj) {
+        assert ctx != null;
+
+        this.ctx = ctx;
+        this.prj = prj;
+    }
+
+    /** {@inheritDoc} */
+    @Override public CacheQuery<List<?>> createSqlFieldsQuery(String qry) {
+        A.notNull(qry, "qry");
+
+        return new GridCacheQueryAdapter<>(ctx,
+            SQL_FIELDS,
+            null,
+            qry,
+            null,
+            false,
+            prj != null && prj.isKeepPortable());
+    }
+
+    /** {@inheritDoc} */
+    @Override public CacheQuery<Map.Entry<K, V>> createFullTextQuery(String clsName, String search) {
+        A.notNull("clsName", clsName);
+        A.notNull("search", search);
+
+        return new GridCacheQueryAdapter<>(ctx,
+            TEXT,
+            clsName,
+            search,
+            null,
+            false,
+            prj != null && prj.isKeepPortable());
+    }
+
+    /** {@inheritDoc} */
+    @SuppressWarnings("unchecked")
+    @Override public CacheQuery<Map.Entry<K, V>> createScanQuery(@Nullable IgniteBiPredicate<K, V> filter) {
+        return new GridCacheQueryAdapter<>(ctx,
+            SCAN,
+            null,
+            null,
+            (IgniteBiPredicate<Object, Object>)filter,
+            false,
+            prj != null && prj.isKeepPortable());
+    }
+
+    /**
+     * Query for {@link IndexingSpi}.
+     *
+     * @return Query.
+     */
+    @Override public <R> CacheQuery<R> createSpiQuery() {
+        return new GridCacheQueryAdapter<>(ctx,
+            SPI,
+            null,
+            null,
+            null,
+            false,
+            prj != null && prj.isKeepPortable());
+    }
+
+    /** {@inheritDoc} */
+    @Override public QueryCursor<List<?>> execute(String space, GridCacheTwoStepQuery qry) {
+        return ctx.kernalContext().query().queryTwoStep(space, qry);
+    }
+
+    /** {@inheritDoc} */
+    @Override public QueryCursor<List<?>> executeTwoStepQuery(String space, String sqlQry, Object[] params) {
+        return ctx.kernalContext().query().queryTwoStep(ctx, new SqlFieldsQuery(sqlQry).setArgs(params));
+    }
+
+    /** {@inheritDoc} */
+    @Override public QueryMetrics metrics() {
+        return ctx.queries().metrics();
+    }
+
+    /** {@inheritDoc} */
+    @Override public Collection<GridCacheSqlMetadata> sqlMetadata() throws IgniteCheckedException {
+        return ctx.queries().sqlMetadata();
+    }
+
+    /** {@inheritDoc} */
+    @Override public CacheQuery<List<?>> createSqlFieldsQuery(String qry, boolean incMeta) {
+        assert qry != null;
+
+        return new GridCacheQueryAdapter<>(ctx,
+            SQL_FIELDS,
+            null,
+            qry,
+            null,
+            incMeta,
+            prj != null && prj.isKeepPortable());
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0920bcfe/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/CacheQueriesProxy.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/CacheQueriesProxy.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/CacheQueriesProxy.java
new file mode 100644
index 0000000..a04f9e1
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/CacheQueriesProxy.java
@@ -0,0 +1,200 @@
+/*
+ * 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.internal.processors.cache.query;
+
+import org.apache.ignite.*;
+import org.apache.ignite.cache.query.*;
+import org.apache.ignite.internal.processors.cache.*;
+import org.apache.ignite.lang.*;
+import org.jetbrains.annotations.*;
+
+import java.io.*;
+import java.util.*;
+
+/**
+ * Per-projection queries object returned to user.
+ */
+public class CacheQueriesProxy<K, V> implements CacheQueries<K, V>, Externalizable {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** */
+    private GridCacheGateway<K, V> gate;
+
+    /** */
+    private GridCacheProjectionImpl<K, V> prj;
+
+    /** */
+    private CacheQueries<K, V> delegate;
+
+    /**
+     * Required by {@link Externalizable}.
+     */
+    public CacheQueriesProxy() {
+        // No-op.
+    }
+
+    /**
+     * Create cache queries implementation.
+     *
+     * @param cctx Context.
+     * @param prj Optional cache projection.
+     * @param delegate Delegate object.
+     */
+    public CacheQueriesProxy(GridCacheContext<K, V> cctx, @Nullable GridCacheProjectionImpl<K, V> prj,
+        CacheQueries<K, V> delegate) {
+        assert cctx != null;
+        assert delegate != null;
+
+        gate = cctx.gate();
+
+        this.prj = prj;
+        this.delegate = delegate;
+    }
+
+    /**
+     * Gets cache projection.
+     *
+     * @return Cache projection.
+     */
+    public CacheProjection<K, V> projection() {
+        return prj;
+    }
+
+    /** {@inheritDoc} */
+    @Override public CacheQuery<List<?>> createSqlFieldsQuery(String qry) {
+        GridCacheProjectionImpl<K, V> prev = gate.enter(prj);
+
+        try {
+            return delegate.createSqlFieldsQuery(qry);
+        }
+        finally {
+            gate.leave(prev);
+        }
+    }
+
+    /** {@inheritDoc} */
+    @Override public CacheQuery<Map.Entry<K, V>> createFullTextQuery(String clsName, String search) {
+        GridCacheProjectionImpl<K, V> prev = gate.enter(prj);
+
+        try {
+            return delegate.createFullTextQuery(clsName, search);
+        }
+        finally {
+            gate.leave(prev);
+        }
+    }
+
+    /** {@inheritDoc} */
+    @Override public CacheQuery<Map.Entry<K, V>> createScanQuery(@Nullable IgniteBiPredicate<K, V> filter) {
+        GridCacheProjectionImpl<K, V> prev = gate.enter(prj);
+
+        try {
+            return delegate.createScanQuery(filter);
+        }
+        finally {
+            gate.leave(prev);
+        }
+    }
+
+    /** {@inheritDoc} */
+    @Override public <R> CacheQuery<R> createSpiQuery() {
+        GridCacheProjectionImpl<K, V> prev = gate.enter(prj);
+
+        try {
+            return delegate.createSpiQuery();
+        }
+        finally {
+            gate.leave(prev);
+        }
+    }
+
+    /** {@inheritDoc} */
+    @Override public QueryCursor<List<?>> execute(String space, GridCacheTwoStepQuery qry) {
+        GridCacheProjectionImpl<K, V> prev = gate.enter(prj);
+
+        try {
+            return delegate.execute(space, qry);
+        }
+        finally {
+            gate.leave(prev);
+        }
+    }
+
+    /** {@inheritDoc} */
+    @Override public QueryCursor<List<?>> executeTwoStepQuery(String space, String sqlQry, Object[] params) {
+        GridCacheProjectionImpl<K, V> prev = gate.enter(prj);
+
+        try {
+            return delegate.executeTwoStepQuery(space, sqlQry, params);
+        }
+        finally {
+            gate.leave(prev);
+        }
+    }
+
+    /** {@inheritDoc} */
+    @Override public QueryMetrics metrics() {
+        GridCacheProjectionImpl<K, V> prev = gate.enter(prj);
+
+        try {
+            return delegate.metrics();
+        }
+        finally {
+            gate.leave(prev);
+        }
+    }
+
+    /** {@inheritDoc} */
+    @Override public Collection<GridCacheSqlMetadata> sqlMetadata() throws IgniteCheckedException {
+        GridCacheProjectionImpl<K, V> prev = gate.enter(prj);
+
+        try {
+            return delegate.sqlMetadata();
+        }
+        finally {
+            gate.leave(prev);
+        }
+    }
+
+    /** {@inheritDoc} */
+    @Override public CacheQuery<List<?>> createSqlFieldsQuery(String qry, boolean incMeta) {
+        GridCacheProjectionImpl<K, V> prev = gate.enter(prj);
+
+        try {
+            return delegate.createSqlFieldsQuery(qry, incMeta);
+        }
+        finally {
+            gate.leave(prev);
+        }
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeExternal(ObjectOutput out) throws IOException {
+        out.writeObject(prj);
+        out.writeObject(delegate);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
+        prj = (GridCacheProjectionImpl<K, V>)in.readObject();
+        delegate = (CacheQueries<K, V>)in.readObject();
+
+        gate = prj.context().gate();
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0920bcfe/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/CacheQuery.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/CacheQuery.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/CacheQuery.java
index c086a0e..93576ab 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/CacheQuery.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/CacheQuery.java
@@ -26,7 +26,7 @@ import org.jetbrains.annotations.*;
 /**
  * Main API for configuring and executing cache queries.
  * <p>
- * Cache queries are created from {@link GridCacheQueriesEx} API via any of the available
+ * Cache queries are created from {@link CacheQueries} API via any of the available
  * {@code createXXXQuery(...)} methods.
  * <h1 class="header">SQL Queries</h1>
  * {@code SQL} query allows to execute distributed cache
@@ -60,7 +60,7 @@ import org.jetbrains.annotations.*;
  * Sometimes when it is known in advance that SQL query will cause a full data scan, or whenever data set
  * is relatively small, the full scan query may be used. This query will iterate over all cache
  * entries, skipping over entries that don't pass the optionally provided key-value filter
- * (see {@link GridCacheQueriesEx#createScanQuery(org.apache.ignite.lang.IgniteBiPredicate)} method).
+ * (see {@link CacheQueries#createScanQuery(org.apache.ignite.lang.IgniteBiPredicate)} method).
  * <h2 class="header">Limitations</h2>
  * Data in Ignite cache is usually distributed across several nodes,
  * so some queries may not work as expected. Keep in mind following limitations

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0920bcfe/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueriesEx.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueriesEx.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueriesEx.java
deleted file mode 100644
index 5840070..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueriesEx.java
+++ /dev/null
@@ -1,103 +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.internal.processors.cache.query;
-
-import org.apache.ignite.*;
-import org.apache.ignite.cache.query.*;
-import org.apache.ignite.lang.*;
-import org.jetbrains.annotations.*;
-
-import java.util.*;
-
-/**
- * Extended queries interface.
- */
-public interface GridCacheQueriesEx<K, V> {
-    /**
-     * Creates user's SQL fields query for given clause. For more information refer to
-     * {@link CacheQuery} documentation.
-     *
-     * @param qry Query.
-     * @return Created query.
-     */
-    public CacheQuery<List<?>> createSqlFieldsQuery(String qry);
-
-    /**
-     * Creates user's full text query, queried class, and query clause.
-     * For more information refer to {@link CacheQuery} documentation.
-     *
-     * @param clsName Query class name.
-     * @param search Search clause.
-     * @return Created query.
-     */
-    public CacheQuery<Map.Entry<K, V>> createFullTextQuery(String clsName, String search);
-
-    /**
-     * Creates user's predicate based scan query.
-     *
-     * @param filter Scan filter.
-     * @return Created query.
-     */
-    public CacheQuery<Map.Entry<K, V>> createScanQuery(@Nullable IgniteBiPredicate<K, V> filter);
-
-    /**
-     * Accumulated metrics for all queries executed for this cache.
-     *
-     * @return Cache query metrics.
-     */
-    public QueryMetrics metrics();
-
-    /**
-     * Gets SQL metadata.
-     *
-     * @return SQL metadata.
-     * @throws IgniteCheckedException In case of error.
-     */
-    public Collection<GridCacheSqlMetadata> sqlMetadata() throws IgniteCheckedException;
-
-    /**
-     * Creates SQL fields query which will include results metadata if needed.
-     *
-     * @param qry SQL query.
-     * @param incMeta Whether to include results metadata.
-     * @return Created query.
-     */
-    public CacheQuery<List<?>> createSqlFieldsQuery(String qry, boolean incMeta);
-
-    /**
-     * Creates SPI query.
-     *
-     * @return Query.
-     */
-    public <R> CacheQuery<R> createSpiQuery();
-
-    /**
-     * @param space Space name.
-     * @param qry Query.
-     * @return Cursor.
-     */
-    public QueryCursor<List<?>> execute(String space, GridCacheTwoStepQuery qry);
-
-    /**
-     * @param space Space.
-     * @param sqlQry Query.
-     * @param params Parameters.
-     * @return Cursor.
-     */
-    public QueryCursor<List<?>> executeTwoStepQuery(String space, String sqlQry, Object... params);
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0920bcfe/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
deleted file mode 100644
index 91ac680..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueriesImpl.java
+++ /dev/null
@@ -1,150 +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.internal.processors.cache.query;
-
-import org.apache.ignite.*;
-import org.apache.ignite.cache.query.*;
-import org.apache.ignite.internal.processors.cache.*;
-import org.apache.ignite.internal.util.typedef.internal.*;
-import org.apache.ignite.lang.*;
-import org.apache.ignite.spi.indexing.*;
-import org.jetbrains.annotations.*;
-
-import java.io.*;
-import java.util.*;
-
-import static org.apache.ignite.internal.processors.cache.query.GridCacheQueryType.*;
-
-/**
- * {@link GridCacheQueriesEx} implementation.
- */
-public class GridCacheQueriesImpl<K, V> implements GridCacheQueriesEx<K, V> {
-    /** */
-    private static final long serialVersionUID = 0L;
-
-    /** */
-    private GridCacheContext<K, V> ctx;
-
-    /** */
-    private GridCacheProjectionImpl<K, V> prj;
-
-    /**
-     * Required by {@link Externalizable}.
-     */
-    public GridCacheQueriesImpl() {
-        // No-op.
-    }
-
-    /**
-     * @param ctx Context.
-     * @param prj Projection.
-     */
-    public GridCacheQueriesImpl(GridCacheContext<K, V> ctx, @Nullable GridCacheProjectionImpl<K, V> prj) {
-        assert ctx != null;
-
-        this.ctx = ctx;
-        this.prj = prj;
-    }
-
-    /** {@inheritDoc} */
-    @Override public CacheQuery<List<?>> createSqlFieldsQuery(String qry) {
-        A.notNull(qry, "qry");
-
-        return new GridCacheQueryAdapter<>(ctx,
-            SQL_FIELDS,
-            null,
-            qry,
-            null,
-            false,
-            prj != null && prj.isKeepPortable());
-    }
-
-    /** {@inheritDoc} */
-    @Override public CacheQuery<Map.Entry<K, V>> createFullTextQuery(String clsName, String search) {
-        A.notNull("clsName", clsName);
-        A.notNull("search", search);
-
-        return new GridCacheQueryAdapter<>(ctx,
-            TEXT,
-            clsName,
-            search,
-            null,
-            false,
-            prj != null && prj.isKeepPortable());
-    }
-
-    /** {@inheritDoc} */
-    @SuppressWarnings("unchecked")
-    @Override public CacheQuery<Map.Entry<K, V>> createScanQuery(@Nullable IgniteBiPredicate<K, V> filter) {
-        return new GridCacheQueryAdapter<>(ctx,
-            SCAN,
-            null,
-            null,
-            (IgniteBiPredicate<Object, Object>)filter,
-            false,
-            prj != null && prj.isKeepPortable());
-    }
-
-    /**
-     * Query for {@link IndexingSpi}.
-     *
-     * @return Query.
-     */
-    @Override public <R> CacheQuery<R> createSpiQuery() {
-        return new GridCacheQueryAdapter<>(ctx,
-            SPI,
-            null,
-            null,
-            null,
-            false,
-            prj != null && prj.isKeepPortable());
-    }
-
-    /** {@inheritDoc} */
-    @Override public QueryCursor<List<?>> execute(String space, GridCacheTwoStepQuery qry) {
-        return ctx.kernalContext().query().queryTwoStep(space, qry);
-    }
-
-    /** {@inheritDoc} */
-    @Override public QueryCursor<List<?>> executeTwoStepQuery(String space, String sqlQry, Object[] params) {
-        return ctx.kernalContext().query().queryTwoStep(ctx, new SqlFieldsQuery(sqlQry).setArgs(params));
-    }
-
-    /** {@inheritDoc} */
-    @Override public QueryMetrics metrics() {
-        return ctx.queries().metrics();
-    }
-
-    /** {@inheritDoc} */
-    @Override public Collection<GridCacheSqlMetadata> sqlMetadata() throws IgniteCheckedException {
-        return ctx.queries().sqlMetadata();
-    }
-
-    /** {@inheritDoc} */
-    @Override public CacheQuery<List<?>> createSqlFieldsQuery(String qry, boolean incMeta) {
-        assert qry != null;
-
-        return new GridCacheQueryAdapter<>(ctx,
-            SQL_FIELDS,
-            null,
-            qry,
-            null,
-            incMeta,
-            prj != null && prj.isKeepPortable());
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0920bcfe/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
deleted file mode 100644
index da34602..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueriesProxy.java
+++ /dev/null
@@ -1,201 +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.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.lang.*;
-import org.jetbrains.annotations.*;
-
-import java.io.*;
-import java.util.*;
-
-/**
- * Per-projection queries object returned to user.
- */
-public class GridCacheQueriesProxy<K, V> implements GridCacheQueriesEx<K, V>, Externalizable {
-    /** */
-    private static final long serialVersionUID = 0L;
-
-    /** */
-    private GridCacheGateway<K, V> gate;
-
-    /** */
-    private GridCacheProjectionImpl<K, V> prj;
-
-    /** */
-    private GridCacheQueriesEx<K, V> delegate;
-
-    /**
-     * Required by {@link Externalizable}.
-     */
-    public GridCacheQueriesProxy() {
-        // No-op.
-    }
-
-    /**
-     * Create cache queries implementation.
-     *
-     * @param cctx Context.
-     * @param prj Optional cache projection.
-     * @param delegate Delegate object.
-     */
-    public GridCacheQueriesProxy(GridCacheContext<K, V> cctx, @Nullable GridCacheProjectionImpl<K, V> prj,
-        GridCacheQueriesEx<K, V> delegate) {
-        assert cctx != null;
-        assert delegate != null;
-
-        gate = cctx.gate();
-
-        this.prj = prj;
-        this.delegate = delegate;
-    }
-
-    /**
-     * Gets cache projection.
-     *
-     * @return Cache projection.
-     */
-    public CacheProjection<K, V> projection() {
-        return prj;
-    }
-
-    /** {@inheritDoc} */
-    @Override public CacheQuery<List<?>> createSqlFieldsQuery(String qry) {
-        GridCacheProjectionImpl<K, V> prev = gate.enter(prj);
-
-        try {
-            return delegate.createSqlFieldsQuery(qry);
-        }
-        finally {
-            gate.leave(prev);
-        }
-    }
-
-    /** {@inheritDoc} */
-    @Override public CacheQuery<Map.Entry<K, V>> createFullTextQuery(String clsName, String search) {
-        GridCacheProjectionImpl<K, V> prev = gate.enter(prj);
-
-        try {
-            return delegate.createFullTextQuery(clsName, search);
-        }
-        finally {
-            gate.leave(prev);
-        }
-    }
-
-    /** {@inheritDoc} */
-    @Override public CacheQuery<Map.Entry<K, V>> createScanQuery(@Nullable IgniteBiPredicate<K, V> filter) {
-        GridCacheProjectionImpl<K, V> prev = gate.enter(prj);
-
-        try {
-            return delegate.createScanQuery(filter);
-        }
-        finally {
-            gate.leave(prev);
-        }
-    }
-
-    /** {@inheritDoc} */
-    @Override public <R> CacheQuery<R> createSpiQuery() {
-        GridCacheProjectionImpl<K, V> prev = gate.enter(prj);
-
-        try {
-            return delegate.createSpiQuery();
-        }
-        finally {
-            gate.leave(prev);
-        }
-    }
-
-    /** {@inheritDoc} */
-    @Override public QueryCursor<List<?>> execute(String space, GridCacheTwoStepQuery qry) {
-        GridCacheProjectionImpl<K, V> prev = gate.enter(prj);
-
-        try {
-            return delegate.execute(space, qry);
-        }
-        finally {
-            gate.leave(prev);
-        }
-    }
-
-    /** {@inheritDoc} */
-    @Override public QueryCursor<List<?>> executeTwoStepQuery(String space, String sqlQry, Object[] params) {
-        GridCacheProjectionImpl<K, V> prev = gate.enter(prj);
-
-        try {
-            return delegate.executeTwoStepQuery(space, sqlQry, params);
-        }
-        finally {
-            gate.leave(prev);
-        }
-    }
-
-    /** {@inheritDoc} */
-    @Override public QueryMetrics metrics() {
-        GridCacheProjectionImpl<K, V> prev = gate.enter(prj);
-
-        try {
-            return delegate.metrics();
-        }
-        finally {
-            gate.leave(prev);
-        }
-    }
-
-    /** {@inheritDoc} */
-    @Override public Collection<GridCacheSqlMetadata> sqlMetadata() throws IgniteCheckedException {
-        GridCacheProjectionImpl<K, V> prev = gate.enter(prj);
-
-        try {
-            return delegate.sqlMetadata();
-        }
-        finally {
-            gate.leave(prev);
-        }
-    }
-
-    /** {@inheritDoc} */
-    @Override public CacheQuery<List<?>> createSqlFieldsQuery(String qry, boolean incMeta) {
-        GridCacheProjectionImpl<K, V> prev = gate.enter(prj);
-
-        try {
-            return delegate.createSqlFieldsQuery(qry, incMeta);
-        }
-        finally {
-            gate.leave(prev);
-        }
-    }
-
-    /** {@inheritDoc} */
-    @Override public void writeExternal(ObjectOutput out) throws IOException {
-        out.writeObject(prj);
-        out.writeObject(delegate);
-    }
-
-    /** {@inheritDoc} */
-    @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
-        prj = (GridCacheProjectionImpl<K, V>)in.readObject();
-        delegate = (GridCacheQueriesEx<K, V>)in.readObject();
-
-        gate = prj.context().gate();
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0920bcfe/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/jdbc/GridCacheQueryJdbcMetadataTask.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/jdbc/GridCacheQueryJdbcMetadataTask.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/jdbc/GridCacheQueryJdbcMetadataTask.java
index 2013757..bdab2bc 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/jdbc/GridCacheQueryJdbcMetadataTask.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/jdbc/GridCacheQueryJdbcMetadataTask.java
@@ -107,7 +107,7 @@ public class GridCacheQueryJdbcMetadataTask extends ComputeTaskAdapter<String, b
 
                 assert cache != null;
 
-                Collection<GridCacheSqlMetadata> metas = ((GridCacheQueriesEx<?, ?>)cache.queries()).sqlMetadata();
+                Collection<GridCacheSqlMetadata> metas = cache.queries().sqlMetadata();
 
                 Map<String, Map<String, Map<String, String>>> schemasMap = U.newHashMap(metas.size());
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0920bcfe/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheMetadataTask.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheMetadataTask.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheMetadataTask.java
index de67b83..9d98eae 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheMetadataTask.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheMetadataTask.java
@@ -61,7 +61,7 @@ public class VisorCacheMetadataTask extends VisorOneNodeTask<String, GridCacheSq
                 GridCache<Object, Object> cache = ignite.cachex(cacheName);
 
                 if (cache != null) {
-                    GridCacheQueriesEx<Object, Object> queries = (GridCacheQueriesEx<Object, Object>)cache.queries();
+                    CacheQueries<Object, Object> queries = cache.queries();
 
                     return F.first(queries.sqlMetadata());
                 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0920bcfe/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFieldsQuerySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFieldsQuerySelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFieldsQuerySelfTest.java
index a2046ab..fc58929 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFieldsQuerySelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFieldsQuerySelfTest.java
@@ -182,7 +182,7 @@ public abstract class GridCacheAbstractFieldsQuerySelfTest extends GridCommonAbs
 
         try {
             Collection<GridCacheSqlMetadata> metas =
-                ((GridCacheQueriesEx<?, ?>)((IgniteKernal)grid(0)).getCache(null).queries()).sqlMetadata();
+                ((IgniteKernal)grid(0)).getCache(null).queries().sqlMetadata();
 
             assert metas != null;
             assertEquals("Invalid meta: " + metas, 3, metas.size());
@@ -364,7 +364,7 @@ public abstract class GridCacheAbstractFieldsQuerySelfTest extends GridCommonAbs
 
     /** @throws Exception If failed. */
     public void testExecuteWithMetaData() throws Exception {
-        CacheQuery<List<?>> qry = ((GridCacheQueriesEx<?, ?>)((IgniteKernal)grid(0)).getCache(null).queries()).createSqlFieldsQuery(
+        CacheQuery<List<?>> qry = ((IgniteKernal)grid(0)).getCache(null).queries().createSqlFieldsQuery(
             "select p._KEY, p.name, p.age, o.name " +
                 "from Person p, Organization o where p.orgId = o.id",
             true);
@@ -465,7 +465,7 @@ public abstract class GridCacheAbstractFieldsQuerySelfTest extends GridCommonAbs
 
     /** @throws Exception If failed. */
     public void testSelectAllJoined() throws Exception {
-        CacheQuery<List<?>> qry = ((GridCacheQueriesEx<?, ?>)((IgniteKernal)grid(0)).getCache(null).queries()).createSqlFieldsQuery(
+        CacheQuery<List<?>> qry = ((IgniteKernal)grid(0)).getCache(null).queries().createSqlFieldsQuery(
             "select * from Person p, Organization o where p.orgId = o.id",
             true);
 
@@ -630,7 +630,7 @@ public abstract class GridCacheAbstractFieldsQuerySelfTest extends GridCommonAbs
 
     /** @throws Exception If failed. */
     public void testEmptyResult() throws Exception {
-        CacheQuery<List<?>> qry = ((GridCacheQueriesEx<?, ?>)((IgniteKernal)grid(0)).getCache(null).queries()).createSqlFieldsQuery(
+        CacheQuery<List<?>> qry = ((IgniteKernal)grid(0)).getCache(null).queries().createSqlFieldsQuery(
             "select name from Person where age = 0", true);
 
         CacheQueryFuture<List<?>> fut = qry.execute();
@@ -675,7 +675,7 @@ public abstract class GridCacheAbstractFieldsQuerySelfTest extends GridCommonAbs
 
     /** @throws Exception If failed. */
     public void testQueryIntegersWithJoin() throws Exception {
-        CacheQuery<List<?>> qry = ((GridCacheQueriesEx<?, ?>)((IgniteKernal)grid(0)).getCache(null).queries()).createSqlFieldsQuery(
+        CacheQuery<List<?>> qry = ((IgniteKernal)grid(0)).getCache(null).queries().createSqlFieldsQuery(
             "select i._KEY, i._VAL, j._KEY, j._VAL from Integer i join Integer j where i._VAL >= 100", true)
             .projection(grid(0).cluster());
 
@@ -786,7 +786,7 @@ public abstract class GridCacheAbstractFieldsQuerySelfTest extends GridCommonAbs
 
         cache.getAndPut("key", "val");
 
-        Collection<GridCacheSqlMetadata> metas = ((GridCacheQueriesEx<?, ?>)cache.queries()).sqlMetadata();
+        Collection<GridCacheSqlMetadata> metas = cache.queries().sqlMetadata();
 
         assertEquals(1, metas.size());
 
@@ -813,7 +813,7 @@ public abstract class GridCacheAbstractFieldsQuerySelfTest extends GridCommonAbs
 
         cache.getAndPut(key, val);
 
-        Collection<GridCacheSqlMetadata> metas = ((GridCacheQueriesEx<?, ?>)cache.queries()).sqlMetadata();
+        Collection<GridCacheSqlMetadata> metas = cache.queries().sqlMetadata();
 
         assertEquals(1, metas.size());
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0920bcfe/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheCrossCacheQuerySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheCrossCacheQuerySelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheCrossCacheQuerySelfTest.java
index aebecf7..ec3b1e9 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheCrossCacheQuerySelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheCrossCacheQuerySelfTest.java
@@ -117,9 +117,8 @@ public class GridCacheCrossCacheQuerySelfTest extends GridCommonAbstractTest {
     public void _testTwoStep() throws Exception {
         String cache = "partitioned";
 
-        GridCacheQueriesEx<Integer, FactPurchase> qx =
-            (GridCacheQueriesEx<Integer, FactPurchase>)((IgniteKernal)ignite)
-                .<Integer, FactPurchase>getCache(cache).queries();
+        CacheQueries<Integer, FactPurchase> qx =
+            ((IgniteKernal)ignite).<Integer, FactPurchase>getCache(cache).queries();
 
 //        for (Map.Entry<Integer, FactPurchase> e : qx.createSqlQuery(FactPurchase.class, "1 = 1").execute().get())
 //            X.println("___ "  + e);
@@ -137,9 +136,8 @@ public class GridCacheCrossCacheQuerySelfTest extends GridCommonAbstractTest {
      * @throws Exception If failed.
      */
     public void testTwoStepGroupAndAggregates() throws Exception {
-        GridCacheQueriesEx<Integer, FactPurchase> qx =
-            (GridCacheQueriesEx<Integer, FactPurchase>)((IgniteKernal)ignite)
-                .<Integer, FactPurchase>getCache("partitioned").queries();
+        CacheQueries<Integer, FactPurchase> qx =
+            ((IgniteKernal)ignite).<Integer, FactPurchase>getCache("partitioned").queries();
 
         Set<Integer> set1 = new HashSet<>();
 


Mime
View raw message