Package gorsat

Class BatchedReadSource

java.lang.Object
org.gorpipe.gor.model.GenomicIteratorBase
gorsat.BatchedReadSource
All Implemented Interfaces:
AutoCloseable, 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.

  • Constructor Details

    • BatchedReadSource

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

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

    • setEx

      public void setEx(Throwable throwable)
    • getEx

      public 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(String seekChr, int seekPos)
    • isCancelled

      public boolean isCancelled()
    • close

      public void close()
    • isBuffered

      public boolean isBuffered()