Package com.stardog.stark.query.io
Class AsyncSelectQueryResult
- java.lang.Object
-
- com.google.common.collect.UnmodifiableIterator<T>
-
- com.google.common.collect.AbstractIterator<T>
-
- com.complexible.common.base.CloseableIterator.AbstractCloseableIterator<BindingSet>
-
- com.stardog.stark.query.io.AsyncSelectQueryResult
-
- All Implemented Interfaces:
CloseableIterator<BindingSet>,QueryResult<BindingSet>,SelectQueryResult,java.lang.AutoCloseable,java.util.Iterator<BindingSet>
public class AsyncSelectQueryResult extends CloseableIterator.AbstractCloseableIterator<BindingSet> implements SelectQueryResult
ASelectQueryResultwhich asynchronously parses the result set from an input stream.- Since:
- 7.4.6
- Author:
- Pavel Klinov
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.complexible.common.base.CloseableIterator
CloseableIterator.AbstractCloseableIterator<T>, CloseableIterator.DelegatingCloseableIterator<T>, CloseableIterator.EmptyCloseableIterator<T>
-
-
Constructor Summary
Constructors Constructor Description AsyncSelectQueryResult(java.io.InputStream input, QueryResultParser<SelectQueryResultHandler> parser, java.util.concurrent.ExecutorService execService, int batchSize, CancelCheck cancelCheck, java.util.function.Consumer<java.lang.Boolean> onClose, java.util.function.Function<java.lang.Exception,java.lang.RuntimeException> onError)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Close the query results and return any resources in use back to the system.protected BindingSetcomputeNext()java.util.List<java.lang.String>variables()Return the list of projected variables from the query-
Methods inherited from class com.google.common.collect.AbstractIterator
endOfData, hasNext, next, peek
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.stardog.stark.query.QueryResult
hasNext, metadata, next, stream
-
-
-
-
Constructor Detail
-
AsyncSelectQueryResult
public AsyncSelectQueryResult(java.io.InputStream input, QueryResultParser<SelectQueryResultHandler> parser, java.util.concurrent.ExecutorService execService, int batchSize, CancelCheck cancelCheck, java.util.function.Consumer<java.lang.Boolean> onClose, java.util.function.Function<java.lang.Exception,java.lang.RuntimeException> onError)
-
-
Method Detail
-
close
public void close()
Description copied from interface:QueryResultClose the query results and return any resources in use back to the system. This *must* be called on all result sets to avoid resource leaks.- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfaceCloseableIterator<BindingSet>- Specified by:
closein interfaceQueryResult<BindingSet>
-
computeNext
protected BindingSet computeNext()
- Specified by:
computeNextin classcom.google.common.collect.AbstractIterator<BindingSet>
-
variables
@Nonnull public java.util.List<java.lang.String> variables()
Description copied from interface:SelectQueryResultReturn the list of projected variables from the query- Specified by:
variablesin interfaceSelectQueryResult- Returns:
- the projection
-
-