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
ASelectQueryResult
which 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.lang.Runnable 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 void
close()
Close the query results and return any resources in use back to the system.protected BindingSet
computeNext()
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.lang.Runnable onClose, java.util.function.Function<java.lang.Exception,java.lang.RuntimeException> onError)
-
-
Method Detail
-
close
public void close()
Description copied from interface:QueryResult
Close 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:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfaceCloseableIterator<BindingSet>
- Specified by:
close
in interfaceQueryResult<BindingSet>
-
computeNext
protected BindingSet computeNext()
- Specified by:
computeNext
in classcom.google.common.collect.AbstractIterator<BindingSet>
-
variables
@Nonnull public java.util.List<java.lang.String> variables()
Description copied from interface:SelectQueryResult
Return the list of projected variables from the query- Specified by:
variables
in interfaceSelectQueryResult
- Returns:
- the projection
-
-