ExperimentalReadShardBalancer: close() exhausted iterators
Fixes a truly awful SAMReaders resource leak reported by Eric -- thanks Eric!
This commit is contained in:
parent
9fd30d6f1c
commit
0b488cce66
|
|
@ -89,6 +89,10 @@ public class ExperimentalReadShardBalancer extends ShardBalancer {
|
||||||
|
|
||||||
// If we've exhausted the current file pointer of reads, move to the next file pointer (if there is one):
|
// If we've exhausted the current file pointer of reads, move to the next file pointer (if there is one):
|
||||||
if ( currentFilePointerReadsIterator != null && ! currentFilePointerReadsIterator.hasNext() ) {
|
if ( currentFilePointerReadsIterator != null && ! currentFilePointerReadsIterator.hasNext() ) {
|
||||||
|
|
||||||
|
// Close the old, exhausted chain of iterators to release resources
|
||||||
|
currentFilePointerReadsIterator.close();
|
||||||
|
|
||||||
do {
|
do {
|
||||||
advanceFilePointer();
|
advanceFilePointer();
|
||||||
} while ( currentFilePointer != null && isEmpty(currentFilePointer.fileSpans) ); // skip empty file pointers
|
} while ( currentFilePointer != null && isEmpty(currentFilePointer.fileSpans) ); // skip empty file pointers
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue