public interface AsyncGraphResultSet
The default implementation returned by the driver is not thread-safe: the iterable
returned by currentPage()
should only be iterated by a single thread. However, if
subsequent pages are requested via fetchNextPage()
, it's safe to process those new
instances in other threads (as long as each individual page of results is not accessed
concurrently).
GraphResultSet
Modifier and Type | Method and Description |
---|---|
void |
cancel()
Cancels the query and asks the server to stop sending results.
|
Iterable<GraphNode> |
currentPage()
The nodes in the current page.
|
CompletionStage<AsyncGraphResultSet> |
fetchNextPage()
Fetch the next page of results asynchronously.
|
GraphExecutionInfo |
getExecutionInfo()
Deprecated.
Use
getRequestExecutionInfo() instead. |
default ExecutionInfo |
getRequestExecutionInfo()
The execution information for this page of results.
|
boolean |
hasMorePages()
Whether there are more pages of results.
|
default GraphNode |
one()
Returns the next node, or
null if the result set is exhausted. |
int |
remaining()
How many rows are left before the current page is exhausted.
|
@NonNull default ExecutionInfo getRequestExecutionInfo()
@Deprecated @NonNull GraphExecutionInfo getExecutionInfo()
getRequestExecutionInfo()
instead.int remaining()
@NonNull Iterable<GraphNode> currentPage()
hasMorePages()
and
fetchNextPage()
.
Note that this method always returns the same object, and that that object can only be iterated once: nodes are "consumed" as they are read.
@Nullable default GraphNode one()
null
if the result set is exhausted.
This is convenient for queries that are known to return exactly one node.
boolean hasMorePages()
fetchNextPage()
to fetch the next
one asynchronously.@NonNull CompletionStage<AsyncGraphResultSet> fetchNextPage() throws IllegalStateException
IllegalStateException
- if there are no more pages. Use hasMorePages()
to check
if you can call this method.void cancel()
At this time, graph queries are not paginated and the server sends all the results at once; therefore this method has no effect.
Copyright © 2017–2020. All rights reserved.