Class DefaultEvaluationStrategy.TimedIterator
- java.lang.Object
-
- org.eclipse.rdf4j.common.iteration.AbstractCloseableIteration<E,X>
-
- org.eclipse.rdf4j.common.iteration.IterationWrapper<BindingSet,QueryEvaluationException>
-
- org.eclipse.rdf4j.query.algebra.evaluation.impl.DefaultEvaluationStrategy.TimedIterator
-
- All Implemented Interfaces:
java.lang.AutoCloseable
,CloseableIteration<BindingSet,QueryEvaluationException>
,Iteration<BindingSet,QueryEvaluationException>
- Enclosing class:
- DefaultEvaluationStrategy
private static class DefaultEvaluationStrategy.TimedIterator extends IterationWrapper<BindingSet,QueryEvaluationException>
This class wraps an iterator and tracks the time used to execute next() and hasNext()
-
-
Field Summary
Fields Modifier and Type Field Description (package private) CloseableIteration<BindingSet,QueryEvaluationException>
iterator
(package private) QueryModelNode
queryModelNode
(package private) com.google.common.base.Stopwatch
stopwatch
-
Fields inherited from class org.eclipse.rdf4j.common.iteration.IterationWrapper
wrappedIter
-
-
Constructor Summary
Constructors Constructor Description TimedIterator(CloseableIteration<BindingSet,QueryEvaluationException> iterator, QueryModelNode queryModelNode)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
handleClose()
Closes this Iteration and also closes the wrapped Iteration if it is aCloseableIteration
.boolean
hasNext()
Checks whether the wrapped Iteration contains more elements, closing this Iteration when this is not the case.BindingSet
next()
Returns the next element from the wrapped Iteration.-
Methods inherited from class org.eclipse.rdf4j.common.iteration.IterationWrapper
remove
-
Methods inherited from class org.eclipse.rdf4j.common.iteration.AbstractCloseableIteration
close, isClosed
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.eclipse.rdf4j.common.iteration.CloseableIteration
stream
-
-
-
-
Field Detail
-
iterator
CloseableIteration<BindingSet,QueryEvaluationException> iterator
-
queryModelNode
QueryModelNode queryModelNode
-
stopwatch
com.google.common.base.Stopwatch stopwatch
-
-
Constructor Detail
-
TimedIterator
public TimedIterator(CloseableIteration<BindingSet,QueryEvaluationException> iterator, QueryModelNode queryModelNode)
-
-
Method Detail
-
next
public BindingSet next() throws QueryEvaluationException
Description copied from class:IterationWrapper
Returns the next element from the wrapped Iteration.- Specified by:
next
in interfaceIteration<BindingSet,QueryEvaluationException>
- Overrides:
next
in classIterationWrapper<BindingSet,QueryEvaluationException>
- Returns:
- the next element in the iteration.
- Throws:
QueryEvaluationException
-
hasNext
public boolean hasNext() throws QueryEvaluationException
Description copied from class:IterationWrapper
Checks whether the wrapped Iteration contains more elements, closing this Iteration when this is not the case.- Specified by:
hasNext
in interfaceIteration<BindingSet,QueryEvaluationException>
- Overrides:
hasNext
in classIterationWrapper<BindingSet,QueryEvaluationException>
- Returns:
- true if the wrapped Iteration contains more elements, false otherwise.
- Throws:
QueryEvaluationException
-
handleClose
protected void handleClose() throws QueryEvaluationException
Description copied from class:IterationWrapper
Closes this Iteration and also closes the wrapped Iteration if it is aCloseableIteration
.- Overrides:
handleClose
in classIterationWrapper<BindingSet,QueryEvaluationException>
- Throws:
QueryEvaluationException
-
-