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 void
close()
Should be implemented to close/release any underlying resources.boolean
hasNext()
SAMRecord
next()
protected int
readsInQueue()
-
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: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>
-
readsInQueue
protected int readsInQueue()
-
-