Class RepositoryFederatedService.BatchingServiceIteration
java.lang.Object
org.eclipse.rdf4j.common.iteration.AbstractCloseableIteration<BindingSet, QueryEvaluationException>
org.eclipse.rdf4j.common.iteration.LookAheadIteration<BindingSet, QueryEvaluationException>
org.eclipse.rdf4j.repository.sparql.federation.JoinExecutorBase<BindingSet>
org.eclipse.rdf4j.repository.sparql.federation.RepositoryFederatedService.BatchingServiceIteration
- All Implemented Interfaces:
AutoCloseable, CloseableIteration<BindingSet, QueryEvaluationException>, Iteration<BindingSet, QueryEvaluationException>
- Enclosing class:
RepositoryFederatedService
private class RepositoryFederatedService.BatchingServiceIteration
extends JoinExecutorBase<BindingSet>
A convenience iteration for SERVICE expression which evaluates intermediate results in batches and manages all
results. Uses
JoinExecutorBase facilities to guarantee correct access to the final results-
Field Summary
FieldsFields inherited from class JoinExecutorBase
bindings, closed, finished, leftIter, NEXT_JOIN_ID, rightArg, rightIter, rightQueue -
Constructor Summary
ConstructorsConstructorDescriptionBatchingServiceIteration(CloseableIteration<BindingSet, QueryEvaluationException> inputBindings, int blockSize, Service service) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidImplementations must implement this method to handle bindings.Methods inherited from class JoinExecutorBase
addResult, done, getNextElement, handleClose, isFinished, run, tossMethods inherited from class LookAheadIteration
hasNext, next, removeMethods inherited from class AbstractCloseableIteration
close, isClosedMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface CloseableIteration
stream
-
Field Details
-
blockSize
private final int blockSize -
service
-
-
Constructor Details
-
BatchingServiceIteration
public BatchingServiceIteration(CloseableIteration<BindingSet, QueryEvaluationException> inputBindings, int blockSize, Service service) throws QueryEvaluationException - Parameters:
inputBindings-- Throws:
QueryEvaluationException
-
-
Method Details
-
handleBindings
Description copied from class:JoinExecutorBaseImplementations must implement this method to handle bindings. Use the following as a templatewhile (!closed invalid input: '&'invalid input: '&' leftIter.hasNext()) { // your code }and add results to rightQueue. Note that addResult() is implemented synchronized and thus thread safe. In case you can guarantee sequential access, it is also possible to directly access rightQueue- Specified by:
handleBindingsin classJoinExecutorBase<BindingSet>- Throws:
Exception
-