Class DBCThreadedIterator<E>

  • Type Parameters:
    E -
    All Implemented Interfaces:
    java.util.Iterator<E>
    Direct Known Subclasses:
    ThreadedColumnsIterator, ThreadedColumnsToRetrieveIterator

    public abstract class DBCThreadedIterator<E>
    extends DBCIterator<E>

    This iterator class employs multiple Threads for database queries. While the iterator offers access to retrieved values, additional values are concurrently retrieved from the database by another thread.

    The iterator uses the Exchanger class to communicate between threads.

    Author:
    hellrich/faessler
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      abstract void close()
      Frees resources occupied by this iterator (e.g.
      boolean hasNext()  
      abstract void join()  
      E next()  
      void remove()
      unsupported
      protected void update()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.util.Iterator

        forEachRemaining
    • Field Detail

      • listExchanger

        protected java.util.concurrent.Exchanger<java.util.List<E>> listExchanger
    • Constructor Detail

      • DBCThreadedIterator

        public DBCThreadedIterator()
    • Method Detail

      • hasNext

        public boolean hasNext()
      • next

        public E next()
      • remove

        public void remove()
        unsupported
      • update

        protected void update()
      • close

        public abstract void close()
        Description copied from class: DBCIterator
        Frees resources occupied by this iterator (e.g. database connections).
        Specified by:
        close in class DBCIterator<E>
      • join

        public abstract void join()
                           throws java.lang.InterruptedException
        Throws:
        java.lang.InterruptedException