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

## Class AbstractScanQueryIterator<K,​V,​R>

- java.lang.Object
- - org.apache.ignite.internal.util.lang.GridIteratorAdapter<T>
  - - org.apache.ignite.internal.util.GridCloseableIteratorAdapter<R>
    - - org.apache.ignite.internal.processors.cache.query.AbstractScanQueryIterator<K,​V,​R>

All Implemented Interfaces:
  `Serializable`, `AutoCloseable`, `Iterable<R>`, `Iterator<R>`, `GridSerializableIterator<R>`, `GridCloseableIterator<R>`, `GridIterator<R>`, `IgniteSpiCloseableIterator<R>`

Direct Known Subclasses:
  `ScanQueryIterator`

    public abstract class AbstractScanQueryIterator<K,​V,​R>
    extends GridCloseableIteratorAdapter<R>

Abstract scan query iterator.

See Also:
  Serialized Form

### Field Summary

Fields
`protected GridCacheContext<K,​V>` `cctx`
`protected boolean` `statsEnabled`

### Constructor Summary

Constructors
`protected` `AbstractScanQueryIterator​(GridCacheContext<K,​V> cctx, CacheQuery<R> qry, IgniteClosure<javax.cache.Cache.Entry<K,​V>,​R> transform, boolean locNode)`

### Method Summary

All Methods Static Methods Instance Methods Abstract Methods Concrete Methods
`protected abstract R` `advance()` Moves the iterator to the next cache entry.
`GridCacheContext<K,​V>` `cacheContext()`
`static void` `closeFilter​(IgniteBiPredicate<?,​?> filter)`
`@Nullable IgniteBiPredicate<K,​V>` `filter()`
`R` `filterAndTransform​(KeyCacheObject key, CacheObject val, long start)` Perform filtering and transformation of key-value pair.
`boolean` `keepBinary()`
`boolean` `local()`
`protected void` `onClose()` Invoked on iterator close.
`protected boolean` `onHasNext()`
`protected R` `onNext()`
`UUID` `subjectId()`
`String` `taskName()`
`IgniteClosure<javax.cache.Cache.Entry<K,​V>,​R>` `transformer()`

### Methods inherited from class org.apache.ignite.internal.util.GridCloseableIteratorAdapter

`checkClosed, close, hasNextX, isClosed, nextX, onRemove, removeX`

### Methods inherited from class org.apache.ignite.internal.util.lang.GridIteratorAdapter

`hasNext, iterator, next, remove`

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

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

### Methods inherited from interface java.lang.Iterable

`forEach, iterator, spliterator`

### Methods inherited from interface java.util.Iterator

`forEachRemaining, hasNext, next, remove`

### Field Detail

#### statsEnabled

    protected final boolean statsEnabled

#### cctx

    protected final GridCacheContext<K,​V> cctx

### Constructor Detail

#### AbstractScanQueryIterator

    protected AbstractScanQueryIterator​(GridCacheContext<K,​V> cctx,
                                        CacheQuery<R> qry,
                                        IgniteClosure<javax.cache.Cache.Entry<K,​V>,​R> transform,
                                        boolean locNode)
                                 throws IgniteCheckedException

Parameters:
  `cctx` - Grid cache context.
  `qry` - Query adapter.
  `transform` - Optional transformer.
  `locNode` - Flag for local node iterator.
Throws:
  `IgniteCheckedException` - If failed.

### Method Detail

#### onNext

    protected R onNext()

Specified by:
  `onNext` in class `GridCloseableIteratorAdapter<R>`
Returns:
  Next element.

#### onHasNext

    protected boolean onHasNext()

Specified by:
  `onHasNext` in class `GridCloseableIteratorAdapter<R>`
Returns:
  `True` if iterator has next element.

#### onClose

    protected void onClose()

Invoked on iterator close.

Overrides:
  `onClose` in class `GridCloseableIteratorAdapter<R>`

#### advance

    protected abstract R advance()

Moves the iterator to the next cache entry.

#### filterAndTransform

    public R filterAndTransform​(KeyCacheObject key,
                                CacheObject val,
                                long start)

Perform filtering and transformation of key-value pair.

Returns:
  Object to return to the user, or `null` if filtered.

#### filter

    @Nullable
    public @Nullable IgniteBiPredicate<K,​V> filter()

#### closeFilter

    public static void closeFilter​(IgniteBiPredicate<?,​?> filter)

#### transformer

    public IgniteClosure<javax.cache.Cache.Entry<K,​V>,​R> transformer()

#### local

    public boolean local()

#### keepBinary

    public boolean keepBinary()

#### subjectId

    public UUID subjectId()

#### taskName

    public String taskName()

#### cacheContext

    public GridCacheContext<K,​V> cacheContext()