public class ResultIterable extends Object implements Iterable<Result>
Result objects contained in a QueryResponse returned when executing a QueryRequest. The class
will fetch new results as needed until all results that match the query provided have been
exhausted.
Since the class may use the page size provided in the Query to fetch the results, its
value should be carefully set to avoid any memory or performance issues.
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_PAGE_SIZE |
| Modifier and Type | Method and Description |
|---|---|
Iterator<Result> |
iterator() |
static ResultIterable |
resultIterable(CatalogFramework catalogFramework,
QueryRequest queryRequest)
Creates an iterable that will call the
CatalogFramework to retrieve the results that
match the QueryRequest provided. |
static ResultIterable |
resultIterable(CatalogFramework catalogFramework,
QueryRequest queryRequest,
int maxResultCount)
Creates an iterable that will call the
CatalogFramework to retrieve the results that
match the QueryRequest provided. |
static ResultIterable |
resultIterable(QueryFunction queryFunction,
QueryRequest queryRequest)
Creates an iterable that will call a
QueryFunction to retrieve the results that match
the QueryRequest provided. |
static ResultIterable |
resultIterable(QueryFunction queryFunction,
QueryRequest queryRequest,
int maxResultCount)
Creates an iterable that will call a
QueryFunction to retrieve the results that match
the QueryRequest provided. |
Stream<Result> |
stream() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorpublic static final int DEFAULT_PAGE_SIZE
public static ResultIterable resultIterable(CatalogFramework catalogFramework, QueryRequest queryRequest)
CatalogFramework to retrieve the results that
match the QueryRequest provided. There will be no limit to the number of results
returned.catalogFramework - reference to the CatalogFramework to call to retrieve the
results.queryRequest - request used to retrieve the results.public static ResultIterable resultIterable(QueryFunction queryFunction, QueryRequest queryRequest)
QueryFunction to retrieve the results that match
the QueryRequest provided. There will be no limit to the number of results returned.queryFunction - reference to the QueryFunction to call to retrieve the results.queryRequest - request used to retrieve the results.public static ResultIterable resultIterable(CatalogFramework catalogFramework, QueryRequest queryRequest, int maxResultCount)
CatalogFramework to retrieve the results that
match the QueryRequest provided.catalogFramework - reference to the CatalogFramework to call to retrieve the
results.queryRequest - request used to retrieve the results.maxResultCount - a positive integer indicating the maximum number of results in total to
query forpublic static ResultIterable resultIterable(QueryFunction queryFunction, QueryRequest queryRequest, int maxResultCount)
QueryFunction to retrieve the results that match
the QueryRequest provided.queryFunction - reference to the QueryFunction to call to retrieve the results.queryRequest - request used to retrieve the results.maxResultCount - a positive integer indicating the maximum number of results in total to
query forThis work is licensed under a Creative Commons Attribution 4.0 International License.