Skip to content

Commit

Permalink
Remove endOfInput check from submit method implementations.
Browse files Browse the repository at this point in the history
  • Loading branch information
cmnbroad committed Jan 26, 2019
1 parent b807bb8 commit aa2ca23
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,6 @@ public final class PositionalDownsampler extends ReadsDownsampler {

private List<GATKRead> finalizedReads;

/**
* Reads may be submitted until signalEndOfInput is called, after which no more reads may be submitted unless
* one of {@link #consumeFinalizedItems()} or {@link #clearItems()} is called to reset the internal state of
* the downsampler.
*/
private boolean endOfInputStream;

/**
* Construct a PositionalDownsampler
*
Expand All @@ -46,7 +39,6 @@ public final class PositionalDownsampler extends ReadsDownsampler {
public PositionalDownsampler( final int targetCoverage, final SAMFileHeader header ) {
Utils.validateArg(targetCoverage > 0, "targetCoverage must be > 0");
Utils.nonNull(header);
Utils.validate(! endOfInputStream, "attempt to submit read after end of input stream has been signaled");

this.reservoir = new ReservoirDownsampler(targetCoverage);
this.finalizedReads = new ArrayList<>();
Expand Down Expand Up @@ -148,7 +140,6 @@ public int size() {

@Override
public void signalEndOfInput() {
endOfInputStream = true;
finalizeReservoir(false);
}

Expand All @@ -157,7 +148,6 @@ public void clearItems() {
reservoir.clearItems();
reservoir.resetStats();
finalizedReads.clear();
endOfInputStream = false;
previousRead = null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,6 @@ public ReservoirDownsampler(final int targetSampleSize ) {
@Override
public void submit ( final GATKRead newRead ) {
Utils.nonNull(newRead, "newRead");
// Once the end of the input stream has been seen, consumeFinalizedItems or clearItems must be called to
// reset the state of the ReservoirDownsampler before more items can be submitted
Utils.validate(! endOfInputStream, "attempt to submit read after end of input stream has been signaled");

// Only count reads that are actually eligible for discarding for the purposes of the reservoir downsampling algorithm
totalReadsSeen++;
Expand Down

0 comments on commit aa2ca23

Please sign in to comment.