Class FindIterable<T>
- Type Parameters:
T
- The type of documents contained in the collection. This generic type allowsFindIterable
to be used with any type of document, making it a flexible solution for a wide variety of data models.
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Iterable<T>
PageableIterable
to offer efficient, page-by-page iteration
over the results, which is particularly useful for handling large datasets.
Utilizing a lazy-loading approach, FindIterable
allows for seamless navigation through the result set
without the necessity of loading all documents into memory at once. This makes it an ideal choice for applications
that need to process or display large amounts of data with minimal memory footprint. As users iterate over the
collection, subsequent pages of results are fetched as needed, ensuring efficient use of resources.
This approach is advantageous in scenarios where the full result set might be too large to store in memory
comfortably or when only a portion of the results is needed by the application at any given time. By iterating
over the results with FindIterable
, applications can maintain lower memory usage while still having
the flexibility to access the entire result set.
-
Field Summary
Fields inherited from class com.datastax.astra.client.model.PageableIterable
active, collection, currentPage, currentPageAvailable, exhausted, filter, options, totalItemProcessed
-
Constructor Summary
ConstructorDescriptionFindIterable
(Collection<T> collection, Filter filter, FindOptions options) Constructor for a cursor over the elements of the find. -
Method Summary
Methods inherited from class com.datastax.astra.client.model.PageableIterable
close, fetchNextPage, getSortVector
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, spliterator
-
Field Details
-
currentPageIterator
Iterator on documents.
-
-
Constructor Details
-
FindIterable
Constructor for a cursor over the elements of the find.- Parameters:
collection
- source collection client, use to fetch next pagesfilter
- original filter used to renew the queryoptions
- list of options like the pageState, limit of skip
-
-
Method Details