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

## Class GridCacheLocalQueryFuture<K,V,R>

- java.lang.Object
- - org.apache.ignite.internal.util.future.GridFutureAdapter<Collection<R>>
  - - org.apache.ignite.internal.processors.cache.query.GridCacheQueryFutureAdapter<K,V,R>
    - - org.apache.ignite.internal.processors.cache.query.GridCacheLocalQueryFuture<K,V,R>

All Implemented Interfaces:
  AutoCloseable, IgniteInternalFuture<Collection<R>>, CacheQueryFuture<R>, GridTimeoutObject

Direct Known Subclasses:
  GridCacheLocalFieldsQueryFuture

    public class GridCacheLocalQueryFuture<K,V,R>
    extends GridCacheQueryFutureAdapter<K,V,R>

Local query future.

### Field Summary

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

`cctx, loc, log, qry, reducer`

### Constructor Summary

Constructors
`protected` `GridCacheLocalQueryFuture(GridCacheContext<K,V> ctx, GridCacheQueryBean qry)`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `awaitFirstItemAvailable()` TODO: IGNITE-15728 Provide custom reducer for ScanQueryFallbackClosableIterator.
`protected void` `cancelQuery(Throwable err)` Cancels query on remote nodes and cleanes owned resources.
`protected void` `onError(Throwable err)` Invokes in case of this future error.
`protected void` `onPage(UUID nodeId, Collection<R> data, boolean lastPage)` Handles new data page from query node.

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

`cacheContext, cancel, close, endTime, fields, logger, next, onDone, onMeta, onNodeLeft, onPage, onTimeout, query, timeoutId, toString`

### Methods inherited from class org.apache.ignite.internal.util.future.GridFutureAdapter

`chain, chain, error, get, get, get, getUninterruptibly, ignoreInterrupts, isCancelled, isDone, isFailed, listen, onCancelled, onDone, onDone, onDone, onDone, reset, result`

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

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

### Methods inherited from interface org.apache.ignite.internal.processors.cache.query.CacheQueryFuture

`isDone`

### Methods inherited from interface org.apache.ignite.internal.IgniteInternalFuture

`chain, chain, error, get, get, get, getUninterruptibly, isCancelled, listen, result`

### Constructor Detail

#### GridCacheLocalQueryFuture

    protected GridCacheLocalQueryFuture(GridCacheContext<K,V> ctx,
                                        GridCacheQueryBean qry)

Parameters:
  `ctx` - Context.
  `qry` - Query.

### Method Detail

#### cancelQuery

    protected void cancelQuery(Throwable err)
                        throws IgniteCheckedException

Cancels query on remote nodes and cleanes owned resources.

Specified by:
  `cancelQuery` in class `GridCacheQueryFutureAdapter<K,V,R>`
Parameters:
  `err` - If query was cancelled with error.
Throws:
  `IgniteCheckedException` - In case of error.

#### awaitFirstItemAvailable

    public void awaitFirstItemAvailable()
                                 throws IgniteCheckedException

TODO: IGNITE-15728 Provide custom reducer for ScanQueryFallbackClosableIterator. Waits for the first item is available to return.

Specified by:
  `awaitFirstItemAvailable` in class `GridCacheQueryFutureAdapter<K,V,R>`
Throws:
  `IgniteCheckedException` - If query execution failed with an error.

#### onError

    protected void onError(Throwable err)

Invokes in case of this future error.

Specified by:
  `onError` in class `GridCacheQueryFutureAdapter<K,V,R>`

#### onPage

    protected void onPage(UUID nodeId,
                          Collection<R> data,
                          boolean lastPage)

Handles new data page from query node.

Specified by:
  `onPage` in class `GridCacheQueryFutureAdapter<K,V,R>`

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.12.0
Release Date | : January 10 2022