org.openrdf.query.algebra.evaluation.federation
Class ServiceFallbackIteration

java.lang.Object
  extended by info.aduna.iteration.CloseableIterationBase<E,X>
      extended by info.aduna.iteration.LookAheadIteration<T,QueryEvaluationException>
          extended by org.openrdf.query.algebra.evaluation.federation.JoinExecutorBase<BindingSet>
              extended by org.openrdf.query.algebra.evaluation.federation.ServiceFallbackIteration
All Implemented Interfaces:
CloseableIteration<BindingSet,QueryEvaluationException>, Iteration<BindingSet,QueryEvaluationException>

public class ServiceFallbackIteration
extends JoinExecutorBase<BindingSet>

Fallback join handler, if the block join can not be performed, e.g. because the BINDINGS clause is not supported by the endpoint. Gets a materialized collection of bindings as input, and has to evaluate the join.

Author:
Andreas Schwarte

Field Summary
protected  Collection<BindingSet> bindings
           
protected  FederatedService federatedService
           
protected  String preparedQuery
           
protected  Service service
           
 
Fields inherited from class org.openrdf.query.algebra.evaluation.federation.JoinExecutorBase
closed, evaluationThread, finished, leftIter, NEXT_JOIN_ID, rightArg, rightIter, rightQueue
 
Constructor Summary
ServiceFallbackIteration(Service service, String preparedQuery, Collection<BindingSet> bindings, FederatedService federatedService)
           
 
Method Summary
protected  void handleBindings()
          Implementations must implement this method to handle bindings.
 
Methods inherited from class org.openrdf.query.algebra.evaluation.federation.JoinExecutorBase
addResult, done, getNextElement, handleClose, isFinished, run, toss
 
Methods inherited from class info.aduna.iteration.LookAheadIteration
hasNext, next, remove
 
Methods inherited from class info.aduna.iteration.CloseableIterationBase
close, isClosed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

service

protected final Service service

preparedQuery

protected final String preparedQuery

federatedService

protected final FederatedService federatedService

bindings

protected final Collection<BindingSet> bindings
Constructor Detail

ServiceFallbackIteration

public ServiceFallbackIteration(Service service,
                                String preparedQuery,
                                Collection<BindingSet> bindings,
                                FederatedService federatedService)
                         throws QueryEvaluationException
Parameters:
leftIter -
rightArg -
bindings -
Throws:
QueryEvaluationException
Method Detail

handleBindings

protected void handleBindings()
                       throws Exception
Description copied from class: JoinExecutorBase
Implementations must implement this method to handle bindings. Use the following as a template while (!closed && 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:
handleBindings in class JoinExecutorBase<BindingSet>
Throws:
Exception


Copyright © 2001-2012 Aduna. All Rights Reserved.