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

## Class GridCacheDistributedQueryManager<K,V>

- java.lang.Object
- - org.apache.ignite.internal.processors.cache.GridCacheManagerAdapter<K,V>
  - - org.apache.ignite.internal.processors.cache.query.GridCacheQueryManager<K,V>
    - - org.apache.ignite.internal.processors.cache.query.GridCacheDistributedQueryManager<K,V>

All Implemented Interfaces:
  GridCacheManager<K,V>

    public class GridCacheDistributedQueryManager<K,V>
    extends GridCacheQueryManager<K,V>

Distributed query manager (for cache in REPLICATED / PARTITIONED cache mode).

### Field Summary

### Fields inherited from class org.apache.ignite.internal.processors.cache.GridCacheManagerAdapter

`cctx, log, starting`

### Constructor Summary

Constructors
Constructor and Description
`GridCacheDistributedQueryManager()`

### Method Summary

Methods
`protected void` `addQueryFuture(long reqId, GridCacheDistributedQueryFuture<?,?,?> fut)` Removes query future from futures map.
`protected GridCacheDistributedQueryFuture<?,?,?>` `getQueryFuture(long reqId)` Gets query future from futures map.
`void` `loadPage(long id, GridCacheQueryAdapter<?> qry, Collection<ClusterNode> nodes, boolean all)` Loads page.
`void` `onDisconnected(IgniteFuture<?> reconnectFut)`
`protected boolean` `onFieldsPageReady(boolean loc, org.apache.ignite.internal.processors.cache.query.GridCacheQueryInfo qryInfo, List<GridQueryFieldMetadata> metadata, Collection<?> entities, Collection<?> data, boolean finished, Throwable e)`
`protected void` `onKernalStop0(boolean cancel)`
`protected boolean` `onPageReady(boolean loc, org.apache.ignite.internal.processors.cache.query.GridCacheQueryInfo qryInfo, Collection<?> data, boolean finished, Throwable e)` Called when data for page is ready.
`void` `printMemoryStats()` Prints memory statistics for debugging purposes.
`CacheQueryFuture<?>` `queryDistributed(GridCacheQueryBean qry, Collection<ClusterNode> nodes)` Executes distributed query.
`CacheQueryFuture<?>` `queryFieldsDistributed(GridCacheQueryBean qry, Collection<ClusterNode> nodes)` Executes distributed fields query.
`CacheQueryFuture<?>` `queryFieldsLocal(GridCacheQueryBean qry)` Executes distributed fields query.
`protected void` `removeQueryFuture(long reqId)` Removes query future from futures map.
`GridCloseableIterator` `scanQueryDistributed(GridCacheQueryAdapter qry, Collection<ClusterNode> nodes)` Executes distributed SCAN query.
`void` `start0()`

### Methods inherited from class org.apache.ignite.internal.processors.cache.query.GridCacheQueryManager

`backupsFilter, collectMetrics, createFullTextQuery, createScanQuery, createScanQuery, createSpiQuery, createSqlFieldsQuery, detailMetrics, enabled, evictDetailMetrics, metrics, queryLocal, queryTopologyVersion, remove, removeFieldsQueryResult, removeQueryResult, resetDetailMetrics, resetMetrics, runFieldsQuery, runQuery, scanQueryLocal, space, sqlMetadata, stop0, store`

### Methods inherited from class org.apache.ignite.internal.processors.cache.GridCacheManagerAdapter

`context, kernalStartInfo, kernalStopInfo, log, onKernalStart, onKernalStart0, onKernalStop, start, startInfo, stop, stopInfo, toString`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Constructor Detail

#### GridCacheDistributedQueryManager

    public GridCacheDistributedQueryManager()

### Method Detail

#### start0

    public void start0()
                throws IgniteCheckedException

Overrides:
  `start0` in class `GridCacheQueryManager<K,V>`
Throws:
  `IgniteCheckedException` - If failed.

#### onKernalStop0

    protected void onKernalStop0(boolean cancel)

Overrides:
  `onKernalStop0` in class `GridCacheQueryManager<K,V>`
Parameters:
  `cancel` - Cancel flag.

#### onDisconnected

    public void onDisconnected(IgniteFuture<?> reconnectFut)

Specified by:
  `onDisconnected` in interface `GridCacheManager<K,V>`
Overrides:
  `onDisconnected` in class `GridCacheManagerAdapter<K,V>`
Parameters:
  `reconnectFut` - Reconnect future.

#### printMemoryStats

    public void printMemoryStats()

Prints memory statistics for debugging purposes.

Specified by:
  `printMemoryStats` in interface `GridCacheManager<K,V>`
Overrides:
  `printMemoryStats` in class `GridCacheQueryManager<K,V>`

#### addQueryFuture

    protected void addQueryFuture(long reqId,
                      GridCacheDistributedQueryFuture<?,?,?> fut)

Removes query future from futures map.

Parameters:
  `reqId` - Request id.
  `fut` - Query future.

#### removeQueryFuture

    protected void removeQueryFuture(long reqId)

Removes query future from futures map.

Parameters:
  `reqId` - Request id.

#### getQueryFuture

    protected GridCacheDistributedQueryFuture<?,?,?> getQueryFuture(long reqId)

Gets query future from futures map.

Parameters:
  `reqId` - Request id.
Returns:
  Found future or null.

#### onPageReady

    protected boolean onPageReady(boolean loc,
                      org.apache.ignite.internal.processors.cache.query.GridCacheQueryInfo qryInfo,
                      Collection<?> data,
                      boolean finished,
                      Throwable e)

Called when data for page is ready.

Specified by:
  `onPageReady` in class `GridCacheQueryManager<K,V>`
Parameters:
  `loc` - Local query or not.
  `qryInfo` - Query info.
  `data` - Result data.
  `finished` - Last page or not.
  `e` - Exception in case of error.
Returns:
  `true` if page was processed right.

#### onFieldsPageReady

    protected boolean onFieldsPageReady(boolean loc,
                            org.apache.ignite.internal.processors.cache.query.GridCacheQueryInfo qryInfo,
                            @Nullable
                            List<GridQueryFieldMetadata> metadata,
                            @Nullable
                            Collection<?> entities,
                            @Nullable
                            Collection<?> data,
                            boolean finished,
                            @Nullable
                            Throwable e)

Specified by:
  `onFieldsPageReady` in class `GridCacheQueryManager<K,V>`
Parameters:
  `loc` - Local query or not.
  `qryInfo` - Query info.
  `metadata` - Meta data.
  `entities` - Indexing entities.
  `data` - Data.
  `finished` - Last page or not.
  `e` - Exception in case of error.
Returns:
  `true` if page was processed right.

#### queryDistributed

    public CacheQueryFuture<?> queryDistributed(GridCacheQueryBean qry,
                                       Collection<ClusterNode> nodes)

Executes distributed query.

Specified by:
  `queryDistributed` in class `GridCacheQueryManager<K,V>`
Parameters:
  `qry` - Query.
  `nodes` - Nodes.
Returns:
  Query future.

#### scanQueryDistributed

    public GridCloseableIterator scanQueryDistributed(GridCacheQueryAdapter qry,
                                             Collection<ClusterNode> nodes)
                                               throws IgniteCheckedException

Executes distributed SCAN query.

Specified by:
  `scanQueryDistributed` in class `GridCacheQueryManager<K,V>`
Parameters:
  `qry` - Query.
  `nodes` - Nodes.
Returns:
  Iterator.
Throws:
  `IgniteCheckedException` - If failed.

#### loadPage

    public void loadPage(long id,
                GridCacheQueryAdapter<?> qry,
                Collection<ClusterNode> nodes,
                boolean all)

Loads page.

Specified by:
  `loadPage` in class `GridCacheQueryManager<K,V>`
Parameters:
  `id` - Query ID.
  `qry` - Query.
  `nodes` - Nodes.
  `all` - Whether to load all pages.

#### queryFieldsLocal

    public CacheQueryFuture<?> queryFieldsLocal(GridCacheQueryBean qry)

Executes distributed fields query.

Specified by:
  `queryFieldsLocal` in class `GridCacheQueryManager<K,V>`
Parameters:
  `qry` - Query.
Returns:
  Query future.

#### queryFieldsDistributed

    public CacheQueryFuture<?> queryFieldsDistributed(GridCacheQueryBean qry,
                                             Collection<ClusterNode> nodes)

Executes distributed fields query.

Specified by:
  `queryFieldsDistributed` in class `GridCacheQueryManager<K,V>`
Parameters:
  `qry` - Query.
  `nodes` - Nodes.
Returns:
  Query future.

2017 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 2.0.0
Release Date | : April 30 2017