Class QueryIterRepeatApplyConcurrent

java.lang.Object
org.apache.jena.sparql.util.PrintSerializableBase
org.apache.jena.sparql.engine.iterator.QueryIteratorBase
org.apache.jena.sparql.engine.iterator.QueryIter
org.apache.jena.sparql.engine.iterator.QueryIter1
org.aksw.jenax.arq.service.vfs.QueryIterRepeatApplyConcurrent
All Implemented Interfaces:
Iterator<org.apache.jena.sparql.engine.binding.Binding>, org.apache.jena.atlas.io.Printable, org.apache.jena.atlas.iterator.IteratorCloseable<org.apache.jena.sparql.engine.binding.Binding>, org.apache.jena.atlas.lib.Closeable, org.apache.jena.sparql.engine.QueryIterator, org.apache.jena.sparql.util.PrintSerializable

public abstract class QueryIterRepeatApplyConcurrent extends org.apache.jena.sparql.engine.iterator.QueryIter1
This is a variant of QueryIterRepeatApply which consumes up to N elements from the input and schedules concurrent tasks that start buffering the related items for each input. Whenever _this_ iterator advances to data of the next task, that task is stopped and a QueryIterConcat is formed between the buffered items and the remaining items. This means that at this point the remaining items of the current task are no longer loaded concurrently. However, all further tasks still run concurrently. Buffers currently have unlimited size.
  • Constructor Summary

    Constructors
    Constructor
    Description
    QueryIterRepeatApplyConcurrent(org.apache.jena.sparql.engine.QueryIterator input, org.apache.jena.sparql.engine.ExecutionContext execCxt, ExecutorService executorService, int maxConcurrentTasks)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
     
    protected org.apache.jena.sparql.engine.QueryIterator
     
    protected boolean
     
    protected org.apache.jena.sparql.engine.binding.Binding
     
    protected abstract org.apache.jena.sparql.engine.QueryIterator
    nextStage(org.apache.jena.sparql.engine.binding.Binding binding, org.apache.jena.sparql.engine.ExecutionContext isolatedExecCxt)
     
    protected void
     

    Methods inherited from class org.apache.jena.sparql.engine.iterator.QueryIter1

    closeIterator, details, getInput, output, requestCancel

    Methods inherited from class org.apache.jena.sparql.engine.iterator.QueryIter

    close, flatMap, getExecContext, getIteratorNumber, makeTracked, map, materialize, materialize, output

    Methods inherited from class org.apache.jena.sparql.engine.iterator.QueryIteratorBase

    cancel, hasNext, isFinished, next, nextBinding, performClose, performRequestCancel, remove

    Methods inherited from class org.apache.jena.sparql.util.PrintSerializableBase

    toString, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface java.util.Iterator

    forEachRemaining

    Methods inherited from interface org.apache.jena.sparql.util.PrintSerializable

    toString

    Methods inherited from interface org.apache.jena.sparql.engine.QueryIterator

    isJoinIdentity
  • Constructor Details

    • QueryIterRepeatApplyConcurrent

      public QueryIterRepeatApplyConcurrent(org.apache.jena.sparql.engine.QueryIterator input, org.apache.jena.sparql.engine.ExecutionContext execCxt, ExecutorService executorService, int maxConcurrentTasks)
  • Method Details

    • getCurrentStage

      protected org.apache.jena.sparql.engine.QueryIterator getCurrentStage()
    • nextStage

      protected abstract org.apache.jena.sparql.engine.QueryIterator nextStage(org.apache.jena.sparql.engine.binding.Binding binding, org.apache.jena.sparql.engine.ExecutionContext isolatedExecCxt)
      Parameters:
      binding -
      isolatedExecCxt - A fresh execution context local to the executing thread. ExecutionContexts are not thread-safe (as of Jena 5.2.0) and concurrent access causes exceptions with at least the iterator tracking mechanism.
      Returns:
    • hasNextBinding

      protected boolean hasNextBinding()
      Specified by:
      hasNextBinding in class org.apache.jena.sparql.engine.iterator.QueryIteratorBase
    • moveToNextBinding

      protected org.apache.jena.sparql.engine.binding.Binding moveToNextBinding()
      Specified by:
      moveToNextBinding in class org.apache.jena.sparql.engine.iterator.QueryIteratorBase
    • closeSubIterator

      protected void closeSubIterator()
      Specified by:
      closeSubIterator in class org.apache.jena.sparql.engine.iterator.QueryIter1
    • requestSubCancel

      protected void requestSubCancel()
      Specified by:
      requestSubCancel in class org.apache.jena.sparql.engine.iterator.QueryIter1