use of org.apache.ignite.internal.util.GridCursorIteratorWrapper in project ignite by apache.
the class GridH2SpatialIndex method rowIterator.
/**
* @param i Spatial key iterator.
* @param filter Table filter.
* @return Iterator over rows.
*/
@SuppressWarnings("unchecked")
private GridCursor<GridH2Row> rowIterator(Iterator<SpatialKey> i, TableFilter filter) {
if (!i.hasNext())
return EMPTY_CURSOR;
long time = System.currentTimeMillis();
IndexingQueryFilter qryFilter = threadLocalFilter();
IndexingQueryCacheFilter qryCacheFilter = qryFilter != null ? qryFilter.forCache(getTable().cacheName()) : null;
List<GridH2Row> rows = new ArrayList<>();
do {
GridH2Row row = idToRow.get(i.next().getId());
assert row != null;
if (row.expireTime() != 0 && row.expireTime() <= time)
continue;
if (qryCacheFilter == null || qryCacheFilter.applyPartition(row.partition()))
rows.add(row);
} while (i.hasNext());
return new GridCursorIteratorWrapper(rows.iterator());
}
Aggregations