Package htsjdk.samtools.util
Class SAMRecordPrefetchingIterator
java.lang.Object
htsjdk.samtools.util.SAMRecordPrefetchingIterator
- All Implemented Interfaces:
CloseableIterator<SAMRecord>,Closeable,AutoCloseable,Iterator<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 Summary
ConstructorsConstructorDescriptionSAMRecordPrefetchingIterator(CloseableIterator<SAMRecord> iterator, int basePrefetchLimit) Creates a new iterator that traverses the given iterator on a background thread -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface htsjdk.samtools.util.CloseableIterator
stream, toListMethods inherited from interface java.util.Iterator
forEachRemaining, remove
-
Constructor Details
-
SAMRecordPrefetchingIterator
Creates a new iterator that traverses the given iterator on a background thread- Parameters:
iterator- the iterator to traversebasePrefetchLimit- the number of bases to prefetch
-
-
Method Details
-
close
public void close()Description copied from interface:CloseableIteratorShould be implemented to close/release any underlying resources.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceCloseableIterator<SAMRecord>
-
hasNext
public boolean hasNext() -
next
-
readsInQueue
protected int readsInQueue()
-