Package com.complexible.common.rdf.query
Class IteratorAsQueryResult<T>
java.lang.Object
com.google.common.collect.UnmodifiableIterator<T>
com.google.common.collect.AbstractIterator<T>
com.complexible.common.rdf.query.IteratorAsQueryResult<T>
- All Implemented Interfaces:
CloseableIterator<T>,AutoCloseable,Iterator<T>
- Direct Known Subclasses:
IteratorAsBooleanQueryResult,IteratorAsGraphQueryResult,IteratorAsPathQueryResult,IteratorAsTupleQueryResult
public abstract class IteratorAsQueryResult<T>
extends com.google.common.collect.AbstractIterator<T>
implements CloseableIterator<T>
Base super-class for all iterator-as-query-result classes. It handles the on-success, on-failure, and on-close callbacks.
The result also optionally carries the optimized Plan that produced it (see getPlan()). The query engine
always embeds the plan here — it is already computed, so this is free — which lets the server return it on request
(see QueryDetail.PLAN) without a separate execution. The plan is null for results not built by the
engine's normal execution path.
- 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
ConstructorsConstructorDescriptionIteratorAsQueryResult(CloseableIterator<T> theIter, Runnable theOnClose, Runnable theOnSuccess, Function<Exception, RuntimeException> theOnError) IteratorAsQueryResult(CloseableIterator<T> theIter, Runnable theOnClose, Runnable theOnSuccess, Function<Exception, RuntimeException> theOnError, com.complexible.stardog.plan.Plan thePlan) -
Method Summary
Methods inherited from class com.google.common.collect.AbstractIterator
endOfData, hasNext, next, peekMethods inherited from class com.google.common.collect.UnmodifiableIterator
removeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Iterator
forEachRemaining, hasNext, next, remove
-
Constructor Details
-
IteratorAsQueryResult
public IteratorAsQueryResult(CloseableIterator<T> theIter, Runnable theOnClose, Runnable theOnSuccess, Function<Exception, RuntimeException> theOnError) -
IteratorAsQueryResult
public IteratorAsQueryResult(CloseableIterator<T> theIter, Runnable theOnClose, Runnable theOnSuccess, Function<Exception, RuntimeException> theOnError, com.complexible.stardog.plan.Plan thePlan)
-
-
Method Details
-
getPlan
public com.complexible.stardog.plan.Plan getPlan()The optimized query plan that produced this result, ornullif this result was not created by the query engine's normal execution path. Embedding it costs nothing (the plan already exists); rendering it to a string is only done on demand, by the caller. -
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseableIterator<T>- Throws:
QueryExecutionFailure
-
computeNext
- Specified by:
computeNextin classcom.google.common.collect.AbstractIterator<T>
-