T
- input typeV
- transformed output typepublic static class IgniteRepositoryQuery.QueryCursorWrapper<T,V> extends AbstractCollection<V> implements QueryCursor<V>
Ensures closing underline cursor when there is no data.
Constructor and Description |
---|
QueryCursorWrapper(QueryCursor<T> delegate,
Function<T,V> transformer)
Instantiates a new Query cursor wrapper.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes all resources related to this cursor.
|
List<V> |
getAll()
Gets all query results and stores them in the collection.
|
Iterator<V> |
iterator() |
int |
size() |
add, addAll, clear, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
forEach, spliterator
equals, hashCode, parallelStream, removeIf, spliterator, stream
public QueryCursorWrapper(QueryCursor<T> delegate, Function<T,V> transformer)
delegate
- delegate QueryCursor with T input elementstransformer
- Function to transform T to V elementspublic Iterator<V> iterator()
iterator
in interface Iterable<V>
iterator
in interface Collection<V>
iterator
in class AbstractCollection<V>
public void close()
Note: don't forget to close query cursors. Not doing so may lead to various resource leaks.
close
in interface AutoCloseable
close
in interface QueryCursor<V>
public List<V> 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<V>
public int size()
size
in interface Collection<V>
size
in class AbstractCollection<V>
GridGain In-Memory Computing Platform : ver. 8.9.15 Release Date : December 3 2024