public class ResultSet extends Object implements Iterable<Result>
ResultSet
is returned from the submission of a Gremlin script to the server and represents the
results provided by the server. The results from the server are streamed into the ResultSet
and
therefore may not be available immediately. As such, ResultSet
provides access to a a number
of functions that help to work with the asynchronous nature of the data streaming back. Data from results
is stored in an Result
which can be used to retrieve the item once it is on the client side.Constructor and Description |
---|
ResultSet(org.apache.tinkerpop.gremlin.driver.ResponseQueue responseQueue,
ExecutorService executor,
Channel channel,
Supplier<Void> onChannelError) |
Modifier and Type | Method and Description |
---|---|
CompletableFuture<List<Result>> |
all()
Wait for all items to be available on the client exhausting the stream.
|
boolean |
allItemsAvailable()
Determines if all items have been returned to the client.
|
CompletableFuture<Integer> |
awaitItems(int items)
Wait for some number of items to be available on the client.
|
int |
getAvailableItemCount()
Gets the number of items available on the client.
|
boolean |
isExhausted()
Determines if there are any remaining items being streamed to the client.
|
Iterator<Result> |
iterator() |
Result |
one()
Get the next
Result from the stream, blocking until one is available. |
Stream<Result> |
stream()
Stream items with a blocking iterator.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public ResultSet(org.apache.tinkerpop.gremlin.driver.ResponseQueue responseQueue, ExecutorService executor, Channel channel, Supplier<Void> onChannelError)
public boolean allItemsAvailable()
public int getAvailableItemCount()
public boolean isExhausted()
public CompletableFuture<Integer> awaitItems(int items)
public CompletableFuture<List<Result>> all()
Copyright © 2013–2015 Apache Software Foundation. All rights reserved.