Package org.apache.ignite.lang
Interface AsyncCursor<T>
- Type Parameters:
T
- The type of elements returned by this iterator.
- All Known Subinterfaces:
AsyncResultSet<T>
public interface AsyncCursor<T>
Provides methods to iterate over operation results and release underlying resources in an asynchronous way.
-
Method Summary
Modifier and TypeMethodDescriptionCloses this cursor and releases any underlying resources.Returns the current page content if the operation returns results.int
Returns the current page size if the operation return results.CompletableFuture<? extends AsyncCursor<T>>
Fetches the next page of results asynchronously.boolean
Indicates whether there are more pages of results.
-
Method Details
-
currentPage
Returns the current page content if the operation returns results.- Returns:
- Iterable set of elements.
- Throws:
IgniteException
- If no results is returned.
-
currentPageSize
int currentPageSize()Returns the current page size if the operation return results.- Returns:
- The size of
currentPage()
. - Throws:
IgniteException
- If no results is returned.
-
fetchNextPage
CompletableFuture<? extends AsyncCursor<T>> fetchNextPage()Fetches the next page of results asynchronously. The current page is changed after the future completion. The methodscurrentPage()
,currentPageSize()
,hasMorePages()
use the current page and return consistent results between complete last page future and callfetchNextPage
.- Returns:
- A future which will be completed when next page will be fetched and set as the current page.
The future will return
this
for chaining. - Throws:
CursorClosedException
- If cursor is closed.
-
hasMorePages
boolean hasMorePages()Indicates whether there are more pages of results.- Returns:
True
if there are more pages with results,false
otherwise.
-
closeAsync
CompletableFuture<Void> closeAsync()Closes this cursor and releases any underlying resources.- Returns:
- A future which will be completed when the resources will be actually released.
-