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
ConstructorDescriptionSAMRecordPrefetchingIterator
(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, wait
Methods inherited from interface htsjdk.samtools.util.CloseableIterator
stream, toList
Methods 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:CloseableIterator
Should be implemented to close/release any underlying resources.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceCloseableIterator<SAMRecord>
-
hasNext
public boolean hasNext() -
next
-
readsInQueue
protected int readsInQueue()
-