Class NodePageStream<R>
- java.lang.Object
-
- org.apache.ignite.internal.processors.cache.query.reducer.NodePageStream<R>
-
public class NodePageStream<R> extends Object
This class provides an interfaceheadPage()that returns a future will be completed withNodePageof cache query result from single node. A new page requests when previous page was fetched by class consumer.
-
-
Constructor Summary
Constructors Constructor Description NodePageStream(UUID nodeId, Runnable reqPages, Runnable cancelPages)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddPage(Collection<R> data, boolean last)Add new query result page of data.voidcancel(Throwable err)Cancel query on all nodes.booleanclosed()booleanhasRemotePages()CompletableFuture<NodePage<R>>headPage()Returns a last delivered page from this stream.UUIDnodeId()
-
-
-
Method Detail
-
nodeId
public UUID nodeId()
-
headPage
public CompletableFuture<NodePage<R>> headPage()
Returns a last delivered page from this stream.- Returns:
- Future that will be completed with query result page.
-
addPage
public void addPage(Collection<R> data, boolean last)
Add new query result page of data.- Parameters:
data- Collection of query result items.last- Whether it is the last page from this node.
-
cancel
public void cancel(Throwable err)
Cancel query on all nodes.
-
hasRemotePages
public boolean hasRemotePages()
- Returns:
trueif there are some undelivered page from the node, otherwisefalse.
-
closed
public boolean closed()
- Returns:
trueif this stream delivers all query results from the node to a consumer.
-
-