public class QueryCursorImpl<T> extends Object implements QueryCursorEx<T>, FieldsQueryCursor<T>
| Modifier and Type | Class and Description |
|---|---|
protected static class |
QueryCursorImpl.State
Query cursor state
|
QueryCursorEx.Consumer<T>| Constructor and Description |
|---|
QueryCursorImpl(Iterable<T> iterExec) |
QueryCursorImpl(Iterable<T> iterExec,
GridQueryCancel cancel) |
QueryCursorImpl(Iterable<T> iterExec,
GridQueryCancel cancel,
boolean isQry) |
| Modifier and Type | Method and Description |
|---|---|
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.
|
int |
getColumnsCount()
Gets number of columns in a row.
|
String |
getFieldName(int idx)
Gets field name.
|
boolean |
isQuery() |
Iterator<T> |
iterator() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorpublic QueryCursorImpl(Iterable<T> iterExec, GridQueryCancel cancel)
iterExec - Query executor.cancel - Cancellation closure.public QueryCursorImpl(Iterable<T> iterExec, GridQueryCancel cancel, boolean isQry)
iterExec - Query executor.isQry - Result type flag - true for query, false for update operation.public List<T> getAll()
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.
getAll in interface QueryCursor<T>public void getAll(QueryCursorEx.Consumer<T> clo) throws IgniteCheckedException
getAll in interface QueryCursorEx<T>clo - Consumer.IgniteCheckedExceptionpublic void close()
Note: don't forget to close query cursors. Not doing so may lead to various resource leaks.
close in interface AutoCloseableclose in interface QueryCursor<T>public boolean isQuery()
true if this cursor corresponds to a ResultSet as a result of query,
false if query was modifying operation like INSERT, UPDATE, or DELETE.public void fieldsMeta(List<GridQueryFieldMetadata> fieldsMeta)
fieldsMeta - SQL Fields query result metadata.public List<GridQueryFieldMetadata> fieldsMeta()
fieldsMeta in interface QueryCursorEx<T>public String getFieldName(int idx)
getFieldName in interface FieldsQueryCursor<T>idx - field index.public int getColumnsCount()
getColumnsCount in interface FieldsQueryCursor<T>
Follow @ApacheIgnite
Ignite Fabric : ver. 2.6.0 Release Date : July 10 2018