Package htsjdk.samtools.util
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 Summary
Constructors Constructor Description SAMRecordPrefetchingIterator(CloseableIterator<SAMRecord> iterator, int basePrefetchLimit)Creates a new iterator that traverses the given iterator on a background thread
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Should be implemented to close/release any underlying resources.booleanhasNext()SAMRecordnext()protected intreadsInQueue()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface htsjdk.samtools.util.CloseableIterator
stream, toList
-
Methods inherited from interface java.util.Iterator
forEachRemaining, remove
-
-
-
-
Constructor Detail
-
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 traversebasePrefetchLimit- the number of bases to prefetch
-
-
Method Detail
-
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>
-
readsInQueue
protected int readsInQueue()
-
-