Class OrderIterator
java.lang.Object
org.eclipse.rdf4j.common.iteration.AbstractCloseableIteration<BindingSet>
org.eclipse.rdf4j.common.iteration.DelayedIteration<BindingSet>
org.eclipse.rdf4j.query.algebra.evaluation.iterator.OrderIterator
- All Implemented Interfaces:
AutoCloseable, Iterator<BindingSet>, CloseableIteration<BindingSet>
Sorts the input and optionally applies limit and distinct.
- Author:
- James Leigh, Arjohn Kampman
-
Field Summary
Fields inherited from interface CloseableIteration
EMPTY_STATEMENT_ITERATION -
Constructor Summary
ConstructorsConstructorDescriptionOrderIterator(CloseableIteration<BindingSet> iter, Comparator<BindingSet> comparator) OrderIterator(CloseableIteration<BindingSet> iter, Comparator<BindingSet> comparator, long limit, boolean distinct) OrderIterator(CloseableIteration<BindingSet> iter, Comparator<BindingSet> comparator, long limit, boolean distinct, long iterationSyncThreshold) -
Method Summary
Modifier and TypeMethodDescriptionprotected CloseableIteration<BindingSet> Creates the iteration that should be iterated over.protected voiddecrement(int amount) protected voidCloses this iteration as well as the underlying iteration if it has already been created and happens to be aCloseableIteration.protected voidprotected voidonInputRowRead(BindingSet next) protected voidonSortCompleted(long inputRows, long spillCount, long spillBytes) protected voidonSpillToDisk(int spilledRows, long spilledBytes) voidremove()Calls the remove method of the underlying iteration.Methods inherited from class DelayedIteration
hasNext, nextMethods inherited from class AbstractCloseableIteration
close, isClosedModifier and TypeMethodDescriptionfinal voidclose()CallsAbstractCloseableIteration.handleClose()upon first call and makes sure the resource closures are only executed once.final booleanisClosed()Checks whether this CloseableIteration has been closed.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface CloseableIteration
streamModifier and TypeMethodDescriptiondefault Stream<BindingSet> stream()Convert the results to a Java 8 Stream.Methods inherited from interface Iterator
forEachRemaining
-
Constructor Details
-
OrderIterator
-
OrderIterator
public OrderIterator(CloseableIteration<BindingSet> iter, Comparator<BindingSet> comparator, long limit, boolean distinct) -
OrderIterator
public OrderIterator(CloseableIteration<BindingSet> iter, Comparator<BindingSet> comparator, long limit, boolean distinct, long iterationSyncThreshold)
-
-
Method Details
-
createIteration
Description copied from class:DelayedIterationCreates the iteration that should be iterated over. This method is called only once, when the iteration is first needed.- Specified by:
createIterationin classDelayedIteration<BindingSet>- Throws:
QueryEvaluationException
-
increment
- Throws:
QueryEvaluationException
-
onInputRowRead
- Throws:
QueryEvaluationException
-
onSpillToDisk
- Throws:
QueryEvaluationException
-
onSortCompleted
protected void onSortCompleted(long inputRows, long spillCount, long spillBytes) -
decrement
- Throws:
QueryEvaluationException
-
remove
Description copied from class:DelayedIterationCalls the remove method of the underlying iteration.- Specified by:
removein interfaceIterator<BindingSet>- Overrides:
removein classDelayedIteration<BindingSet>- Throws:
QueryEvaluationException
-
handleClose
Description copied from class:DelayedIterationCloses this iteration as well as the underlying iteration if it has already been created and happens to be aCloseableIteration.- Overrides:
handleClosein classDelayedIteration<BindingSet>- Throws:
QueryEvaluationException
-