Package gorsat

Class BatchedReadSource

java.lang.Object
org.gorpipe.gor.model.GenomicIterator
org.gorpipe.model.gor.iterators.RowSource
gorsat.BatchedReadSource
All Implemented Interfaces:
java.lang.AutoCloseable, java.util.Iterator<org.gorpipe.gor.model.Row>

public class BatchedReadSource
extends org.gorpipe.model.gor.iterators.RowSource
A wrapper rowSource reading the child rowSource in a thread into a buffer and offering to the main thread in batches

Created by sigmar on 21/11/2016.

  • Nested Class Summary

    Nested classes/interfaces inherited from class org.gorpipe.gor.model.GenomicIterator

    org.gorpipe.gor.model.GenomicIterator.ChromoLookup
  • Constructor Summary

    Constructors 
    Constructor Description
    BatchedReadSource​(java.util.Iterator<? extends org.gorpipe.gor.model.Row> sourceIterator, BatchedReadSourceConfig brsConfig, java.lang.String header, org.gorpipe.gor.monitor.GorMonitor gorMonitor)  
    BatchedReadSource​(org.gorpipe.model.gor.iterators.RowSource sourceIterator, BatchedReadSourceConfig brsConfig)  
  • Method Summary

    Modifier and Type Method Description
    void close()  
    double getAvgBasesPerMilliSecond()  
    double getAvgBatchSize()  
    double getAvgRowsPerMilliSecond()  
    double getAvgSeekTimeMilliSecond()  
    int getCurrentBatchLoc()  
    org.gorpipe.gor.model.Row getCurrentBatchRow​(int i)  
    int getCurrentBatchSize()  
    boolean hasNext()  
    boolean isBuffered()  
    boolean isCancelled()  
    org.gorpipe.gor.model.Row next()
    Make sure hasNext is called before this method
    void setPosition​(java.lang.String seekChr, int seekPos)  
    void updateTimeMeasurement​(long deltaTimeNs, RowBuffer current)  

    Methods inherited from class org.gorpipe.model.gor.iterators.RowSource

    bufferSize, bufferSize_$eq, clone, getBufferSize, getEx, getGorHeader, getParent, moveToPosition, moveToPosition$default$3, next, parent, parent_$eq, seek, setBufferSize, setEx, setParent, terminateReading

    Methods inherited from class org.gorpipe.gor.model.GenomicIterator

    decStat, filter, getColnum, getContext, getHeader, getLookup, getMonitor, getSourceName, incStat, init, initStats, isSourceAlreadyInserted, pushdownCalc, pushdownFilter, pushdownGor, pushdownSelect, pushdownTop, pushdownWrite, seek, select, selectHeader, setColnum, setContext, setHeader, setSourceAlreadyInserted, setSourceName

    Methods inherited from class java.lang.Object

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

    Methods inherited from interface java.util.Iterator

    forEachRemaining, remove
  • Constructor Details

  • Method Details

    • updateTimeMeasurement

      public void updateTimeMeasurement​(long deltaTimeNs, RowBuffer current)
    • getAvgRowsPerMilliSecond

      public double getAvgRowsPerMilliSecond()
      Overrides:
      getAvgRowsPerMilliSecond in class org.gorpipe.model.gor.iterators.RowSource
    • getAvgBasesPerMilliSecond

      public double getAvgBasesPerMilliSecond()
      Overrides:
      getAvgBasesPerMilliSecond in class org.gorpipe.model.gor.iterators.RowSource
    • getAvgSeekTimeMilliSecond

      public double getAvgSeekTimeMilliSecond()
      Overrides:
      getAvgSeekTimeMilliSecond in class org.gorpipe.model.gor.iterators.RowSource
    • getAvgBatchSize

      public double getAvgBatchSize()
      Overrides:
      getAvgBatchSize in class org.gorpipe.model.gor.iterators.RowSource
    • getCurrentBatchSize

      public int getCurrentBatchSize()
      Overrides:
      getCurrentBatchSize in class org.gorpipe.model.gor.iterators.RowSource
    • getCurrentBatchLoc

      public int getCurrentBatchLoc()
      Overrides:
      getCurrentBatchLoc in class org.gorpipe.model.gor.iterators.RowSource
    • getCurrentBatchRow

      public org.gorpipe.gor.model.Row getCurrentBatchRow​(int i)
      Overrides:
      getCurrentBatchRow in class org.gorpipe.model.gor.iterators.RowSource
    • hasNext

      public boolean hasNext()
      Specified by:
      hasNext in interface java.util.Iterator<org.gorpipe.gor.model.Row>
      Overrides:
      hasNext in class org.gorpipe.gor.model.GenomicIterator
      Returns:
      true if rowSource has more rows
    • next

      public org.gorpipe.gor.model.Row next()
      Make sure hasNext is called before this method
      Specified by:
      next in interface java.util.Iterator<org.gorpipe.gor.model.Row>
      Overrides:
      next in class org.gorpipe.gor.model.GenomicIterator
      Returns:
      the next row in the iterator
    • setPosition

      public void setPosition​(java.lang.String seekChr, int seekPos)
      Overrides:
      setPosition in class org.gorpipe.model.gor.iterators.RowSource
    • isCancelled

      public boolean isCancelled()
    • close

      public void close()
      Specified by:
      close in interface java.lang.AutoCloseable
      Specified by:
      close in class org.gorpipe.model.gor.iterators.RowSource
    • isBuffered

      public boolean isBuffered()
      Overrides:
      isBuffered in class org.gorpipe.model.gor.iterators.RowSource