Class IteratorDelegateWithWorkerThread<T,I extends Iterator<T>>

java.lang.Object
org.aksw.commons.collections.PrefetchIterator<T>
org.aksw.jenax.dataaccess.sparql.link.query.IteratorDelegateWithWorkerThread<T,I>
All Implemented Interfaces:
Closeable, AutoCloseable, Iterator<T>, org.apache.jena.atlas.iterator.IteratorCloseable<T>, org.apache.jena.atlas.lib.Closeable

public class IteratorDelegateWithWorkerThread<T,I extends Iterator<T>> extends org.aksw.commons.collections.PrefetchIterator<T> implements org.apache.jena.atlas.iterator.IteratorCloseable<T>
  • Field Details

    • helper

      protected WorkerThreadBase helper
    • batchSize

      protected int batchSize
      Number of items to transfer in batch from the worker thread to the calling thread
    • delegate

      protected I extends Iterator<T> delegate
  • Constructor Details

    • IteratorDelegateWithWorkerThread

      public IteratorDelegateWithWorkerThread(I delegate, ExecutorService es)
    • IteratorDelegateWithWorkerThread

      public IteratorDelegateWithWorkerThread(I delegate, ExecutorService es, int batchSize)
  • Method Details

    • getDelegate

      public I getDelegate()
    • copy

      protected T copy(T item)
      Certain objects such as TDB2 Bindings must be copied in order to detach them from resources that are free'd when the iterator is closed.
    • prefetch

      protected Iterator<T> prefetch() throws Exception
      Specified by:
      prefetch in class org.aksw.commons.collections.PrefetchIterator<T>
      Throws:
      Exception
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Specified by:
      close in interface org.apache.jena.atlas.lib.Closeable
      Overrides:
      close in class org.aksw.commons.collections.PrefetchIterator<T>