class ListFieldsQueryCursor<Row> implements FieldsQueryCursor<List<?>>, QueryCursorEx<List<?>> {
    /** */
    private final Iterator<List<?>> it;

    /** */
    private final List<GridQueryFieldMetadata> fieldsMeta;

    /** */
    private final boolean isQry;

    /**
     * @param plan Query plan.
     * @param it Iterator.
     * @param ectx Row converter.
     */
    public ListFieldsQueryCursor(MultiStepPlan plan, Iterator<List<?>> it, ExecutionContext<Row> ectx) {
        FieldsMetadata metadata0 = plan.fieldsMetadata();
        assert metadata0 != null;
        fieldsMeta = metadata0.queryFieldsMetadata(ectx.getTypeFactory());
        isQry = plan.type() == QueryPlan.Type.QUERY;

        this.it = it;
    }

    /** {@inheritDoc} */
    @NotNull @Override public Iterator<List<?>> iterator() {
        return it;
    }

    /** {@inheritDoc} */
    @Override public List<List<?>> getAll() {
        ArrayList<List<?>> res = new ArrayList<>();

        try {
            getAll(res::add);
        }
        catch (IgniteCheckedException e) {
            throw U.convertException(e);
        }

        return res;
    }

    /** {@inheritDoc} */
    @Override public void getAll(Consumer<List<?>> c) throws IgniteCheckedException {<FILL_FUNCTION_BODY>}

    /** {@inheritDoc} */
    @Override public List<GridQueryFieldMetadata> fieldsMeta() {
        return fieldsMeta;
    }

    /** {@inheritDoc} */
    @Override public String getFieldName(int idx) {
        return fieldsMeta.get(idx).fieldName();
    }

    /** {@inheritDoc} */
    @Override public int getColumnsCount() {
        return fieldsMeta.size();
    }

    /** {@inheritDoc} */
    @Override public boolean isQuery() {
        return isQry;
    }

    /** {@inheritDoc} */
    @Override public void close() {
        Commons.closeQuiet(it);
    }
}

        try {
            while (it.hasNext())
                c.consume(it.next());
        }
        finally {
            close();
        }
    
<no_super_class>