ignite-qry - spring
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/73b5ef6b Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/73b5ef6b Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/73b5ef6b Branch: refs/heads/master Commit: 73b5ef6b040c0a9805d939bef2effba767181c66 Parents: 34115a7 Author: S.Vladykin <svlady...@gridgain.com> Authored: Wed Dec 10 15:17:11 2014 +0300 Committer: S.Vladykin <svlady...@gridgain.com> Committed: Wed Dec 10 15:17:11 2014 +0300 ---------------------------------------------------------------------- examples/config/example-cache.xml | 17 +++---- .../clients/src/test/resources/spring-cache.xml | 29 +++-------- .../configuration/IgniteConfiguration.java | 8 +-- .../ignite/spi/indexing/GridIndexingSpi.java | 4 +- .../grid/cache/query/GridCacheQuery.java | 6 +-- .../cache/query/GridCacheQuerySqlField.java | 2 +- .../cache/query/GridCacheQuerySqlFunction.java | 4 +- .../loadtests/colocation/spring-colocation.xml | 13 ----- .../core/src/test/webapp/META-INF/gg-config.xml | 53 ++++++++++++-------- .../processors/query/h2/GridH2Indexing.java | 2 +- .../test/resources/spring-ping-pong-partner.xml | 21 -------- 11 files changed, 60 insertions(+), 99 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/73b5ef6b/examples/config/example-cache.xml ---------------------------------------------------------------------- diff --git a/examples/config/example-cache.xml b/examples/config/example-cache.xml index 6e95de4..b3b6877 100644 --- a/examples/config/example-cache.xml +++ b/examples/config/example-cache.xml @@ -191,15 +191,6 @@ </property> </bean> </property> - - <!-- Allow indexing SPI to index primitive values (required for CachePopularNumbersExample). --> - <property name="indexingSpi"> - <list> - <bean class="org.gridgain.grid.spi.indexing.h2.GridH2IndexingSpi"> - <property name="defaultIndexPrimitiveKey" value="true"/> - </bean> - </list> - </property> </bean> <!-- Template for all example cache configurations. --> @@ -215,5 +206,13 @@ <!-- Set to true to enable indexing for query examples, default value is false. --> <property name="queryIndexEnabled" value="true"/> + + <!-- Allow to index primitive values. --> + <property name="queryConfiguration"> + <bean class="org.gridgain.grid.cache.query.GridCacheQueryConfiguration"> + <!-- Index primitives. --> + <property name="indexPrimitiveKey" value="true"/> + </bean> + </property> </bean> </beans> http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/73b5ef6b/modules/clients/src/test/resources/spring-cache.xml ---------------------------------------------------------------------- diff --git a/modules/clients/src/test/resources/spring-cache.xml b/modules/clients/src/test/resources/spring-cache.xml index ba89926..c63e8ec 100644 --- a/modules/clients/src/test/resources/spring-cache.xml +++ b/modules/clients/src/test/resources/spring-cache.xml @@ -41,27 +41,6 @@ <!-- Set to local host address just for examples. --> <property name="localHost" value="127.0.0.1"/> - <!-- - Allow indexing SPI to index primitive values. - --> - <property name="indexingSpi"> - <list> - <bean class="org.gridgain.grid.spi.indexing.h2.GridH2IndexingSpi"> - <!-- Index primitives. --> - <property name="defaultIndexPrimitiveKey" value="true"/> - - <!-- - Set to false to allow different key types for one value type. - - Note that this also means that '_key' column cannot participate in - where clause queries either directly through API, through JDBC driver, - or through Object Viewer in Visor DevOps Console. - --> - <!--property name="defaultIndexFixedTyping" value="false"/--> - </bean> - </list> - </property> - <!-- Client configuration. --> <property name="clientConnectionConfiguration"> <bean class="org.apache.ignite.configuration.ClientConnectionConfiguration"/> @@ -105,6 +84,14 @@ --> <property name="queryIndexEnabled" value="true"/> + <!-- Allow to index primitive values. --> + <property name="queryConfiguration"> + <bean class="org.gridgain.grid.cache.query.GridCacheQueryConfiguration"> + <!-- Index primitives. --> + <property name="indexPrimitiveKey" value="true"/> + </bean> + </property> + <!-- This shows how to configure number of backups. The below configuration sets the number of backups to 1 (which is default). http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/73b5ef6b/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java b/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java index b955549..895bdb7 100644 --- a/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java +++ b/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java @@ -2161,13 +2161,9 @@ public class IgniteConfiguration { } /** - * Should return fully configured indexing SPI implementations. If not provided, - * {@gglink org.gridgain.grid.spi.indexing.h2.GridH2IndexingSpi} will be used. - * <p> - * Note that user can provide one or multiple instances of this SPI (and select later which one - * is used in a particular context). + * Should return fully configured indexing SPI implementations. * - * @return Indexing SPI implementation or <tt>null</tt> to use default implementation. + * @return Indexing SPI implementation. */ public GridIndexingSpi getIndexingSpi() { return indexingSpi; http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/73b5ef6b/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 71cced8..e68d390 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 @@ -25,7 +25,7 @@ import java.util.*; * methods. Note again that calling methods from this interface on the obtained instance can lead * to undefined behavior and explicitly not supported. * - * * Here is a Java example on how to configure grid with {@code GridH2IndexingSpi}. + * Here is a Java example on how to configure SPI. * <pre name="code" class="java"> * GridIndexingSpi spi = new MyIndexingSpi(); * @@ -37,7 +37,7 @@ import java.util.*; * // Starts grid. * G.start(cfg); * </pre> - * Here is an example of how to configure {@code GridH2IndexingSpi} from Spring XML configuration file. + * Here is an example of how to configure SPI from Spring XML configuration file. * <pre name="code" class="xml"> * <property name="indexingSpi"> * <bean class="com.example.MyIndexingSpi"> http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/73b5ef6b/modules/core/src/main/java/org/gridgain/grid/cache/query/GridCacheQuery.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/gridgain/grid/cache/query/GridCacheQuery.java b/modules/core/src/main/java/org/gridgain/grid/cache/query/GridCacheQuery.java index 394c542..a56faf0 100644 --- a/modules/core/src/main/java/org/gridgain/grid/cache/query/GridCacheQuery.java +++ b/modules/core/src/main/java/org/gridgain/grid/cache/query/GridCacheQuery.java @@ -10,6 +10,7 @@ package org.gridgain.grid.cache.query; import org.apache.ignite.cluster.*; +import org.apache.ignite.configuration.*; import org.apache.ignite.lang.*; import org.gridgain.grid.cache.*; import org.gridgain.grid.cache.affinity.*; @@ -45,7 +46,7 @@ import org.jetbrains.annotations.*; * <h2 class="header">Custom functions in SQL queries.</h2> * It is possible to write custom Java methods and call then form SQL queries. These methods must be public static * and annotated with {@link GridCacheQuerySqlFunction}. Classes containing these methods must be registered in - * {@gglink org.gridgain.grid.spi.indexing.h2.GridH2IndexingSpi#setIndexCustomFunctionClasses(java.lang.Class[])}. + * {@link GridQueryConfiguration#setIndexCustomFunctionClasses(Class[])}. * <h1 class="header">Full Text Queries</h1> * GridGain supports full text queries based on Apache Lucene engine. This queries are created by * {@link GridCacheQueries#createFullTextQuery(Class, String)} method. Note that all fields that @@ -143,8 +144,7 @@ import org.jetbrains.annotations.*; * mastersQry.execute(); * </pre> * <h1 class="header">Geo-Spatial Indexes and Queries</h1> - * GridGain also support <b>Geo-Spatial Indexes</b>. Here is an example of geo-spatial index - * (supported by {@gglink org.gridgain.grid.spi.indexing.h2.GridH2IndexingSpi}): + * GridGain also support <b>Geo-Spatial Indexes</b>. Here is an example of geo-spatial index: * <pre name="code" class="java"> * private class MapPoint implements Serializable { * // Geospatial index. http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/73b5ef6b/modules/core/src/main/java/org/gridgain/grid/cache/query/GridCacheQuerySqlField.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/gridgain/grid/cache/query/GridCacheQuerySqlField.java b/modules/core/src/main/java/org/gridgain/grid/cache/query/GridCacheQuerySqlField.java index aacdcfe..5846f83 100644 --- a/modules/core/src/main/java/org/gridgain/grid/cache/query/GridCacheQuerySqlField.java +++ b/modules/core/src/main/java/org/gridgain/grid/cache/query/GridCacheQuerySqlField.java @@ -25,7 +25,7 @@ public @interface GridCacheQuerySqlField { * Just like with databases, field indexing may require additional overhead * during updates, but makes select operations faster. * <p> - * When {@gglink org.gridgain.grid.spi.indexing.h2.GridH2IndexingSpi} is set as indexing SPI and indexed field is + * When indexing SPI and indexed field is * of type {@code com.vividsolutions.jts.geom.Geometry} (or any subclass of this class) then GridGain will * consider this index as spatial providing performance boost for spatial queries. * http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/73b5ef6b/modules/core/src/main/java/org/gridgain/grid/cache/query/GridCacheQuerySqlFunction.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/gridgain/grid/cache/query/GridCacheQuerySqlFunction.java b/modules/core/src/main/java/org/gridgain/grid/cache/query/GridCacheQuerySqlFunction.java index b18bd22..78410bf 100644 --- a/modules/core/src/main/java/org/gridgain/grid/cache/query/GridCacheQuerySqlFunction.java +++ b/modules/core/src/main/java/org/gridgain/grid/cache/query/GridCacheQuerySqlFunction.java @@ -9,12 +9,14 @@ package org.gridgain.grid.cache.query; +import org.apache.ignite.configuration.*; + import java.lang.annotation.*; /** * Annotates public static methods in classes to be used in SQL queries as custom functions. * Annotated class must be registered in H2 indexing SPI using following method - * {@gglink org.gridgain.grid.spi.indexing.h2.GridH2IndexingSpi#setIndexCustomFunctionClasses(java.lang.Class[])}. + * {@link GridQueryConfiguration#setIndexCustomFunctionClasses(Class[])}. * <p> * Example usage: * <pre name="code" class="java"> http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/73b5ef6b/modules/core/src/test/java/org/gridgain/loadtests/colocation/spring-colocation.xml ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/gridgain/loadtests/colocation/spring-colocation.xml b/modules/core/src/test/java/org/gridgain/loadtests/colocation/spring-colocation.xml index 51c7cf7..fc33788 100644 --- a/modules/core/src/test/java/org/gridgain/loadtests/colocation/spring-colocation.xml +++ b/modules/core/src/test/java/org/gridgain/loadtests/colocation/spring-colocation.xml @@ -45,19 +45,6 @@ <property name="marshalLocalJobs" value="false"/> - <!-- - Allow indexing SPI to index primitive values. - --> - <property name="indexingSpi"> - <list> - <bean class="org.gridgain.grid.spi.indexing.h2.GridH2IndexingSpi"> - <!-- Index primitives. --> - <property name="defaultIndexPrimitiveKey" value="false"/> - <property name="defaultIndexFixedTyping" value="true"/> - </bean> - </list> - </property> - <property name="collisionSpi"> <bean class="org.apache.ignite.spi.collision.fifoqueue.FifoQueueCollisionSpi"> <property name="parallelJobsNumber"><util:constant static-field="java.lang.Integer.MAX_VALUE"/></property> http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/73b5ef6b/modules/core/src/test/webapp/META-INF/gg-config.xml ---------------------------------------------------------------------- diff --git a/modules/core/src/test/webapp/META-INF/gg-config.xml b/modules/core/src/test/webapp/META-INF/gg-config.xml index b0f0af8..1f60c3e 100644 --- a/modules/core/src/test/webapp/META-INF/gg-config.xml +++ b/modules/core/src/test/webapp/META-INF/gg-config.xml @@ -72,27 +72,6 @@ <util:constant static-field="org.apache.ignite.events.IgniteEventType.EVTS_CACHE"/> </property> - <!-- - Allow indexing SPI to index primitive values. - --> - <property name="indexingSpi"> - <list> - <bean class="org.gridgain.grid.spi.indexing.h2.GridH2IndexingSpi"> - <!-- Index primitives. --> - <property name="defaultIndexPrimitiveKey" value="true"/> - - <!-- - Set to false to allow different key types for one value type. - - Note that this also means that '_key' column cannot participate in - where clause queries either directly through API, through JDBC driver, - or through Object Viewer in Visor DevOps Console. - --> - <!--property name="defaultIndexFixedTyping" value="false"/--> - </bean> - </list> - </property> - <property name="cacheConfiguration"> <!-- Specify list of cache configurations here. Any property from @@ -127,6 +106,14 @@ --> <property name="queryIndexEnabled" value="true"/> + <!-- Allow to index primitive values. --> + <property name="queryConfiguration"> + <bean class="org.gridgain.grid.cache.query.GridCacheQueryConfiguration"> + <!-- Index primitives. --> + <property name="indexPrimitiveKey" value="true"/> + </bean> + </property> + <!-- This shows how to configure number of backups. The below configuration sets the number of backups to 1 (which is default). @@ -168,6 +155,14 @@ --> <property name="queryIndexEnabled" value="true"/> + <!-- Allow to index primitive values. --> + <property name="queryConfiguration"> + <bean class="org.gridgain.grid.cache.query.GridCacheQueryConfiguration"> + <!-- Index primitives. --> + <property name="indexPrimitiveKey" value="true"/> + </bean> + </property> + <!-- This shows how to configure number of backups. The below configuration sets the number of backups to 1 (which is default). @@ -206,6 +201,14 @@ Default value is false. --> <property name="queryIndexEnabled" value="true"/> + + <!-- Allow to index primitive values. --> + <property name="queryConfiguration"> + <bean class="org.gridgain.grid.cache.query.GridCacheQueryConfiguration"> + <!-- Index primitives. --> + <property name="indexPrimitiveKey" value="true"/> + </bean> + </property> </bean> <!-- @@ -227,6 +230,14 @@ Default value is false. --> <property name="queryIndexEnabled" value="true"/> + + <!-- Allow to index primitive values. --> + <property name="queryConfiguration"> + <bean class="org.gridgain.grid.cache.query.GridCacheQueryConfiguration"> + <!-- Index primitives. --> + <property name="indexPrimitiveKey" value="true"/> + </bean> + </property> </bean> </list> </property> http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/73b5ef6b/modules/indexing/src/main/java/org/gridgain/grid/kernal/processors/query/h2/GridH2Indexing.java ---------------------------------------------------------------------- diff --git a/modules/indexing/src/main/java/org/gridgain/grid/kernal/processors/query/h2/GridH2Indexing.java b/modules/indexing/src/main/java/org/gridgain/grid/kernal/processors/query/h2/GridH2Indexing.java index 3a850cc..1d7fcdd 100644 --- a/modules/indexing/src/main/java/org/gridgain/grid/kernal/processors/query/h2/GridH2Indexing.java +++ b/modules/indexing/src/main/java/org/gridgain/grid/kernal/processors/query/h2/GridH2Indexing.java @@ -1928,7 +1928,7 @@ public class GridH2Indexing implements GridQueryIndexing { catch (ClassCastException e) { throw new GridException("Failed to convert key to SQL type. " + "Please make sure that you always store each value type with the same key type or disable " + - "'defaultIndexFixedTyping' property on GridH2IndexingSpi.", e); + "'defaultIndexFixedTyping' property.", e); } } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/73b5ef6b/modules/scalar/src/test/resources/spring-ping-pong-partner.xml ---------------------------------------------------------------------- diff --git a/modules/scalar/src/test/resources/spring-ping-pong-partner.xml b/modules/scalar/src/test/resources/spring-ping-pong-partner.xml index 5d4934b..3c9ca5c 100644 --- a/modules/scalar/src/test/resources/spring-ping-pong-partner.xml +++ b/modules/scalar/src/test/resources/spring-ping-pong-partner.xml @@ -116,27 +116,6 @@ </property> </bean> </property> - - <!-- - Allow indexing SPI to index primitive values. - --> - <property name="indexingSpi"> - <list> - <bean class="org.gridgain.grid.spi.indexing.h2.GridH2IndexingSpi"> - <!-- Index primitives. --> - <property name="defaultIndexPrimitiveKey" value="true"/> - - <!-- - Set to false to allow different key types for one value type. - - Note that this also means that '_key' column cannot participate in - where clause queries either directly through API, through JDBC driver, - or through Object Viewer in Visor DevOps Console. - --> - <!--property name="defaultIndexFixedTyping" value="false"/--> - </bean> - </list> - </property> </bean> </beans>