org.apache.ignite.internal.processors.cache.query

## Interface CacheQueries<K,V>

All Known Subinterfaces:
  GridCacheQueriesEx<K,V>

All Known Implementing Classes:
  GridCacheQueriesImpl, GridCacheQueriesProxy

    public interface CacheQueries<K,V>

Facade for creating distributed queries. It contains various `'createXxxQuery(..)'` methods for `SQL`, `TEXT`, and `SCAN` query creation (see `CacheQuery` for more information).

Instance of `CacheQueries` is obtained from cache projection as follows:

     CacheQueries q = Ignition.ignite().cache("myCache").queries();

### Method Summary

Methods
`CacheQuery<Map.Entry<K,V>>` `createFullTextQuery(Class<?> cls, String search)` Creates user's full text query, queried class, and query clause.
`CacheQuery<Map.Entry<K,V>>` `createFullTextQuery(String clsName, String search)` Creates user's full text query, queried class, and query clause.
`CacheQuery<Map.Entry<K,V>>` `createScanQuery(IgniteBiPredicate<K,V> filter)` Creates user's predicate based scan query.
`CacheQuery<List<?>>` `createSqlFieldsQuery(String qry)` Creates user's SQL fields query for given clause.
`CacheQuery<Map.Entry<K,V>>` `createSqlQuery(Class<?> cls, String clause)` Creates user's SQL query, queried class, and query clause which is generally a where clause.
`CacheQuery<Map.Entry<K,V>>` `createSqlQuery(String clsName, String clause)` Creates user's SQL query, queried class, and query clause which is generally a where clause.
`QueryMetrics` `metrics()` Accumulated metrics for all queries executed for this cache.
`IgniteInternalFuture<?>` `rebuildAllIndexes()` Forces this cache to rebuild search indexes of all types.
`IgniteInternalFuture<?>` `rebuildIndexes(Class<?> cls)` Forces this cache to rebuild all search indexes of given value type.
`IgniteInternalFuture<?>` `rebuildIndexes(String typeName)` Forces this cache to rebuild all search indexes of given value type.
`void` `resetMetrics()` Resets accumulated metrics.

### Method Detail

#### createSqlQuery

    CacheQuery<Map.Entry<K,V>> createSqlQuery(Class<?> cls,
                                            String clause)

Creates user's SQL query, queried class, and query clause which is generally a where clause. For more information refer to `CacheQuery` documentation.

Parameters:
  `cls` - Query class.
  `clause` - Query clause.
Returns:
  Created query.

#### createSqlQuery

    CacheQuery<Map.Entry<K,V>> createSqlQuery(String clsName,
                                            String clause)

Creates user's SQL query, queried class, and query clause which is generally a where clause. For more information refer to `CacheQuery` documentation.

Parameters:
  `clsName` - Query class name.
  `clause` - Query clause.
Returns:
  Created query.

#### createSqlFieldsQuery

    CacheQuery<List<?>> createSqlFieldsQuery(String qry)

Creates user's SQL fields query for given clause. For more information refer to `CacheQuery` documentation.

Parameters:
  `qry` - Query.
Returns:
  Created query.

#### createFullTextQuery

    CacheQuery<Map.Entry<K,V>> createFullTextQuery(String clsName,
                                                 String search)

Creates user's full text query, queried class, and query clause. For more information refer to `CacheQuery` documentation.

Parameters:
  `clsName` - Query class name.
  `search` - Search clause.
Returns:
  Created query.

#### createFullTextQuery

    CacheQuery<Map.Entry<K,V>> createFullTextQuery(Class<?> cls,
                                                 String search)

Creates user's full text query, queried class, and query clause. For more information refer to `CacheQuery` documentation.

Parameters:
  `cls` - Query class.
  `search` - Search clause.
Returns:
  Created query.

#### createScanQuery

    CacheQuery<Map.Entry<K,V>> createScanQuery(@Nullable
                                             IgniteBiPredicate<K,V> filter)

Creates user's predicate based scan query.

Parameters:
  `filter` - Scan filter.
Returns:
  Created query.

#### rebuildIndexes

    IgniteInternalFuture<?> rebuildIndexes(Class<?> cls)

Forces this cache to rebuild all search indexes of given value type. Sometimes indexes may hold references to objects that have already been removed from cache. Although not affecting query results, these objects may consume extra memory. Rebuilding indexes will remove any redundant references that may have temporarily got stuck inside in-memory index.

Parameters:
  `cls` - Value type to rebuild indexes for.
Returns:
  Future that will be completed when rebuilding of all indexes is finished.

#### rebuildIndexes

    IgniteInternalFuture<?> rebuildIndexes(String typeName)

Forces this cache to rebuild all search indexes of given value type. Sometimes indexes may hold references to objects that have already been removed from cache. Although not affecting query results, these objects may consume extra memory. Rebuilding indexes will remove any redundant references that may have temporarily got stuck inside in-memory index.

Parameters:
  `typeName` - Value type name to rebuild indexes for.
Returns:
  Future that will be completed when rebuilding of all indexes is finished.

#### rebuildAllIndexes

    IgniteInternalFuture<?> rebuildAllIndexes()

Forces this cache to rebuild search indexes of all types. Sometimes indexes may hold references to objects that have already been removed from cache. Although not affecting query results, these objects may consume extra memory. Rebuilding indexes will remove any redundant references that may have temporarily got stuck inside in-memory index.

Returns:
  Future that will be completed when rebuilding of all indexes is finished.

#### metrics

    QueryMetrics metrics()

Accumulated metrics for all queries executed for this cache.

Returns:
  Cache query metrics.

#### resetMetrics

    void resetMetrics()

Resets accumulated metrics.

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.0.0-RC1
Release Date | : February 17 2015