org.apache.ignite.internal.processors.cache

## Class QueryCursorImpl<T>

- java.lang.Object
- - org.apache.ignite.internal.processors.cache.QueryCursorImpl<T>

All Implemented Interfaces:
  AutoCloseable, Iterable<T>, QueryCursor<T>, QueryCursorEx<T>

    public class QueryCursorImpl<T>
    extends Object
    implements QueryCursorEx<T>

Query cursor implementation.

### Nested Class Summary

### Nested classes/interfaces inherited from interface org.apache.ignite.internal.processors.cache.query.QueryCursorEx

`QueryCursorEx.Consumer<T>`

### Constructor Summary

Constructors
Constructor and Description
`QueryCursorImpl(Iterable<T> iterExec)`

### Method Summary

Methods
`void` `close()` Closes all resources related to this cursor.
`List<GridQueryFieldMetadata>` `fieldsMeta()`
`void` `fieldsMeta(List<GridQueryFieldMetadata> fieldsMeta)`
`List<T>` `getAll()` Gets all query results and stores them in the collection.
`void` `getAll(QueryCursorEx.Consumer<T> clo)` Get all values passing them through passed consumer.
`Iterator<T>` `iterator()`

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

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

### Constructor Detail

#### QueryCursorImpl

    public QueryCursorImpl(Iterable<T> iterExec)

Parameters:
  `iterExec` - Query executor.

### Method Detail

#### iterator

    public Iterator<T> iterator()

Specified by:
  `iterator` in interface `Iterable<T>`

#### getAll

    public List<T> getAll()

Gets all query results and stores them in the collection. Use this method when you know in advance that query result is relatively small and will not cause memory utilization issues.

Since all the results will be fetched, all the resources will be closed automatically after this call, e.g. there is no need to call `QueryCursor.close()` method in this case.

Specified by:
  `getAll` in interface `QueryCursor<T>`
Returns:
  List containing all query results.

#### getAll

    public void getAll(QueryCursorEx.Consumer<T> clo)
                throws IgniteCheckedException

Get all values passing them through passed consumer.

Specified by:
  `getAll` in interface `QueryCursorEx<T>`
Parameters:
  `clo` - Consumer.
Throws:
  `IgniteCheckedException`

#### close

    public void close()

Closes all resources related to this cursor.

Specified by:
  `close` in interface `AutoCloseable`
Specified by:
  `close` in interface `QueryCursor<T>`

#### fieldsMeta

    public void fieldsMeta(List<GridQueryFieldMetadata> fieldsMeta)

Parameters:
  `fieldsMeta` - SQL Fields query result metadata.

#### fieldsMeta

    public List<GridQueryFieldMetadata> fieldsMeta()

Specified by:
  `fieldsMeta` in interface `QueryCursorEx<T>`
Returns:
  SQL Fields query result metadata.

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.6.0
Release Date | : May 18 2016