Package gorsat

Class BatchedReadSource

  • All Implemented Interfaces:
    java.lang.AutoCloseable, java.util.Iterator<org.gorpipe.gor.model.Row>, org.gorpipe.gor.model.GenomicIterator, org.gorpipe.gor.model.RowSourceStats

    public class BatchedReadSource
    extends org.gorpipe.gor.model.GenomicIteratorBase
    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.

    • Field Summary

      • Fields inherited from class org.gorpipe.gor.model.GenomicIteratorBase

        statsSenderAnnotation, statsSenderName
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      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()  
      java.lang.Throwable getEx()  
      boolean hasNext()  
      boolean isBuffered()  
      boolean isCancelled()  
      org.gorpipe.gor.model.Row next()
      Make sure hasNext is called before this method
      boolean seek​(java.lang.String seekChr, int seekPos)  
      void setEx​(java.lang.Throwable throwable)  
      void updateTimeMeasurement​(long deltaTimeNs, RowBuffer current)  
      • Methods inherited from class org.gorpipe.gor.model.GenomicIteratorBase

        clone, decStat, getBufferSize, getContext, getHeader, getSourceName, incStat, init, initStats, isSourceAlreadyInserted, setBufferSize, 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 org.gorpipe.gor.model.GenomicIterator

        filter, getMonitor, moveToPosition, moveToPosition, pushdownCalc, pushdownCmd, pushdownFilter, pushdownGor, pushdownSelect, pushdownTop, pushdownWrite, seek, select
      • Methods inherited from interface java.util.Iterator

        forEachRemaining, remove
    • Constructor Detail

      • BatchedReadSource

        public BatchedReadSource​(org.gorpipe.gor.model.GenomicIterator sourceIterator,
                                 BatchedReadSourceConfig brsConfig)
      • BatchedReadSource

        public BatchedReadSource​(java.util.Iterator<? extends org.gorpipe.gor.model.Row> sourceIterator,
                                 BatchedReadSourceConfig brsConfig,
                                 java.lang.String header,
                                 org.gorpipe.gor.monitor.GorMonitor gorMonitor)
    • Method Detail

      • setEx

        public void setEx​(java.lang.Throwable throwable)
      • getEx

        public java.lang.Throwable getEx()
      • updateTimeMeasurement

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

        public double getAvgRowsPerMilliSecond()
      • getAvgBasesPerMilliSecond

        public double getAvgBasesPerMilliSecond()
      • getAvgSeekTimeMilliSecond

        public double getAvgSeekTimeMilliSecond()
      • getAvgBatchSize

        public double getAvgBatchSize()
      • getCurrentBatchSize

        public int getCurrentBatchSize()
      • getCurrentBatchLoc

        public int getCurrentBatchLoc()
      • getCurrentBatchRow

        public org.gorpipe.gor.model.Row getCurrentBatchRow​(int i)
      • hasNext

        public boolean hasNext()
        Returns:
        true if rowSource has more rows
      • next

        public org.gorpipe.gor.model.Row next()
        Make sure hasNext is called before this method
        Returns:
        the next row in the iterator
      • seek

        public boolean seek​(java.lang.String seekChr,
                            int seekPos)
      • isCancelled

        public boolean isCancelled()
      • close

        public void close()
      • isBuffered

        public boolean isBuffered()