Class SAMRecordPrefetchingIterator

java.lang.Object
htsjdk.samtools.util.SAMRecordPrefetchingIterator
All Implemented Interfaces:
CloseableIterator<SAMRecord>, Closeable, AutoCloseable, Iterator<SAMRecord>

public class SAMRecordPrefetchingIterator extends Object implements CloseableIterator<SAMRecord>
Iterator that uses a dedicated background thread to prefetch SAMRecords, reading ahead by a set number of bases to improve throughput.

Note that this implementation is not synchronized. If multiple threads access an instance concurrently, it must be synchronized externally.

  • Constructor Details

    • SAMRecordPrefetchingIterator

      public SAMRecordPrefetchingIterator(CloseableIterator<SAMRecord> iterator, int basePrefetchLimit)
      Creates a new iterator that traverses the given iterator on a background thread
      Parameters:
      iterator - the iterator to traverse
      basePrefetchLimit - the number of bases to prefetch
  • Method Details